#include "petscdmplex.h" PetscErrorCode DMPlexComputeOrthogonalQuality(DM dm, PetscFV fv, PetscReal atol, Vec *OrthQual, DMLabel *OrthQualLabel)Collective
dm | - The DMPlex object | |
fv | - Optional PetscFV object for pre-computed cell/face centroid information | |
atol | - [0, 1] Absolute tolerance for tagging cells. |
OrthQual | - Vec containing orthogonal quality per cell | |
OrthQualLabel | - DMLabel tagging cells below atol with DM_ADAPT_REFINE |
-dm_plex_orthogonal_quality_label_view | - view OrthQualLabel if label is requested. Currently only PETSCVIEWERASCII is supported. | |
-dm_plex_orthogonal_quality_vec_view | - view OrthQual vector. |
\min \left[ \frac{A_i \cdot f_i}{\|A_i\| \|f_i\|} , \frac{A_i \cdot c_i}{\|A_i\| \|c_i\|} \right]
Where A_i is the i'th face-normal vector, f_i is the vector from the cell centroid to the i'th face centroid, and c_i is the vector from the current cells centroid to the centroid of its i'th neighbor (which shares a face with the current cell). This computes the vector similarity between each cell face and its corresponding neighbor centroid by calculating the cosine of the angle between these vectors.
Orthogonal quality ranges from 1 (best) to 0 (worst).
This routine is mainly useful for FVM, however is not restricted to only FVM. The PetscFV object is optionally used to check for pre-computed FVM cell data, but if it is not passed in then this data will be computed.
Cells are tagged if they have an orthogonal quality less than or equal to the absolute tolerance.