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

Hyperreduction: usage of SampleMeshManager #187

Closed
JacobLotz opened this issue Feb 21, 2023 · 2 comments
Closed

Hyperreduction: usage of SampleMeshManager #187

JacobLotz opened this issue Feb 21, 2023 · 2 comments
Assignees

Comments

@JacobLotz
Copy link
Collaborator

I am trying to implement a time independent non-linear reduced order model. The examples nonlinear_elacticity_global_rom.cpp and mixed_non-linear_diffusion.cpp provide good examples of the usage of the used classes. However, I cannot fully understand the usage of the class SampleMeshManager.

This class seems to register the sampled variables, which are especially important for the hyper reduced non-linear term. I do not understand what GetSampleFESpace() produces. As the name indicates this seems to be some kind of sampled finite element space and the number of true variables seems to be somewhere in between the number of FOM and ROM variables.

Quoting SampleMesh.hpp:
"The spaces defined on the sample mesh are referred to as sample mesh spaces, and they generally contain the sampled DOFs along with other unsampled DOFs."
An explanation for the number of variables being somewhere between the number of the FOM and the ROM variables would be the unsampled DOFs in the description above.

I have two questions:

  1. To be sure "other unsampled variables" does not mean "all unsampled variables", right?
  2. Why does it need the other unsampled variables? In nonlinear_elacticity_global_rom.cpp it produces a large non-linear vector first, which it samples again afterwards to a much smaller vector. In this way it seems to be very FOM size-ish dependent. This is in the lines:
fomSp->H->Mult(*psp_x, zH); // produces a large nonlin-vector zH, almost FOM size
smm->GetSampledValues("H", zH, zN); // produces a much smaller sampled nonlin-vector zN
@dylan-copeland dylan-copeland self-assigned this Feb 22, 2023
@dylan-copeland
Copy link
Collaborator

Hi @JacobLotz,

Thanks for your questions. ROM has some subtle complications that perhaps we should document better, and the sample mesh is a particularly tricky topic. A further complication is that results are very problem-dependent. Diffusion types of problems are typically the easiest for ROM, so the performance should be better for mixed_non-linear_diffusion.cpp than for nonlinear_elasticity_global_rom.cpp. Even within nonlinear_elasticity_global_rom.cpp, the sample runs have quite different performance for the two cases
(i) using displacement basis, velocity basis and nonlinear term basis, with velocity initial condition;
(ii) using only displacement basis and nonlinear term basis.
The latter case has better performance with hyperreduction, with smaller sample mesh size. Case (i) has a sample mesh which is not much smaller than the FOM mesh, i.e. poor speed-up, which may be confusing.

Now, to answer your questions:
(1) "other unsampled variables" does not mean "all unsampled variables". In the MFEM context, it means all of the DOFs (degrees of freedom) in the elements containing sampled DOFs.
(2) For an MFEM-based application, operators are evaluated element-wise, not DOF-wise, so there is no reasonable way to evaluate an operator only at sampled DOFs. Instead, for simplicity, we use the FOM code on a subset of the elements (the sampled elements). This includes non-sampled DOFs, so we have to extract the sampled DOFs.

In general, here is a basic summary of the hyperreduction process.

  1. The sampled DOFs are computed, by an algorithm such as DEIM. If there are multiple variables (e.g. x, v), the sampling algorithm could be applied to a monolithic variable [x, v] or to each variable separately (x and v separately). We have always found it better to sample each variable separately. Then the sampled DOFs for all variables are merged into one set of sampled DOFs.

  2. The set of FOM elements containing sampled DOFs is found. This defines the "sample mesh", and the "sample spaces" are defined on this mesh. Hopefully now it is clear why the sample spaces may have more DOFs than the set of sampled DOFs. For example, the variables could be on H^1 and L_2 spaces. The SampleMeshManager class handles multiple variables on multiple spaces.

  3. For evaluation of the hyperreduced operators, each hyperreduced operator is defined on the appropriate sample space, which is on the sample mesh.

  4. The sample DOFs of the action of the hyperreduced operator are extracted from the sample space.

@JacobLotz
Copy link
Collaborator Author

Hi @dylan-copeland, Thank you for your clarifications and your elaborate answers! The importance of SampleMeshManager and its DOFs is much more clear.

I am currently working on a case of a one variable non-linear equation with a NURBS discretisation, but in a later stage I plan to apply the same to the Navier-Stokes equations. The choice of the used basis will probably important, just as in nonlinear_elasticity_global_rom.cpp from what I understand from your explanation.

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

No branches or pull requests

2 participants