-
Notifications
You must be signed in to change notification settings - Fork 85
PROM Circuit Extraction #326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
0bbd871 to
04a6a38
Compare
576db7f to
9a8b33a
Compare
1345ffc to
99faed2
Compare
4f9dcd1 to
1de618d
Compare
1de618d to
777dbba
Compare
777dbba to
8410b5b
Compare
8410b5b to
645e19f
Compare
00c89d6 to
6dea781
Compare
6dea781 to
06c680d
Compare
06c680d to
70f588c
Compare
1e98f37 to
10a0443
Compare
10a0443 to
f9691b4
Compare
hughcars
left a comment
There was a problem hiding this 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.
palace/drivers/drivensolver.cpp
Outdated
| } | ||
| const auto &orth_R = prom_op.GetRomOrthogonalityMatrix(); | ||
| MFEM_VERIFY(orth_R.isDiagonal(), "Lumped port modes should have exactly zero overlap"); | ||
| // TODO(phdum): Test this. |
There was a problem hiding this comment.
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.
palace/models/romoperator.cpp
Outdated
| // 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; |
There was a problem hiding this comment.
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?
palace/models/spaceoperator.cpp
Outdated
| 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; |
There was a problem hiding this comment.
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.
palace/models/spaceoperator.hpp
Outdated
| 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc string.
f9691b4 to
eef61b9
Compare
1b98be6 to
f94f27f
Compare
- 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
240d841 to
6fc8c82
Compare
Obtain circuit from PROM operator.
Draft: Pending #302, #309 merges and expecting follow up changes from those.