OGS
|
Manipulating and adding prism element layers to an existing 2D mesh.
Definition at line 25 of file MeshLayerMapper.h.
#include <MeshLayerMapper.h>
Public Member Functions | |
~MeshLayerMapper () override=default | |
bool | createRasterLayers (MeshLib::Mesh const &mesh, std::vector< GeoLib::Raster const * > const &rasters, double minimum_thickness, double noDataReplacementValue=0.0) override |
Public Member Functions inherited from LayeredMeshGenerator | |
virtual bool | createLayers (MeshLib::Mesh const &mesh, std::vector< GeoLib::Raster const * > const &rasters, double minimum_thickness, double noDataReplacementValue=0.0) final |
std::unique_ptr< MeshLib::Mesh > | getMesh (std::string const &mesh_name) const |
Returns a mesh of the subsurface representation. | |
Static Public Member Functions | |
static MeshLib::Mesh * | createStaticLayers (MeshLib::Mesh const &mesh, std::vector< float > const &layer_thickness_vector, std::string const &mesh_name="SubsurfaceMesh") |
static bool | layerMapping (MeshLib::Mesh const &mesh, const GeoLib::Raster &raster, double nodata_replacement=0.0, bool const ignore_nodata=false) |
static bool | mapToStaticValue (MeshLib::Mesh const &mesh, double value) |
Maps the elevation of all mesh nodes to the specified static value. | |
Private Member Functions | |
void | addLayerToMesh (const MeshLib::Mesh &dem_mesh, unsigned layer_id, GeoLib::Raster const &raster) override |
Adds another layer to a subsurface mesh. | |
Additional Inherited Members | |
Protected Member Functions inherited from LayeredMeshGenerator | |
LayeredMeshGenerator ()=default | |
virtual | ~LayeredMeshGenerator ()=default |
MeshLib::Node * | getNewLayerNode (MeshLib::Node const &dem_node, MeshLib::Node const &last_layer_node, GeoLib::Raster const &raster, std::size_t new_node_id) const |
Static Protected Member Functions inherited from LayeredMeshGenerator | |
static double | calcEpsilon (GeoLib::Raster const &low, GeoLib::Raster const &high) |
Calculates a data-dependent epsilon value. | |
Protected Attributes inherited from LayeredMeshGenerator | |
double | _elevation_epsilon {0.0001} |
double | _minimum_thickness {std::numeric_limits<float>::epsilon()} |
std::vector< int > | _materials |
std::vector< MeshLib::Node * > | _nodes |
std::vector< MeshLib::Element * > | _elements |
|
overridedefault |
|
overrideprivatevirtual |
Adds another layer to a subsurface mesh.
Implements LayeredMeshGenerator.
Definition at line 199 of file MeshLayerMapper.cpp.
References LayeredMeshGenerator::_elements, LayeredMeshGenerator::_materials, LayeredMeshGenerator::_nodes, MeshLib::Mesh::getElements(), MeshLib::Element::getGeomType(), LayeredMeshGenerator::getNewLayerNode(), MeshLib::Mesh::getNodes(), MeshLib::Mesh::getNumberOfElements(), MeshLib::Mesh::getNumberOfNodes(), and MeshLib::TRIANGLE.
Referenced by createRasterLayers().
|
overridevirtual |
Based on a 2D triangle mesh this method creates a 3D mesh with a given number of prism-layers. Note: While this method would technically also work with quad meshes, this is discouraged as quad elements will most likely not be coplanar after the mapping process which result in invaled mesh elements.
mesh | The 2D triangle mesh that is the basis for the new 3D prism mesh |
rasters | Containing all the raster-data for the subsurface layers from bottom to top (starting with the bottom of the oldest layer and ending with the DEM) |
minimum_thickness | Minimum thickness of each of the newly created layers (i.e. nodes with a vertical distance smaller than this will be collapsed) |
noDataReplacementValue | Default z-coordinate if there are mesh nodes not located on the DEM raster (i.e. raster_paths[0]) |
Implements LayeredMeshGenerator.
Definition at line 147 of file MeshLayerMapper.cpp.
References LayeredMeshGenerator::_elements, LayeredMeshGenerator::_materials, LayeredMeshGenerator::_minimum_thickness, LayeredMeshGenerator::_nodes, addLayerToMesh(), ERR(), MeshLib::Mesh::getDimension(), MeshLib::Mesh::getElements(), MeshLib::Mesh::getNumberOfNodes(), and layerMapping().
|
static |
Based on a 2D triangle-or quad mesh this method creates a 3D mesh with a given number of prism- or hex-layers
mesh | The triangle/quad mesh that is the basis for the new prism/hex mesh |
layer_thickness_vector | The size of the vector equals the number of layers of prism/hex elements that will be extruded from the triangle/quad elements of the original mesh. The thickness of the \(i\)-th layer corresponds to the \(i\) entry of the vector. |
mesh_name | The name of the newly created mesh |
Definition at line 31 of file MeshLayerMapper.cpp.
References MeshLib::Cell, MeshLib::Properties::createNewPropertyVector(), ERR(), MeshLib::Element::getDimension(), MeshLib::Mesh::getDimension(), MeshLib::Mesh::getElements(), MeshLib::Element::getGeomType(), MathLib::Point3dWithID::getID(), MeshLib::Element::getNode(), MeshLib::Mesh::getNodes(), MeshLib::Element::getNumberOfBaseNodes(), MeshLib::Mesh::getNumberOfElements(), MeshLib::Mesh::getNumberOfNodes(), OGS_FATAL, MeshLib::QUAD, MeshLib::TRIANGLE, and WARN().
Referenced by MeshLayerEditDialog::createPrismMesh(), and MeshLayerEditDialog::createTetMesh().
|
static |
Maps the elevation of nodes of a given 2D mesh according to the raster. At locations where no information is given, node elevation is set to noDataReplacementValue.
Definition at line 287 of file MeshLayerMapper.cpp.
References GeoLib::RasterHeader::cell_size, ERR(), MeshLib::Mesh::getDimension(), GeoLib::Raster::getHeader(), MeshLib::Mesh::getNodes(), MeshLib::Mesh::getNumberOfNodes(), GeoLib::Raster::getValueAtPoint(), GeoLib::Raster::interpolateValueAtPoint(), GeoLib::Raster::isPntOnRaster(), GeoLib::RasterHeader::n_cols, GeoLib::RasterHeader::n_rows, GeoLib::RasterHeader::no_data, and GeoLib::RasterHeader::origin.
Referenced by LayeredVolume::createRasterLayers(), createRasterLayers(), main(), and MeshView::openMap2dMeshDialog().
|
static |
Maps the elevation of all mesh nodes to the specified static value.
Definition at line 339 of file MeshLayerMapper.cpp.
References ERR(), MeshLib::Mesh::getDimension(), and MeshLib::Mesh::getNodes().
Referenced by main(), and MeshView::openMap2dMeshDialog().