proteus
1.8.1
C/C++/Fortran libraries
|
Class that handles the interface between SCOREC tools and Proteus. More...
#include </Users/cekees/proteus/proteus/MeshAdaptPUMI/MeshAdaptPUMI.h>
Public Member Functions | |
void | writeMesh (const char *meshFile) |
void | cleanMesh () |
int | reconstructFromProteus (Mesh &mesh, Mesh &globalMesh, int hasModel) |
int | reconstructFromProteus2 (Mesh &mesh, int *isModelVert, int *bFaces) |
int | constructFromSerialPUMIMesh (Mesh &mesh) |
int | constructFromParallelPUMIMesh (Mesh &mesh, Mesh &subdomain_mesh) |
int | updateMaterialArrays (Mesh &mesh, int dim, int bdryID, int GeomTag) |
int | updateMaterialArrays (Mesh &mesh) |
int | updateMaterialArrays2 (Mesh &mesh) |
void | numberLocally () |
int | localNumber (apf::MeshEntity *e) |
int | dumpMesh (Mesh &mesh) |
int | transferModelInfo (int *numGeomEntities, int *edges, int *faces, int *mVertex2Model, int *mEdgeVertex2Model, int *mBoundary2Model, int nMaxSegments) |
int | setAdaptProperties (std::vector< std::string > sizeInputs, bool in_adapt, double in_hmax, double in_hmin, double in_hphi, int in_numAdaptSteps, double in_targetError, double in_gradingFactor, bool in_logging, int in_numIterations) |
int | setSphereSizeField () |
int | calculateSizeField (double L_band) |
void | predictiveInterfacePropagation () |
int | calculateAnisoSizeField () |
int | testIsotropicSizeField () |
int | getERMSizeField (double err_total) |
int | gradeMesh (double gradationFactor) |
gmi_model * | createSphereInBox (double *boxDim, double *sphereCenter, double radius) |
void | updateSphereCoordinates (double *sphereCenter) |
void | set_nAdapt (int numberAdapt) |
void | get_VMS_error (double &total_error_out) |
MeshAdaptPUMIDrvr () | |
~MeshAdaptPUMIDrvr () | |
int | loadModelAndMesh (const char *modelFile, const char *meshFile) |
Load the mesh and model for SCOREC libraries. More... | |
int | loadMeshForAnalytic (const char *meshFile, double *boxDim, double *sphereCenter, double radius) |
int | willAdapt () |
int | willErrorAdapt () |
Looks at the estimated error and determines if mesh adaptation is necessary. More... | |
int | willErrorAdapt_reference () |
int | willInterfaceAdapt () |
int | adaptPUMIMesh (const char *input) |
Function used to trigger adaptation. More... | |
double | getMinimumQuality () |
Function used to get the worst element quality in the mesh. More... | |
double | getTotalMass () |
Function to track total mass of the domain. More... | |
int | getSimmetrixBC () |
Function used to read in diffusive flux BC from Simmetrix Model. More... | |
double | getMPvalue (double field_val, double val_0, double val_1) |
Function primarily used to get the VOF-weighted average of physical properties at a given point. More... | |
apf::Field * | getViscosityField (apf::Field *voff) |
Function used to derive a viscosity field from a VOF field. More... | |
void | get_local_error (double &total_error) |
This function aims to compute error at each element via an Element Residual Method. More... | |
void | computeDiffusiveFlux (apf::Mesh *m, apf::Field *voff, apf::Field *visc, apf::Field *pref, apf::Field *velf) |
Function used to compute the diffusive flux at interelement boundaries and stores the values as tags at the boundaries. More... | |
void | getBoundaryFlux (apf::Mesh *m, apf::MeshEntity *ent, double *endflux) |
This function reads in the stored tags and computes the boundary flux according to the RHS formulation. More... | |
void | removeBCData () |
Function used to remove the BC tags that were created during the computeDiffusiveFlux() function. More... | |
Public Attributes | |
int | numSegments |
int * | edgeList |
int * | faceList |
int * | meshVertex2Model |
int * | meshEdge2Model |
int * | meshBoundary2Model |
int | numModelEntities [4] |
double | hmax |
double | hmin |
double | hPhi |
int | numIter |
int | nAdapt |
int | nTriggers |
int | nEstimate |
int | nsd |
int | maxAspect |
int | adaptMesh |
int | numAdaptSteps |
double | N_interface_band |
double | gradingFactor |
bool | hasIBM |
bool | hasInterface |
bool | hasVMS |
bool | hasERM |
bool | hasAniso |
bool | hasAnalyticSphere |
bool | useProteus |
bool | useProteusAniso |
std::string | size_field_config |
std::string | adapt_type_config |
std::string | logging_config |
char * | modelFileName |
apf::MeshTag * | BCtag |
apf::MeshTag * | DBCtag [4] |
apf::MeshTag * | fluxtag [4] |
int * | exteriorGlobaltoLocalElementBoundariesArray |
int | approximation_order |
int | integration_order |
int | num_quadrature |
int | num_quadrature_boundary |
double | total_error |
double | errRho_max |
double | rel_err_total |
int | isReconstructed |
int | initialReconstructed |
int * | modelVertexMaterial |
int * | modelBoundaryMaterial |
int * | modelRegionMaterial |
int | numModelOffsets [4] |
int | numModelTotals [4] |
int | transferFieldToPUMI (const char *name, double const *inArray, int nVar, int nN) |
Convert Proteus fields to something PUMI can understand. More... | |
int | transferFieldToProteus (const char *name, double *outArray, int nVar, int nN) |
Convert PUMI fields to something Proteus can understand. More... | |
int | transferElementFieldToProteus (const char *name, double *outArray, int nVar, int nN) |
Convert PUMI fields to something Proteus can understand. More... | |
int | transferPropertiesToPUMI (double *rho_p, double *nu_p, double *g_p, double deltaT, double deltaT_next, double T_simulation, double interfaceBandSize) |
Transfer material properties to the MeshAdaptPUMI class. More... | |
Definition at line 19 of file MeshAdaptPUMI.h.
MeshAdaptPUMIDrvr::MeshAdaptPUMIDrvr | ( | ) |
MeshAdaptPUMIDrvr is the highest level class that handles the interface between Proteus and the PUMI libraries See MeshAdaptPUMI.h for the list of class variables/functions/objects This is the constructor for the class
Definition at line 41 of file cMeshAdaptPUMI.cpp.
MeshAdaptPUMIDrvr::~MeshAdaptPUMIDrvr | ( | ) |
Destructor for MeshAdaptPUMIDrvr
Definition at line 89 of file cMeshAdaptPUMI.cpp.
int MeshAdaptPUMIDrvr::adaptPUMIMesh | ( | const char * | inputString | ) |
Inputs are the type of size-field that is desired: "interface" refers to explicitly adapting to the current interface position based on the level-set field "ERM" refers to the error-residual method and using error estimates to determine how a mesh should be adapted Within ERM, there is an isotropic and anisotropic configuration. The anisotropic configuration requires more development. "Isotropic" refers to a uniform refinement based on a global hmin size and is primarily used for testing Predictive load balancers Zoltan and ParMA are used in combination for before, during, and after adapt with a preset tolerance of imbalance The nAdapt counter is iterated to track how many times a mesh is adapted
Adapt the mesh
Definition at line 670 of file cMeshAdaptPUMI.cpp.
int MeshAdaptPUMIDrvr::calculateAnisoSizeField | ( | ) |
Definition at line 1055 of file SizeField.cpp.
int MeshAdaptPUMIDrvr::calculateSizeField | ( | double | L_band | ) |
Definition at line 84 of file SizeField.cpp.
void MeshAdaptPUMIDrvr::cleanMesh | ( | ) |
Definition at line 920 of file cMeshAdaptPUMI.cpp.
void MeshAdaptPUMIDrvr::computeDiffusiveFlux | ( | apf::Mesh * | m, |
apf::Field * | voff, | ||
apf::Field * | visc, | ||
apf::Field * | pref, | ||
apf::Field * | velf | ||
) |
Based on the mesh database, each face has a default orientation that is outward normal to a given element. The flux has a different value depending on the element. The value from the default element is stored in the first slot of the tag and the other value is stored in the second slot Special considerations are made for global domain boundaries if boundary conditions exist and for parallel communications Inputs:
m | is the mesh |
voff | is the volume of fluid field |
visc | is the field of viscosity |
pref | is the pressure field |
velf | is the velocity field |
Definition at line 297 of file ErrorResidualMethod.cpp.
Definition at line 25 of file ParallelMeshConverter.cpp.
int MeshAdaptPUMIDrvr::constructFromSerialPUMIMesh | ( | Mesh & | mesh | ) |
Definition at line 47 of file MeshConverter.cpp.
gmi_model * MeshAdaptPUMIDrvr::createSphereInBox | ( | double * | boxDim, |
double * | sphereCenter, | ||
double | radius | ||
) |
Definition at line 602 of file createAnalyticGeometry.cpp.
int MeshAdaptPUMIDrvr::dumpMesh | ( | Mesh & | mesh | ) |
Definition at line 242 of file ParallelMeshConverter.cpp.
void MeshAdaptPUMIDrvr::get_local_error | ( | double & | total_error | ) |
See Oden, J. Tinsley, Weihan Wu, and Mark Ainsworth. "An a posteriori error estimate for finite element approximations of the Navier-Stokes equations." Computer Methods in Applied Mechanics and Engineering 111.1 (1994): 185-202. Effectively, the method involves projecting the weak residual onto a higher order space. Boundary condition considerations are discussed in Ainsworth, Mark, and J. Tinsley Oden. A posteriori error estimation in finite element analysis. Vol. 37. John Wiley & Sons, 2011. The function loops through each element and solves the local problem.
Definition at line 664 of file ErrorResidualMethod.cpp.
void MeshAdaptPUMIDrvr::get_VMS_error | ( | double & | total_error_out | ) |
void MeshAdaptPUMIDrvr::getBoundaryFlux | ( | apf::Mesh * | m, |
apf::MeshEntity * | ent, | ||
double * | endflux | ||
) |
m | is the input mesh |
ent | is an input element (tetrahedron) |
endflux | is the output boundary flux used in the RHS |
Definition at line 494 of file ErrorResidualMethod.cpp.
int MeshAdaptPUMIDrvr::getERMSizeField | ( | double | err_total | ) |
Definition at line 1195 of file SizeField.cpp.
double MeshAdaptPUMIDrvr::getMinimumQuality | ( | ) |
Measures the quality via SCOREC library; returns the minimum quality Meant to be used to trigger adaptation, but has not been implemented yet
Definition at line 855 of file cMeshAdaptPUMI.cpp.
double MeshAdaptPUMIDrvr::getMPvalue | ( | double | field_val, |
double | val_0, | ||
double | val_1 | ||
) |
Due to the potential multi-phase nature of the problem, material properties at quadrature points are weighted averages of the different phases.
field_val | VOF value |
val_0 | value of property for one phase |
val_1 | value of property for second phase |
Definition at line 35 of file ErrorResidualMethod.cpp.
int MeshAdaptPUMIDrvr::getSimmetrixBC | ( | ) |
Simmetrix BCs set via the GUI are read-in through the Simmetrix API. The values are stored as apf tags on the mesh. BCs are not currently supported with any other type of model.
Definition at line 181 of file cMeshAdaptPUMI.cpp.
double MeshAdaptPUMIDrvr::getTotalMass | ( | ) |
Returns total mass across all ranks
Definition at line 874 of file cMeshAdaptPUMI.cpp.
apf::Field * MeshAdaptPUMIDrvr::getViscosityField | ( | apf::Field * | voff | ) |
For convenience, derive a viscosity field using the getMPvalue() function.
voff | is the VOF field. |
Definition at line 579 of file ErrorResidualMethod.cpp.
int MeshAdaptPUMIDrvr::gradeMesh | ( | double | gradationFactor | ) |
Definition at line 1660 of file SizeField.cpp.
int MeshAdaptPUMIDrvr::loadMeshForAnalytic | ( | const char * | meshFile, |
double * | boxDim, | ||
double * | sphereCenter, | ||
double | radius | ||
) |
Definition at line 158 of file cMeshAdaptPUMI.cpp.
int MeshAdaptPUMIDrvr::loadModelAndMesh | ( | const char * | modelFile, |
const char * | meshFile | ||
) |
The default filetypes are .dmg (model) and .smb (mesh), but can support GMSH meshes (.msh) and Simmetrix models (.smd) and meshes (.sms) GMSH models are not used and .null filenames and passed instead. Each of the the GMSH and Simmetrix filetypes can be converted into a SCOREC filetype via tools in scorec Diffusive flux boundary conditions are supported with Simmetrix models and can be passed into the error estimator
Definition at line 136 of file cMeshAdaptPUMI.cpp.
int MeshAdaptPUMIDrvr::localNumber | ( | apf::MeshEntity * | e | ) |
Definition at line 105 of file MeshConverter.cpp.
void MeshAdaptPUMIDrvr::numberLocally | ( | ) |
Definition at line 95 of file MeshConverter.cpp.
void MeshAdaptPUMIDrvr::predictiveInterfacePropagation | ( | ) |
Definition at line 297 of file SizeField.cpp.
Definition at line 872 of file MeshConverter.cpp.
int MeshAdaptPUMIDrvr::reconstructFromProteus2 | ( | Mesh & | mesh, |
int * | isModelVert, | ||
int * | bFaces | ||
) |
Definition at line 1334 of file MeshConverter.cpp.
void MeshAdaptPUMIDrvr::removeBCData | ( | ) |
This is the simple way of avoiding errors from creating the same tags the next time the error estimator is called The function just cycles through all of the faces and removes the apf tags.
Definition at line 626 of file ErrorResidualMethod.cpp.
void MeshAdaptPUMIDrvr::set_nAdapt | ( | int | numberAdapt | ) |
Definition at line 994 of file cMeshAdaptPUMI.cpp.
int MeshAdaptPUMIDrvr::setAdaptProperties | ( | std::vector< std::string > | sizeInputs, |
bool | in_adapt, | ||
double | in_hmax, | ||
double | in_hmin, | ||
double | in_hphi, | ||
int | in_numAdaptSteps, | ||
double | in_targetError, | ||
double | in_gradingFactor, | ||
bool | in_logging, | ||
int | in_numIterations | ||
) |
Definition at line 1000 of file cMeshAdaptPUMI.cpp.
int MeshAdaptPUMIDrvr::setSphereSizeField | ( | ) |
Definition at line 61 of file SizeField.cpp.
int MeshAdaptPUMIDrvr::testIsotropicSizeField | ( | ) |
Definition at line 1497 of file SizeField.cpp.
int MeshAdaptPUMIDrvr::transferElementFieldToProteus | ( | const char * | name, |
double * | outArray, | ||
int | nVar, | ||
int | nN | ||
) |
Copies the PUMI apf field with name into an outArray.
name | is the desired name associated with the apf field |
outArray | is the Proteus field that will be output |
The remainder of the parameters might be irrelevant.
Definition at line 158 of file MeshFields.cpp.
int MeshAdaptPUMIDrvr::transferFieldToProteus | ( | const char * | name, |
double * | outArray, | ||
int | nVar, | ||
int | nN | ||
) |
Copies the PUMI apf field with name into an outArray.
name | is the desired name associated with the apf field |
outArray | is the Proteus field that will be output |
The remainder of the parameters might be irrelevant.
Definition at line 86 of file MeshFields.cpp.
int MeshAdaptPUMIDrvr::transferFieldToPUMI | ( | const char * | name, |
double const * | inArray, | ||
int | nVar, | ||
int | nN | ||
) |
Copies the Proteus field associated with an array into an apf field associated with "name"
name | is the desired name associated with the apf field |
inArray | is the Proteus field |
The remainder of the parameters might be irrelevant.
Definition at line 40 of file MeshFields.cpp.
int MeshAdaptPUMIDrvr::transferModelInfo | ( | int * | numGeomEntities, |
int * | edges, | ||
int * | faces, | ||
int * | mVertex2Model, | ||
int * | mEdgeVertex2Model, | ||
int * | mBoundary2Model, | ||
int | nMaxSegments | ||
) |
Definition at line 855 of file MeshConverter.cpp.
int MeshAdaptPUMIDrvr::transferPropertiesToPUMI | ( | double * | rho_p, |
double * | nu_p, | ||
double * | g_p, | ||
double | deltaT, | ||
double | deltaT_next, | ||
double | T_simulation, | ||
double | interfaceBandSize | ||
) |
There are three material properties that the error estimator requires:
rho_p | is the density |
nu_p | is the kinematic viscosity |
g_p | is the gravitational field (a 3-vector) |
Definition at line 119 of file MeshFields.cpp.
int MeshAdaptPUMIDrvr::updateMaterialArrays | ( | Mesh & | mesh | ) |
Definition at line 440 of file MeshConverter.cpp.
int MeshAdaptPUMIDrvr::updateMaterialArrays | ( | Mesh & | mesh, |
int | dim, | ||
int | bdryID, | ||
int | GeomTag | ||
) |
Definition at line 400 of file MeshConverter.cpp.
int MeshAdaptPUMIDrvr::updateMaterialArrays2 | ( | Mesh & | mesh | ) |
Definition at line 509 of file MeshConverter.cpp.
void MeshAdaptPUMIDrvr::updateSphereCoordinates | ( | double * | sphereCenter | ) |
Definition at line 690 of file createAnalyticGeometry.cpp.
int MeshAdaptPUMIDrvr::willAdapt | ( | ) |
Definition at line 582 of file cMeshAdaptPUMI.cpp.
int MeshAdaptPUMIDrvr::willErrorAdapt | ( | ) |
Function used to define whether a mesh needs to be adapted based on the error estimator The return value is a flag indicating whether the mesh will not (0) or will be (1) adapted The THRESHOLD will be set to the error estimate after the wind-up step, but is currently 0 Assertion is set to ensure that all ranks in a parallel execution will enter the adapt stage
Definition at line 317 of file cMeshAdaptPUMI.cpp.
int MeshAdaptPUMIDrvr::willErrorAdapt_reference | ( | ) |
Definition at line 416 of file cMeshAdaptPUMI.cpp.
int MeshAdaptPUMIDrvr::willInterfaceAdapt | ( | ) |
Definition at line 612 of file cMeshAdaptPUMI.cpp.
void MeshAdaptPUMIDrvr::writeMesh | ( | const char * | meshFile | ) |
Definition at line 912 of file cMeshAdaptPUMI.cpp.
std::string MeshAdaptPUMIDrvr::adapt_type_config |
Definition at line 115 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::adaptMesh |
Definition at line 98 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::approximation_order |
Definition at line 137 of file MeshAdaptPUMI.h.
apf::MeshTag* MeshAdaptPUMIDrvr::BCtag |
Definition at line 130 of file MeshAdaptPUMI.h.
apf::MeshTag* MeshAdaptPUMIDrvr::DBCtag[4] |
Definition at line 131 of file MeshAdaptPUMI.h.
int* MeshAdaptPUMIDrvr::edgeList |
Definition at line 45 of file MeshAdaptPUMI.h.
double MeshAdaptPUMIDrvr::errRho_max |
Definition at line 142 of file MeshAdaptPUMI.h.
int* MeshAdaptPUMIDrvr::exteriorGlobaltoLocalElementBoundariesArray |
Definition at line 134 of file MeshAdaptPUMI.h.
int* MeshAdaptPUMIDrvr::faceList |
Definition at line 46 of file MeshAdaptPUMI.h.
apf::MeshTag* MeshAdaptPUMIDrvr::fluxtag[4] |
Definition at line 132 of file MeshAdaptPUMI.h.
double MeshAdaptPUMIDrvr::gradingFactor |
Definition at line 101 of file MeshAdaptPUMI.h.
bool MeshAdaptPUMIDrvr::hasAnalyticSphere |
Definition at line 107 of file MeshAdaptPUMI.h.
bool MeshAdaptPUMIDrvr::hasAniso |
Definition at line 106 of file MeshAdaptPUMI.h.
bool MeshAdaptPUMIDrvr::hasERM |
Definition at line 105 of file MeshAdaptPUMI.h.
bool MeshAdaptPUMIDrvr::hasIBM |
Definition at line 102 of file MeshAdaptPUMI.h.
bool MeshAdaptPUMIDrvr::hasInterface |
Definition at line 103 of file MeshAdaptPUMI.h.
bool MeshAdaptPUMIDrvr::hasVMS |
Definition at line 104 of file MeshAdaptPUMI.h.
double MeshAdaptPUMIDrvr::hmax |
Definition at line 91 of file MeshAdaptPUMI.h.
double MeshAdaptPUMIDrvr::hmin |
Definition at line 91 of file MeshAdaptPUMI.h.
double MeshAdaptPUMIDrvr::hPhi |
Definition at line 91 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::initialReconstructed |
Definition at line 147 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::integration_order |
Definition at line 138 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::isReconstructed |
Definition at line 146 of file MeshAdaptPUMI.h.
std::string MeshAdaptPUMIDrvr::logging_config |
Definition at line 116 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::maxAspect |
Definition at line 97 of file MeshAdaptPUMI.h.
int * MeshAdaptPUMIDrvr::meshBoundary2Model |
Definition at line 47 of file MeshAdaptPUMI.h.
int * MeshAdaptPUMIDrvr::meshEdge2Model |
Definition at line 47 of file MeshAdaptPUMI.h.
int* MeshAdaptPUMIDrvr::meshVertex2Model |
Definition at line 47 of file MeshAdaptPUMI.h.
int* MeshAdaptPUMIDrvr::modelBoundaryMaterial |
Definition at line 149 of file MeshAdaptPUMI.h.
char* MeshAdaptPUMIDrvr::modelFileName |
Definition at line 124 of file MeshAdaptPUMI.h.
int* MeshAdaptPUMIDrvr::modelRegionMaterial |
Definition at line 150 of file MeshAdaptPUMI.h.
int* MeshAdaptPUMIDrvr::modelVertexMaterial |
Definition at line 148 of file MeshAdaptPUMI.h.
double MeshAdaptPUMIDrvr::N_interface_band |
Definition at line 100 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::nAdapt |
Definition at line 93 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::nEstimate |
Definition at line 95 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::nsd |
Definition at line 96 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::nTriggers |
Definition at line 94 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::num_quadrature |
Definition at line 139 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::num_quadrature_boundary |
Definition at line 140 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::numAdaptSteps |
Definition at line 99 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::numIter |
Definition at line 92 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::numModelEntities[4] |
Definition at line 48 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::numModelOffsets[4] |
Definition at line 151 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::numModelTotals[4] |
Definition at line 152 of file MeshAdaptPUMI.h.
int MeshAdaptPUMIDrvr::numSegments |
Definition at line 44 of file MeshAdaptPUMI.h.
double MeshAdaptPUMIDrvr::rel_err_total |
Definition at line 143 of file MeshAdaptPUMI.h.
std::string MeshAdaptPUMIDrvr::size_field_config |
Definition at line 114 of file MeshAdaptPUMI.h.
double MeshAdaptPUMIDrvr::total_error |
Definition at line 141 of file MeshAdaptPUMI.h.
bool MeshAdaptPUMIDrvr::useProteus |
Definition at line 108 of file MeshAdaptPUMI.h.
bool MeshAdaptPUMIDrvr::useProteusAniso |
Definition at line 109 of file MeshAdaptPUMI.h.