OGS
|
Definition in file VerticalSliceFromLayers.cpp.
#include <algorithm>
#include <cmath>
#include <memory>
#include <string>
#include <vector>
#include <tclap/CmdLine.h>
#include <QCoreApplication>
#include "Applications/FileIO/Gmsh/GMSHInterface.h"
#include "Applications/FileIO/Gmsh/GmshReader.h"
#include "BaseLib/FileTools.h"
#include "BaseLib/IO/readStringListFromFile.h"
#include "BaseLib/MPI.h"
#include "GeoLib/AABB.h"
#include "GeoLib/AnalyticalGeometry.h"
#include "GeoLib/GEOObjects.h"
#include "GeoLib/IO/XmlIO/Qt/XmlGmlInterface.h"
#include "GeoLib/Point.h"
#include "GeoLib/Polygon.h"
#include "GeoLib/Polyline.h"
#include "InfoLib/GitInfo.h"
#include "MathLib/MathTools.h"
#include "MathLib/Point3d.h"
#include "MeshGeoToolsLib/GeoMapper.h"
#include "MeshLib/Elements/Element.h"
#include "MeshLib/IO/VtkIO/VtuInterface.h"
#include "MeshLib/IO/readMeshFromFile.h"
#include "MeshLib/Mesh.h"
#include "MeshLib/MeshSearch/ElementSearch.h"
#include "MeshLib/Node.h"
#include "MeshToolsLib/MeshEditing/MeshRevision.h"
#include "MeshToolsLib/MeshEditing/RemoveMeshComponents.h"
#include "MeshToolsLib/MeshSurfaceExtraction.h"
Go to the source code of this file.
Functions | |
std::vector< GeoLib::Point * > | createPoints (MathLib::Point3d const &start, MathLib::Point3d const &end, std::size_t const n_intervals) |
creates a vector of sampling points based on the specified resolution | |
GeoLib::Polyline * | createPolyline (std::vector< GeoLib::Point * > const &points) |
creates a polyline to be mapped on a mesh layer | |
std::vector< std::string > | createGeometries (GeoLib::GEOObjects &geo, std::vector< std::string > const &layer_names, MathLib::Point3d const &pnt_start, MathLib::Point3d const &pnt_end, double const resolution) |
creates a mapped line for each of the mesh layers | |
static GeoLib::Point * | getMinElevationPoint (GeoLib::Point *a, GeoLib::Point *b) |
void | mergeGeometries (GeoLib::GEOObjects &geo, std::vector< std::string > const &geo_names, std::string &merged_geo_name) |
std::pair< Eigen::Matrix3d, double > | rotateGeometryToXY (std::vector< GeoLib::Point * > &points) |
rotates the merged geometry into the XY-plane | |
void | consolidateGeometry (GeoLib::GEOObjects &geo, std::string const &output_name, std::string &merged_geo_name, bool const keep_gml_file) |
MeshLib::Mesh * | generateMesh (GeoLib::GEOObjects &geo, std::string const &geo_name, std::string const &output_name, double res) |
converts geometry into GMSH format and creates mesh | |
void | rotateMesh (MeshLib::Mesh &mesh, Eigen::Matrix3d const &rot_mat, double const z_shift) |
inverse rotation of the mesh, back into original position | |
MeshLib::Mesh * | removeLineElements (MeshLib::Mesh const &mesh) |
removes line elements from mesh such that only triangles remain | |
void | writeBoundary (MeshLib::Mesh const &mesh, std::vector< std::size_t > const &idx_array, std::string const &file_name) |
void | extractBoundaries (MeshLib::Mesh const &mesh, std::string const &output_name, MathLib::Point3d const &pnt_start) |
int | main (int argc, char *argv[]) |
void consolidateGeometry | ( | GeoLib::GEOObjects & | geo, |
std::string const & | output_name, | ||
std::string & | merged_geo_name, | ||
bool const | keep_gml_file ) |
This encapsulates a workaround: For unknown reasons, the GML->GEO converter will not work correctly when inputting the merged geometry directly. However, if the geometry is saved to a file and immediately loaded again, everything works fine.
Definition at line 208 of file VerticalSliceFromLayers.cpp.
References BaseLib::IO::XMLInterface::export_name, GeoLib::IO::XmlGmlInterface::readFile(), BaseLib::removeFile(), GeoLib::GEOObjects::removePointVec(), GeoLib::GEOObjects::removePolylineVec(), BaseLib::IO::writeStringToFile(), and BaseLib::IO::Writer::writeToString().
Referenced by main().
std::vector< std::string > createGeometries | ( | GeoLib::GEOObjects & | geo, |
std::vector< std::string > const & | layer_names, | ||
MathLib::Point3d const & | pnt_start, | ||
MathLib::Point3d const & | pnt_end, | ||
double const | resolution ) |
creates a mapped line for each of the mesh layers
Definition at line 82 of file VerticalSliceFromLayers.cpp.
References GeoLib::GEOObjects::addPointVec(), GeoLib::GEOObjects::addPolylineVec(), createPoints(), createPolyline(), ERR(), GeoLib::GEOObjects::getPointVec(), MeshGeoToolsLib::GeoMapper::mapOnMesh(), and MeshLib::IO::readMeshFromFile().
Referenced by main().
std::vector< GeoLib::Point * > createPoints | ( | MathLib::Point3d const & | start, |
MathLib::Point3d const & | end, | ||
std::size_t const | n_intervals ) |
creates a vector of sampling points based on the specified resolution
Definition at line 48 of file VerticalSliceFromLayers.cpp.
References MathLib::sqrDist().
Referenced by createGeometries().
GeoLib::Polyline * createPolyline | ( | std::vector< GeoLib::Point * > const & | points | ) |
creates a polyline to be mapped on a mesh layer
Definition at line 70 of file VerticalSliceFromLayers.cpp.
References GeoLib::Polyline::addPoint().
Referenced by createGeometries().
void extractBoundaries | ( | MeshLib::Mesh const & | mesh, |
std::string const & | output_name, | ||
MathLib::Point3d const & | pnt_start ) |
Definition at line 305 of file VerticalSliceFromLayers.cpp.
References MeshLib::Cell, MeshLib::Face, MeshToolsLib::BoundaryExtraction::getBoundaryElementsAsMesh(), MeshLib::getBulkIDString(), MeshLib::Mesh::getElements(), MeshLib::Node, and writeBoundary().
Referenced by main().
MeshLib::Mesh * generateMesh | ( | GeoLib::GEOObjects & | geo, |
std::string const & | geo_name, | ||
std::string const & | output_name, | ||
double | res ) |
converts geometry into GMSH format and creates mesh
Definition at line 231 of file VerticalSliceFromLayers.cpp.
References ERR(), FileIO::GMSH::FixedMeshDensity, FileIO::GMSH::readGMSHMesh(), FileIO::GMSH::GMSHInterface::writePhysicalGroups(), BaseLib::IO::writeStringToFile(), and BaseLib::IO::Writer::writeToString().
Referenced by main().
|
static |
Definition at line 123 of file VerticalSliceFromLayers.cpp.
Referenced by mergeGeometries().
int main | ( | int | argc, |
char * | argv[] ) |
Definition at line 366 of file VerticalSliceFromLayers.cpp.
References consolidateGeometry(), createGeometries(), ERR(), extractBoundaries(), generateMesh(), GeoLib::GEOObjects::getPointVec(), mergeGeometries(), GitInfoLib::GitInfo::ogs_version, BaseLib::IO::readStringListFromFile(), BaseLib::removeFile(), removeLineElements(), rotateGeometryToXY(), rotateMesh(), MeshToolsLib::MeshRevision::simplifyMesh(), MathLib::sqrDist(), and MeshLib::IO::VtuInterface::writeToFile().
void mergeGeometries | ( | GeoLib::GEOObjects & | geo, |
std::vector< std::string > const & | geo_names, | ||
std::string & | merged_geo_name ) |
Merges all layer geometries into one. Each layer is specified by one polygon. This will ensure that GMSH deals with the subsequent assignment of material groups automatically.
Definition at line 131 of file VerticalSliceFromLayers.cpp.
References GeoLib::Polyline::addPoint(), GeoLib::GEOObjects::addPointVec(), GeoLib::GEOObjects::addPolylineVec(), getMinElevationPoint(), GeoLib::Polyline::getPointID(), and GeoLib::GEOObjects::getPointVec().
Referenced by main().
MeshLib::Mesh * removeLineElements | ( | MeshLib::Mesh const & | mesh | ) |
removes line elements from mesh such that only triangles remain
Definition at line 271 of file VerticalSliceFromLayers.cpp.
References MeshLib::Mesh::getElements().
Referenced by main().
std::pair< Eigen::Matrix3d, double > rotateGeometryToXY | ( | std::vector< GeoLib::Point * > & | points | ) |
rotates the merged geometry into the XY-plane
Definition at line 185 of file VerticalSliceFromLayers.cpp.
References GeoLib::computeRotationMatrixToXY(), GeoLib::AABB::getMaxPoint(), GeoLib::AABB::getMinPoint(), GeoLib::getNewellPlane(), and GeoLib::rotatePoints().
Referenced by main().
void rotateMesh | ( | MeshLib::Mesh & | mesh, |
Eigen::Matrix3d const & | rot_mat, | ||
double const | z_shift ) |
inverse rotation of the mesh, back into original position
Definition at line 261 of file VerticalSliceFromLayers.cpp.
References MeshLib::Mesh::getNodes(), and GeoLib::rotatePoints().
Referenced by main().
void writeBoundary | ( | MeshLib::Mesh const & | mesh, |
std::vector< std::size_t > const & | idx_array, | ||
std::string const & | file_name ) |
Definition at line 290 of file VerticalSliceFromLayers.cpp.
References ERR(), MeshToolsLib::removeElements(), and MeshLib::IO::VtuInterface::writeToFile().
Referenced by extractBoundaries().