proteus  1.5.1
C/C++/Fortran libraries
Public Member Functions | Public Attributes | List of all members
MeshAdaptPUMIDrvr Class Reference

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

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

Collaboration diagram for MeshAdaptPUMIDrvr:
[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)
 
int gradeMesh ()
 
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)
 
 ~MeshAdaptPUMIDrvr ()
 
int loadModelAndMesh (const char *modelFile, const char *meshFile)
 Load the mesh and model for SCOREC libraries. More...
 
int willAdapt ()
 Looks at the estimated error and determines if mesh adaptation is necessary. More...
 
int adaptPUMIMesh ()
 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 nEstimate
 
int nsd
 
int maxAspect
 
int adaptMesh
 
int numAdaptSteps
 
double N_interface_band
 
double gradingFactor
 
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 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::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.

◆ ~MeshAdaptPUMIDrvr()

MeshAdaptPUMIDrvr::~MeshAdaptPUMIDrvr ( )

Destructor for MeshAdaptPUMIDrvr

Definition at line 89 of file cMeshAdaptPUMI.cpp.

Member Function Documentation

◆ adaptPUMIMesh()

int MeshAdaptPUMIDrvr::adaptPUMIMesh ( )

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

◆ calculateAnisoSizeField()

int MeshAdaptPUMIDrvr::calculateAnisoSizeField ( )

Definition at line 647 of file SizeField.cpp.

◆ calculateSizeField()

int MeshAdaptPUMIDrvr::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
mis the mesh
voffis the volume of fluid field
viscis the field of viscosity
prefis the pressure field
velfis 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
mis the input mesh
entis an input element (tetrahedron)
endfluxis 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()

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 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_valVOF value
val_0value of property for one phase
val_1value of property for second phase

Definition at line 35 of file ErrorResidualMethod.cpp.

◆ getSimmetrixBC()

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

◆ getTotalMass()

double MeshAdaptPUMIDrvr::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
voffis the VOF field.

Definition at line 579 of file ErrorResidualMethod.cpp.

◆ gradeMesh()

int MeshAdaptPUMIDrvr::gradeMesh ( )

Definition at line 1215 of file SizeField.cpp.

◆ loadModelAndMesh()

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

void MeshAdaptPUMIDrvr::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()

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.

◆ testIsotropicSizeField()

int MeshAdaptPUMIDrvr::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
nameis the desired name associated with the apf field
outArrayis 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
nameis the desired name associated with the apf field
inArrayis 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_pis the density
nu_pis the kinematic viscosity
g_pis 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.

◆ willAdapt()

int MeshAdaptPUMIDrvr::willAdapt ( )

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

◆ adapt_type_config

std::string MeshAdaptPUMIDrvr::adapt_type_config

Definition at line 86 of file MeshAdaptPUMI.h.

◆ adaptMesh

int MeshAdaptPUMIDrvr::adaptMesh

Definition at line 79 of file MeshAdaptPUMI.h.

◆ approximation_order

int MeshAdaptPUMIDrvr::approximation_order

Definition at line 108 of file MeshAdaptPUMI.h.

◆ BCtag

apf::MeshTag* MeshAdaptPUMIDrvr::BCtag

Definition at line 101 of file MeshAdaptPUMI.h.

◆ DBCtag

apf::MeshTag* MeshAdaptPUMIDrvr::DBCtag[4]

Definition at line 102 of file MeshAdaptPUMI.h.

◆ edgeList

int* MeshAdaptPUMIDrvr::edgeList

Definition at line 42 of file MeshAdaptPUMI.h.

◆ errRho_max

double MeshAdaptPUMIDrvr::errRho_max

Definition at line 113 of file MeshAdaptPUMI.h.

◆ exteriorGlobaltoLocalElementBoundariesArray

int* MeshAdaptPUMIDrvr::exteriorGlobaltoLocalElementBoundariesArray

Definition at line 105 of file MeshAdaptPUMI.h.

◆ faceList

int* MeshAdaptPUMIDrvr::faceList

Definition at line 43 of file MeshAdaptPUMI.h.

◆ fluxtag

apf::MeshTag* MeshAdaptPUMIDrvr::fluxtag[4]

Definition at line 103 of file MeshAdaptPUMI.h.

◆ gradingFactor

double MeshAdaptPUMIDrvr::gradingFactor

Definition at line 82 of file MeshAdaptPUMI.h.

◆ hmax

double MeshAdaptPUMIDrvr::hmax

Definition at line 73 of file MeshAdaptPUMI.h.

◆ hmin

double MeshAdaptPUMIDrvr::hmin

Definition at line 73 of file MeshAdaptPUMI.h.

◆ hPhi

double MeshAdaptPUMIDrvr::hPhi

Definition at line 73 of file MeshAdaptPUMI.h.

◆ initialReconstructed

int MeshAdaptPUMIDrvr::initialReconstructed

Definition at line 118 of file MeshAdaptPUMI.h.

◆ integration_order

int MeshAdaptPUMIDrvr::integration_order

Definition at line 109 of file MeshAdaptPUMI.h.

◆ isReconstructed

int MeshAdaptPUMIDrvr::isReconstructed

Definition at line 117 of file MeshAdaptPUMI.h.

◆ logging_config

std::string MeshAdaptPUMIDrvr::logging_config

Definition at line 87 of file MeshAdaptPUMI.h.

◆ maxAspect

int MeshAdaptPUMIDrvr::maxAspect

Definition at line 78 of file MeshAdaptPUMI.h.

◆ meshBoundary2Model

int * MeshAdaptPUMIDrvr::meshBoundary2Model

Definition at line 44 of file MeshAdaptPUMI.h.

◆ meshEdge2Model

int * MeshAdaptPUMIDrvr::meshEdge2Model

Definition at line 44 of file MeshAdaptPUMI.h.

◆ meshVertex2Model

int* MeshAdaptPUMIDrvr::meshVertex2Model

Definition at line 44 of file MeshAdaptPUMI.h.

◆ modelBoundaryMaterial

int* MeshAdaptPUMIDrvr::modelBoundaryMaterial

Definition at line 120 of file MeshAdaptPUMI.h.

◆ modelFileName

char* MeshAdaptPUMIDrvr::modelFileName

Definition at line 95 of file MeshAdaptPUMI.h.

◆ modelRegionMaterial

int* MeshAdaptPUMIDrvr::modelRegionMaterial

Definition at line 121 of file MeshAdaptPUMI.h.

◆ modelVertexMaterial

int* MeshAdaptPUMIDrvr::modelVertexMaterial

Definition at line 119 of file MeshAdaptPUMI.h.

◆ N_interface_band

double MeshAdaptPUMIDrvr::N_interface_band

Definition at line 81 of file MeshAdaptPUMI.h.

◆ nAdapt

int MeshAdaptPUMIDrvr::nAdapt

Definition at line 75 of file MeshAdaptPUMI.h.

◆ nEstimate

int MeshAdaptPUMIDrvr::nEstimate

Definition at line 76 of file MeshAdaptPUMI.h.

◆ nsd

int MeshAdaptPUMIDrvr::nsd

Definition at line 77 of file MeshAdaptPUMI.h.

◆ num_quadrature

int MeshAdaptPUMIDrvr::num_quadrature

Definition at line 110 of file MeshAdaptPUMI.h.

◆ num_quadrature_boundary

int MeshAdaptPUMIDrvr::num_quadrature_boundary

Definition at line 111 of file MeshAdaptPUMI.h.

◆ numAdaptSteps

int MeshAdaptPUMIDrvr::numAdaptSteps

Definition at line 80 of file MeshAdaptPUMI.h.

◆ numIter

int MeshAdaptPUMIDrvr::numIter

Definition at line 74 of file MeshAdaptPUMI.h.

◆ numModelEntities

int MeshAdaptPUMIDrvr::numModelEntities[4]

Definition at line 45 of file MeshAdaptPUMI.h.

◆ numModelOffsets

int MeshAdaptPUMIDrvr::numModelOffsets[4]

Definition at line 122 of file MeshAdaptPUMI.h.

◆ numModelTotals

int MeshAdaptPUMIDrvr::numModelTotals[4]

Definition at line 123 of file MeshAdaptPUMI.h.

◆ numSegments

int MeshAdaptPUMIDrvr::numSegments

Definition at line 41 of file MeshAdaptPUMI.h.

◆ rel_err_total

double MeshAdaptPUMIDrvr::rel_err_total

Definition at line 114 of file MeshAdaptPUMI.h.

◆ size_field_config

std::string MeshAdaptPUMIDrvr::size_field_config

Definition at line 85 of file MeshAdaptPUMI.h.

◆ total_error

double MeshAdaptPUMIDrvr::total_error

Definition at line 112 of file MeshAdaptPUMI.h.


The documentation for this class was generated from the following files: