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

Fix Paraview output for error indicator #234

Merged
merged 6 commits into from
May 7, 2024

Conversation

sebastiangrimberg
Copy link
Contributor

@sebastiangrimberg sebastiangrimberg commented Apr 19, 2024

Previously, certain values for Paraview output would affect when or whether or not the error indicators were written, based on the simulation type. Further refactoring in preparation for #233.

The mesh partitioning and error indicators are now written at a separate time step in ParaView output to avoid confusion. Namely, they are written as some large number of repeated 9s which is at least 10x larger than the biggest time value (frequency, time, or port number) used in the simulation to avoid confusion. For example, for an eigenmode simulation with 9 modes, the last eigenmode is written at time 9 and the indicator is written at 99. For 10 modes, the indicator is written to 999.

An alternative was to place the indicator and mesh partitioning at a negative time value, which is supported, like -1, but it is also a possibility this is used for a terminal or current source index for electrostatics or magnetostatics.

We also remove the "SaveOnlyPorts" option for driven and transient simulations. The global field energy calculations which were previously a bottleneck are now cheap with libCEED, so the savings was not needed. In addition, these quantities are required for error estimation (in preparation for #233).

@sebastiangrimberg sebastiangrimberg added the postprocessing Related to simulation postprocessing label Apr 19, 2024
@sebastiangrimberg sebastiangrimberg changed the base branch from main to sjg/bdr-attr-checks April 19, 2024 20:36
Base automatically changed from sjg/bdr-attr-checks to main April 24, 2024 18:09
@sebastiangrimberg sebastiangrimberg force-pushed the sjg/error-estimator-dev-prep branch 3 times, most recently from 4a8cd42 to eaa99fe Compare May 1, 2024 18:33
… fast with libCEED and required for error estimates
…e time-step than the rest of the simulation (fixes bug when these quantities were not saved correctly after accounting for all simulation steps)
palace/drivers/drivensolver.cpp Show resolved Hide resolved
palace/drivers/drivensolver.cpp Show resolved Hide resolved
palace/drivers/electrostaticsolver.cpp Outdated Show resolved Hide resolved
std::unique_ptr<mfem::GridFunction> rank, eta;
{
rank = std::make_unique<mfem::GridFunction>(&pwconst_fespace);
*rank = mesh.GetMyRank() + 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

For the record: 1 based indexing here is going to be ok as when loading in paraview, you'll receive the full set of ranks, so if using 8, you'd have 1-8, so the shift from 0 ought to be immediately apparent.

@sebastiangrimberg sebastiangrimberg merged commit 76ece61 into main May 7, 2024
17 checks passed
@sebastiangrimberg sebastiangrimberg deleted the sjg/error-estimator-dev-prep branch May 7, 2024 17:42
sebastiangrimberg added a commit that referenced this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postprocessing Related to simulation postprocessing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants