AnalyticalProcess
The GeMA Analytical Process Plugin
Loading...
Searching...
No Matches
GmpAnalyticalSolver Class Reference

Basic class for the Analytical solving process. More...

#include <gmpAnalyticalSolver.h>

Collaboration diagram for GmpAnalyticalSolver:

Public Member Functions

 GmpAnalyticalSolver (GmMesh *srcMesh, GmMesh *resultMesh, const GmpAnalyticalSolverOptions *options, GmSimulationData *simulation, const GmLogCategory &logger)
 Constructor. Stores the source and destination meshes, together with the solver options on the object. Further validations and initializations are delayed until the call to init() since it can return errors.
 
 ~GmpAnalyticalSolver (void)
 Destructor.
 
bool init ()
 Init the solver. Returns true on success. On errors, logs a message and returns false.
 
bool solve ()
 Executes the solver. Returns true on success, false on error.
 

Private Member Functions

bool setupBurialData ()
 Prepares the data needed for calculating burial depths. If the user has given us a sea floor mesh, we have to create the associated projected mesh and its spatial index to allow for easy querying which sea floor mesh cell contains a given x-y coordinate. If the user has given us a mean sea level depth, we might need to convert it to meters depending on the given data unit. Returns true on success, false otherwise (logging the appropriate error message).
 
bool buildProjectedSeaFloorMesh ()
 Creates a new auxiliar 2D mesh where every 3D quad or triangle from the source sea floor mesh is projected on the x-y plane. This auxiliar 2D mesh, and associated spatial index, can be used to easily find the cell containing a given x-y coordinate.
 
bool burialDepth (const GmVector &point, double *depth)
 Given a x,y,z coordinate (in "m"), returns the burial depth of that point, defined as the depth from that point to the sea level floor. If a sea floor mesh was given, and the point is outside of the mesh projection in the x-y plane, returns false.
 
GmValueAccessorgetOrCreateNodeAttributeAccessor (GmMesh *mesh, QString stdAttributeName, QString msgDescription, Unit desiredUnit, bool required, int type=-1, int nlin=-1, int ncol=-1, int history=-1, bool canBeFunction=true, bool create=false, QString createFormat="", int createHistory=-1, bool ignoreWarnings=false)
 Similar in purpose (and implementation) to GmPhysics::nodeAttributeAccessor(). The main differences is that it does not get an attribute name translation table. It also queries both node attributes and state vars, but if a creation is needed, a node attribute will be created.
 

Private Attributes

GmSimulationData_simulation
 Simulation Data.
 
GmMesh_srcMesh
 Mesh with pressure and/or temperature node data.
 
GmMesh_dstMesh
 Result mesh with displacement and/or stress node data to be filled.
 
const GmpAnalyticalSolverOptions_options
 Solver options.
 
const GmLogCategory_logger
 Logger for eventual messages.
 
GmValueAccessor_srcCoordAc
 A node data accessor for _srcMesh node coordinates. Values in 'm'.
 
GmValueAccessor_dstCoordAc
 A node data accessor for _dstMesh node coordinates. Values in 'm'.
 
GmValueAccessor_pAc
 A node data accessor for pressure data from _srcMesh. Values in 'kPa'.
 
GmValueAccessor_tAc
 A node data accessor for temperature data from _srcMesh. Values in 'K'.
 
GmValueAccessor_uAc
 A node data accessor for displacement data from _dstMesh. Values in 'm'.
 
GmValueAccessor_sAc
 A node data accessor for stress data from _dstMesh. Values in 'kPa'.
 
GmValueAccessor_eAc
 A node data accessor for strain data from _dstMesh.

 
GmCellMesh_seaFloorMesh
 The optional mesh with the sea floor geometry. Can be NULL.
 
GmValueAccessor_seaFloorCoordAc
 A node data accessor for the (unprojected) sea floor mesh node coordinates. Values in 'm'. Exists only if _seaFloorMesh is not null.
 
GmCellMesh_projSeaFloorMesh
 The auxiliar mesh with a x-y projection of the sea floor mesh. Exists only if _seaFloorMesh is not null.
 
GmSpatialIndex_projSeaFloorIndex
 Spatial index for the projected sea floor mesh. Exists only if _seaFloorMesh is not null.
 
double _meanSeaLevelDepth
 The mean sea level depth. Used when _seaFloorMesh is NULL. Value in 'm' (unlike the value in _options, which can be in other units).
 

Detailed Description

Basic class for the Analytical solving process.

Constructor & Destructor Documentation

◆ GmpAnalyticalSolver()

GmpAnalyticalSolver::GmpAnalyticalSolver ( GmMesh * srcMesh,
GmMesh * resultMesh,
const GmpAnalyticalSolverOptions * options,
GmSimulationData * simulation,
const GmLogCategory & logger )

Constructor. Stores the source and destination meshes, together with the solver options on the object. Further validations and initializations are delayed until the call to init() since it can return errors.

Parameters
srcMeshThe 3D node mesh storing the pressure and/or temperature values needed for the calculation. Can be a simples GmMesh (point cloud).
resultMeshThe 3D node mesh where the calculated results (displacement, stress and/or strain) will be saved. Can be a simples GmMesh (point cloud). It can be the same mesh as srcMesh or a different one.
optionsAn object storing several simulation options controlling the solver behaviour. This includes the sea floor definition. The solver takes ownership of the given options object and is responsible for deleting it at its destructor.
simulationThe simulation data object
loggerThe logger that should be used to log any required messages to the user

Member Function Documentation

◆ getOrCreateNodeAttributeAccessor()

GmValueAccessor * GmpAnalyticalSolver::getOrCreateNodeAttributeAccessor ( GmMesh * mesh,
QString stdAttributeName,
QString msgDescription,
Unit desiredUnit,
bool required,
int type = -1,
int nlin = -1,
int ncol = -1,
int history = -1,
bool canBeFunction = true,
bool create = false,
QString createFormat = "",
int createHistory = -1,
bool ignoreWarnings = false )
private

Similar in purpose (and implementation) to GmPhysics::nodeAttributeAccessor(). The main differences is that it does not get an attribute name translation table. It also queries both node attributes and state vars, but if a creation is needed, a node attribute will be created.

IMPORTANT: This (re)implementation here is really NOT the best solution. We should really move the set of functions that check, and possibly create, node, cell and Gauss accessors from the GmPhysics (and GmpFemPhysics) class to static methods of the corresponding meshes. The main difficulty is the use of a createGaussAttributeAccessor() virtual function by GmpFemPhysics on behalf of the XFem plugin.


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