Skip to content

Conversation

@phdum-a
Copy link
Contributor

@phdum-a phdum-a commented Jan 10, 2025

Obtain circuit from PROM operator.

Draft: Pending #302, #309 merges and expecting follow up changes from those.

@phdum-a phdum-a force-pushed the phdum/multi_excitation branch 3 times, most recently from 0bbd871 to 04a6a38 Compare March 28, 2025 21:56
@phdum-a phdum-a force-pushed the phdum/multi_excitation branch 2 times, most recently from 576db7f to 9a8b33a Compare April 1, 2025 01:00
@phdum-a phdum-a force-pushed the phdum/prom_synthesis branch from 1345ffc to 99faed2 Compare April 2, 2025 18:48
@phdum-a phdum-a force-pushed the phdum/prom_synthesis branch 3 times, most recently from 4f9dcd1 to 1de618d Compare April 16, 2025 20:36
Base automatically changed from phdum/multi_excitation to main April 16, 2025 21:50
@hughcars hughcars force-pushed the phdum/prom_synthesis branch from 1de618d to 777dbba Compare April 16, 2025 21:52
@phdum-a phdum-a force-pushed the phdum/prom_synthesis branch from 777dbba to 8410b5b Compare May 20, 2025 18:21
@phdum-a phdum-a force-pushed the phdum/prom_synthesis branch from 8410b5b to 645e19f Compare July 14, 2025 22:39
@hughcars hughcars force-pushed the phdum/prom_synthesis branch 2 times, most recently from 00c89d6 to 6dea781 Compare August 26, 2025 16:40
@phdum-a phdum-a force-pushed the phdum/prom_synthesis branch from 6dea781 to 06c680d Compare August 30, 2025 00:12
@phdum-a phdum-a force-pushed the phdum/prom_synthesis branch from 06c680d to 70f588c Compare September 17, 2025 16:28
@phdum-a phdum-a marked this pull request as ready for review September 17, 2025 21:42
@phdum-a phdum-a requested a review from hughcars September 17, 2025 21:43
@phdum-a phdum-a force-pushed the phdum/prom_synthesis branch 5 times, most recently from 1e98f37 to 10a0443 Compare September 25, 2025 18:28
@phdum-a phdum-a force-pushed the phdum/prom_synthesis branch from 10a0443 to f9691b4 Compare September 29, 2025 21:47
Copy link
Collaborator

@hughcars hughcars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a quick look whilst waiting on your fixes on the normalization.

}
const auto &orth_R = prom_op.GetRomOrthogonalityMatrix();
MFEM_VERIFY(orth_R.isDiagonal(), "Lumped port modes should have exactly zero overlap");
// TODO(phdum): Test this.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debris, I assume wip given our inner product discussions.

// nullptr check. Kr, Mr, Cr would require a numerical check on imag elements.

auto unit_henry = units.GetScaleFactor<Units::ValueType::INDUCTANCE>();
auto m_Linv = ((1.0 / unit_henry) * v_d) * Kr * v_d;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m_Linv isn't a great unit name, is this the Linv for a mode?

Comment on lines 847 to 882
RHS.SetSize(GetNDSpace().GetTrueVSize());
RHS.UseDevice(true);
RHS = 0.0;

MFEM_VERIFY(RHS.Size() == GetNDSpace().GetTrueVSize(),
"Invalid T-vector size for AddExcitationVector1Internal!");
SumVectorCoefficient fb(GetMesh().SpaceDimension());

const auto &data = lumped_port_op.GetPort(port_idx);

mfem::Array<int> attr_list;
mfem::Array<int> attr_marker;

for (const auto &elem : data.elems)
{
attr_list.Append(elem->GetAttrList());
fb.AddCoefficient(
elem->GetModeCoefficient(1.0 / (elem->GetGeometryWidth() * data.elems.size())));
}
auto &mesh = GetNDSpace().GetParMesh();
int bdr_attr_max = mesh.bdr_attributes.Size() ? mesh.bdr_attributes.Max() : 0;
mesh::AttrToMarker(bdr_attr_max, attr_list, attr_marker);

mfem::LinearForm rhs1(&GetNDSpace().Get());
rhs1.AddBoundaryIntegrator(new VectorFEBoundaryLFIntegrator(fb), attr_marker);
rhs1.UseFastAssembly(false);
rhs1.UseDevice(false);
rhs1.Assemble();
rhs1.UseDevice(true);
GetNDSpace().GetProlongationMatrix()->AddMultTranspose(rhs1, RHS.Real());

if (zero_metal)
{
linalg::SetSubVector(RHS.Real(), nd_dbc_tdof_lists.back(), 0.0);
}
return true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not looking at this rn based on our discussions, I believe you're fixing this up based on your new understanding.

bool GetExcitationVector(int excitation_idx, Vector &RHS);
bool GetExcitationVector(int excitation_idx, double omega, ComplexVector &RHS);

bool GetLumpedPortExcitationVector(int port_idx, ComplexVector &RHS, bool zero_metal);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc string.

@phdum-a phdum-a force-pushed the phdum/prom_synthesis branch from f9691b4 to eef61b9 Compare October 3, 2025 00:48
@phdum-a phdum-a force-pushed the phdum/prom_synthesis branch 3 times, most recently from 1b98be6 to f94f27f Compare November 20, 2025 00:27
- Replace manual vector search and insert with stl functions
- Don't fix max basis size by using vector reserve
- De-duplicate code
- Fix PROM printing bug
- Improve comments
- Add verifications and small code cleaning
- Add unit tests for both weighted and existing orthogonalization
- Move logic to add port modes into prom_op.
 port mode adding into rom operator
 - Small comments

fixup
- Add orthogonality tolerance in UpdatePROM
- Always use refined Gram-Schmidt in RomOp with circuit synthesis
- Works on 3x2x1 domain
- Test lumped port normalizations, power, voltage etc
- Includes single and multi-element port
- Includes cases with proximate PEC to port
- Weight matrix of hybrid domain-port mass term
- Merge weighted and unweighted inner product
- Make a private function to help testing
- Bind && to local object in ctor
@phdum-a phdum-a force-pushed the phdum/prom_synthesis branch from 240d841 to 6fc8c82 Compare December 2, 2025 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants