OGS
|
Definition in file Layers2Grid.cpp.
#include <algorithm>
#include <memory>
#include <string>
#include <vector>
#include <tclap/CmdLine.h>
#include "BaseLib/IO/readStringListFromFile.h"
#include "GeoLib/AABB.h"
#include "InfoLib/GitInfo.h"
#include "MathLib/Point3d.h"
#include "MeshLib/Elements/Element.h"
#include "MeshLib/IO/VtkIO/VtuInterface.h"
#include "MeshLib/IO/readMeshFromFile.h"
#include "MeshLib/Mesh.h"
#include "MeshLib/MeshEditing/ProjectPointOnMesh.h"
#include "MeshLib/MeshEditing/RemoveMeshComponents.h"
#include "MeshLib/MeshGenerators/MeshGenerator.h"
#include "MeshLib/MeshSearch/MeshElementGrid.h"
#include "MeshLib/Node.h"
Go to the source code of this file.
Functions | |
void | adjustExtent (std::pair< MathLib::Point3d, MathLib::Point3d > &extent, MeshLib::Mesh const &mesh) |
std::unique_ptr< MeshLib::Mesh > | generateInitialMesh (std::pair< MathLib::Point3d, MathLib::Point3d > &extent, std::array< double, 3 > const &res) |
MeshLib::Element const * | getProjectedElement (MeshLib::MeshElementGrid const &grid, MeshLib::Node const &node, double const max_edge) |
void | voteMatId (MeshLib::Node const &node, MeshLib::MeshElementGrid const &grid, double const max_edge, std::size_t &nullptr_cnt, std::size_t &upper_layer_cnt, std::size_t &lower_layer_cnt) |
void | setMaterialIDs (MeshLib::Mesh &mesh, std::vector< std::unique_ptr< MeshLib::Mesh >> const &layers, bool const dilate) |
MeshLib::Mesh * | removeUnusedElements (MeshLib::Mesh const &mesh) |
int | main (int argc, char *argv[]) |
Variables | |
static std::string | mat_name = "MaterialIDs" |
void adjustExtent | ( | std::pair< MathLib::Point3d, MathLib::Point3d > & | extent, |
MeshLib::Mesh const & | mesh | ||
) |
Definition at line 35 of file Layers2Grid.cpp.
References GeoLib::AABB::getMaxPoint(), GeoLib::AABB::getMinPoint(), and MeshLib::Mesh::getNodes().
Referenced by main().
std::unique_ptr<MeshLib::Mesh> generateInitialMesh | ( | std::pair< MathLib::Point3d, MathLib::Point3d > & | extent, |
std::array< double, 3 > const & | res | ||
) |
Definition at line 48 of file Layers2Grid.cpp.
References MeshLib::Cell, MeshLib::MeshGenerator::generateRegularHexMesh(), INFO(), and mat_name.
Referenced by main().
MeshLib::Element const* getProjectedElement | ( | MeshLib::MeshElementGrid const & | grid, |
MeshLib::Node const & | node, | ||
double const | max_edge | ||
) |
Definition at line 83 of file Layers2Grid.cpp.
References MeshLib::MeshElementGrid::getElementsInVolume(), and MeshLib::ProjectPointOnMesh::getProjectedElement().
Referenced by voteMatId().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 218 of file Layers2Grid.cpp.
References adjustExtent(), ERR(), generateInitialMesh(), GitInfoLib::GitInfo::ogs_version, MeshLib::IO::readMeshFromFile(), BaseLib::IO::readStringListFromFile(), removeUnusedElements(), setMaterialIDs(), and MeshLib::IO::VtuInterface::writeToFile().
MeshLib::Mesh* removeUnusedElements | ( | MeshLib::Mesh const & | mesh | ) |
Definition at line 198 of file Layers2Grid.cpp.
References MeshLib::Mesh::getNumberOfElements(), MeshLib::materialIDs(), and MeshLib::removeElements().
Referenced by main().
void setMaterialIDs | ( | MeshLib::Mesh & | mesh, |
std::vector< std::unique_ptr< MeshLib::Mesh >> const & | layers, | ||
bool const | dilate | ||
) |
Definition at line 121 of file Layers2Grid.cpp.
References MeshLib::getCenterOfGravity(), MeshLib::Mesh::getElements(), MeshLib::Mesh::getNumberOfElements(), MeshLib::Mesh::getProperties(), MeshLib::Properties::getPropertyVector(), INFO(), mat_name, and voteMatId().
Referenced by main().
void voteMatId | ( | MeshLib::Node const & | node, |
MeshLib::MeshElementGrid const & | grid, | ||
double const | max_edge, | ||
std::size_t & | nullptr_cnt, | ||
std::size_t & | upper_layer_cnt, | ||
std::size_t & | lower_layer_cnt | ||
) |
Definition at line 101 of file Layers2Grid.cpp.
References MeshLib::ProjectPointOnMesh::getElevation(), and getProjectedElement().
Referenced by setMaterialIDs().
|
static |
Definition at line 32 of file Layers2Grid.cpp.
Referenced by generateInitialMesh(), and setMaterialIDs().