Skip to content
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

EQPElement and EQPSample #49

Merged
merged 10 commits into from
Jul 6, 2024
Merged

EQPElement and EQPSample #49

merged 10 commits into from
Jul 6, 2024

Conversation

dreamer2368
Copy link
Collaborator

@dreamer2368 dreamer2368 commented Jul 5, 2024

Important bug fix on TopologyHandler::GetInterfaceTransformations

TopologyHandler::GetInterfaceTransformations does not return proper FaceElementTransformationss, if two input meshes are an identical object. Previously it was not explicitly known where this is happening, and only InterfaceForm::AssembleInterfaceMatrixAtPort implicitly handled it.

TopologyHandler::GetInterfaceTransformations now enforces the input meshes to be not identical, and all routines using this function ensure to pass a copied object if two meshes are identical.

NOTE: currently copying a mesh only happens at matrix assembly/EQP training and does not impact the performance of the ROM solve.

EQPSample

This class is essentially a quadrature point for EQP scheme. It contains:

  • SampleInfo
  • Shape functions and gradient of shape functions

EQPElement

This class is essentially a finite element for EQP scheme. Actually, it serves as a container for array of EQPSample, supporting file I/O for them.

Changes in HyperreductionIntegrator

Fast integration routines taking EQPSample

Instead of passing sample point and weight individually, now an EQPSample is passed as an input. This EQPSample contains precomputed shape functions and their gradients.

Removed precomputation

  • Previously we let HyperreductionIntegrator to decide what type of coefficients it would use, but now all HyperreductionIntegrators are regulated to use the shape functions and their gradients.
  • HyperreductionIntegrator used to have a member variable bool precomputable, in order to specify the integrators that support precomputed EQP scheme. Now that all EQP shape functions are moved out of the integrator, this member variable precomputable is removed and all integrators should be able to support precomputed EQP scheme.

Changes in ROMNonlinearForm and ROMInterfaceForm

  • Instead of storing arrays of SampleInfo, now arrays of EQPElements are stored.
  • PrecomputeCoefficients routines compute the shape functions and their gradients.
  • Mult (InterfaceAddMult) and GetGradient (InterfaceGradient) now iterate over EQPSamples.

Changes in ROMNonlinearForm

There are now two ways of changing the EQPElement arrays, depending on the use of ROMNonlinearForm:

  • Update...IntegratorSampling assumes the ownership of EQPElement arrays. It deletes the existing array and creates a new one to contain the input samples.
  • Set...EQPElems assumes the non-ownership of EQPElement arrays. It only changes the pointer to the EQPElement array.

It is determined by a member variable const bool reference, which denotes whether the object is a reference to create/train EQP samples:

  • reference=true is set for component ROMNonlinearForm.
    • EQP samples can be created and trained via TrainEQP, and updated via Update...IntegratorSampling.
    • Set...EQPElems routines are forbidden, which store pointers to EQPElement of other (reference) ROMNonlinearForm.
  • reference=false is set for subdomain ROMNonlinearForm.
    • Subdomain ROMNonlinearForm is supposed to only use the pre-trained EQPSamples. The use of TrainEQP and Update...IntegratorSampling is forbidden.
    • It is only supposed to use Set...EQPElems routines, in order to use EQPElement from other (reference) ROMNonlinearForm.

Some datatypes moved to include/hdf5_utils.hpp

  • BasisTag
  • SampleInfo

We may want a separate header file for datatypes.

@dreamer2368 dreamer2368 marked this pull request as ready for review July 6, 2024 17:59
@dreamer2368 dreamer2368 merged commit 87185c7 into main Jul 6, 2024
2 checks passed
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.

1 participant