awslabs / palace

3D finite element solver for computational electromagnetics
https://awslabs.github.io/palace/dev
Apache License 2.0
224 stars 50 forks source link

Fix Paraview output for error indicator #234

Closed sebastiangrimberg closed 1 month ago

sebastiangrimberg commented 2 months ago

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 https://github.com/awslabs/palace/pull/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 https://github.com/awslabs/palace/pull/233).