proteus  1.5.1 C/C++/Fortran libraries

Class that handles the interface between SCOREC tools and Proteus. More...

#include </home/cekees/proteus/proteus/MeshAdaptPUMI/MeshAdaptPUMI.h>

[legend]

## Public Member Functions

void writeMesh (const char *meshFile)

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 calculateSizeField ()

int calculateAnisoSizeField ()

int testIsotropicSizeField ()

int getERMSizeField (double err_total)

void get_VMS_error (double &total_error)

MeshAdaptPUMIDrvr (double, double, double, int, int, int, const char *, const char *, const char *, double, double, int, double, double)

int loadModelAndMesh (const char *modelFile, const char *meshFile)
Load the mesh and model for SCOREC libraries. More...

Looks at the estimated error and determines if mesh adaptation is necessary. More...

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 nEstimate

int nsd

int maxAspect

double N_interface_band

std::string size_field_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

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 transferPropertiesToPUMI (double *rho_p, double *nu_p, double *g_p, double deltaT, double interfaceBandSize)
Transfer material properties to the MeshAdaptPUMI class. More...

## Detailed Description

Definition at line 18 of file MeshAdaptPUMI.h.

## Constructor & Destructor Documentation

 MeshAdaptPUMIDrvr::MeshAdaptPUMIDrvr ( double Hmax, double Hmin, double HPhi, int AdaptMesh, int NumIter, int NumAdaptSteps, const char * sfConfig, const char * maType, const char * logType, double targetError, double targetElementCount, int reconstructedFlag, double maxAspectRatio, double gradingFact )

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 32 of file cMeshAdaptPUMI.cpp.

Definition at line 89 of file cMeshAdaptPUMI.cpp.

## Member Function Documentation

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

Definition at line 323 of file cMeshAdaptPUMI.cpp.

## ◆ calculateAnisoSizeField()

Definition at line 647 of file SizeField.cpp.

## ◆ calculateSizeField()

Definition at line 62 of file SizeField.cpp.

## ◆ computeDiffusiveFlux()

 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:

Parameters
 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.

## ◆ constructFromParallelPUMIMesh()

 int MeshAdaptPUMIDrvr::constructFromParallelPUMIMesh ( Mesh & mesh, Mesh & subdomain_mesh )

Definition at line 25 of file ParallelMeshConverter.cpp.

## ◆ constructFromSerialPUMIMesh()

 int MeshAdaptPUMIDrvr::constructFromSerialPUMIMesh ( Mesh & mesh )

Definition at line 47 of file MeshConverter.cpp.

## ◆ dumpMesh()

 int MeshAdaptPUMIDrvr::dumpMesh ( Mesh & mesh )

Definition at line 243 of file ParallelMeshConverter.cpp.

## ◆ get_local_error()

 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.

## ◆ get_VMS_error()

 void MeshAdaptPUMIDrvr::get_VMS_error ( double & total_error )

Definition at line 53 of file VMS.cpp.

## ◆ getBoundaryFlux()

 void MeshAdaptPUMIDrvr::getBoundaryFlux ( apf::Mesh * m, apf::MeshEntity * ent, double * endflux )
Parameters
 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.

## ◆ getERMSizeField()

 int MeshAdaptPUMIDrvr::getERMSizeField ( double err_total )

Definition at line 790 of file SizeField.cpp.

## ◆ 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 511 of file cMeshAdaptPUMI.cpp.

## ◆ getMPvalue()

 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.

Parameters
 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.

## ◆ 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 154 of file cMeshAdaptPUMI.cpp.

## ◆ getTotalMass()

Returns total mass across all ranks

Definition at line 530 of file cMeshAdaptPUMI.cpp.

## ◆ getViscosityField()

 apf::Field * MeshAdaptPUMIDrvr::getViscosityField ( apf::Field * voff )

For convenience, derive a viscosity field using the getMPvalue() function.

Parameters
 voff is the VOF field.

Definition at line 579 of file ErrorResidualMethod.cpp.

Definition at line 1215 of file SizeField.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 131 of file cMeshAdaptPUMI.cpp.

## ◆ localNumber()

 int MeshAdaptPUMIDrvr::localNumber ( apf::MeshEntity * e )

Definition at line 105 of file MeshConverter.cpp.

## ◆ numberLocally()

Definition at line 95 of file MeshConverter.cpp.

## ◆ reconstructFromProteus()

 int MeshAdaptPUMIDrvr::reconstructFromProteus ( Mesh & mesh, Mesh & globalMesh, int hasModel )

Definition at line 871 of file MeshConverter.cpp.

## ◆ reconstructFromProteus2()

 int MeshAdaptPUMIDrvr::reconstructFromProteus2 ( Mesh & mesh, int * isModelVert, int * bFaces )

Definition at line 1333 of file MeshConverter.cpp.

## ◆ 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.

## ◆ testIsotropicSizeField()

Definition at line 1052 of file SizeField.cpp.

## ◆ transferFieldToProteus()

 int MeshAdaptPUMIDrvr::transferFieldToProteus ( const char * name, double * outArray, int nVar, int nN )

Copies the PUMI apf field with name into an outArray.

Parameters
 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 84 of file MeshFields.cpp.

## ◆ transferFieldToPUMI()

 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"

Parameters
 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 38 of file MeshFields.cpp.

## ◆ transferModelInfo()

 int MeshAdaptPUMIDrvr::transferModelInfo ( int * numGeomEntities, int * edges, int * faces, int * mVertex2Model, int * mEdgeVertex2Model, int * mBoundary2Model, int nMaxSegments )

Definition at line 854 of file MeshConverter.cpp.

## ◆ transferPropertiesToPUMI()

 int MeshAdaptPUMIDrvr::transferPropertiesToPUMI ( double * rho_p, double * nu_p, double * g_p, double deltaT, double interfaceBandSize )

There are three material properties that the error estimator requires:

Parameters
 rho_p is the density nu_p is the kinematic viscosity g_p is the gravitational field (a 3-vector)

Definition at line 117 of file MeshFields.cpp.

## ◆ updateMaterialArrays() [1/2]

 int MeshAdaptPUMIDrvr::updateMaterialArrays ( Mesh & mesh, int dim, int bdryID, int GeomTag )

Definition at line 400 of file MeshConverter.cpp.

## ◆ updateMaterialArrays() [2/2]

 int MeshAdaptPUMIDrvr::updateMaterialArrays ( Mesh & mesh )

Definition at line 440 of file MeshConverter.cpp.

## ◆ updateMaterialArrays2()

 int MeshAdaptPUMIDrvr::updateMaterialArrays2 ( Mesh & mesh )

Definition at line 509 of file MeshConverter.cpp.

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 283 of file cMeshAdaptPUMI.cpp.

## ◆ writeMesh()

 void MeshAdaptPUMIDrvr::writeMesh ( const char * meshFile )

Definition at line 568 of file cMeshAdaptPUMI.cpp.

## Member Data Documentation

Definition at line 86 of file MeshAdaptPUMI.h.

Definition at line 79 of file MeshAdaptPUMI.h.

## ◆ approximation_order

Definition at line 108 of file MeshAdaptPUMI.h.

## ◆ BCtag

Definition at line 101 of file MeshAdaptPUMI.h.

## ◆ DBCtag

Definition at line 102 of file MeshAdaptPUMI.h.

## ◆ edgeList

Definition at line 42 of file MeshAdaptPUMI.h.

## ◆ errRho_max

Definition at line 113 of file MeshAdaptPUMI.h.

## ◆ exteriorGlobaltoLocalElementBoundariesArray

Definition at line 105 of file MeshAdaptPUMI.h.

## ◆ faceList

Definition at line 43 of file MeshAdaptPUMI.h.

## ◆ fluxtag

Definition at line 103 of file MeshAdaptPUMI.h.

Definition at line 82 of file MeshAdaptPUMI.h.

## ◆ hmax

Definition at line 73 of file MeshAdaptPUMI.h.

## ◆ hmin

Definition at line 73 of file MeshAdaptPUMI.h.

## ◆ hPhi

Definition at line 73 of file MeshAdaptPUMI.h.

## ◆ initialReconstructed

Definition at line 118 of file MeshAdaptPUMI.h.

## ◆ integration_order

Definition at line 109 of file MeshAdaptPUMI.h.

## ◆ isReconstructed

Definition at line 117 of file MeshAdaptPUMI.h.

## ◆ logging_config

Definition at line 87 of file MeshAdaptPUMI.h.

## ◆ maxAspect

Definition at line 78 of file MeshAdaptPUMI.h.

## ◆ meshBoundary2Model

Definition at line 44 of file MeshAdaptPUMI.h.

## ◆ meshEdge2Model

Definition at line 44 of file MeshAdaptPUMI.h.

## ◆ meshVertex2Model

Definition at line 44 of file MeshAdaptPUMI.h.

## ◆ modelBoundaryMaterial

Definition at line 120 of file MeshAdaptPUMI.h.

## ◆ modelFileName

Definition at line 95 of file MeshAdaptPUMI.h.

## ◆ modelRegionMaterial

Definition at line 121 of file MeshAdaptPUMI.h.

## ◆ modelVertexMaterial

Definition at line 119 of file MeshAdaptPUMI.h.

## ◆ N_interface_band

Definition at line 81 of file MeshAdaptPUMI.h.

Definition at line 75 of file MeshAdaptPUMI.h.

## ◆ nEstimate

Definition at line 76 of file MeshAdaptPUMI.h.

## ◆ nsd

Definition at line 77 of file MeshAdaptPUMI.h.

Definition at line 110 of file MeshAdaptPUMI.h.

Definition at line 111 of file MeshAdaptPUMI.h.

Definition at line 80 of file MeshAdaptPUMI.h.

## ◆ numIter

Definition at line 74 of file MeshAdaptPUMI.h.

## ◆ numModelEntities

Definition at line 45 of file MeshAdaptPUMI.h.

## ◆ numModelOffsets

Definition at line 122 of file MeshAdaptPUMI.h.

## ◆ numModelTotals

Definition at line 123 of file MeshAdaptPUMI.h.

## ◆ numSegments

Definition at line 41 of file MeshAdaptPUMI.h.

## ◆ rel_err_total

Definition at line 114 of file MeshAdaptPUMI.h.