diff --git a/Applications/CLI/ogs.cpp b/Applications/CLI/ogs.cpp index f2d0610f694637fab5553a7e0285c598d7d28bdb..876057c44260c3b90f05dcfa7a77f998d39e28e8 100644 --- a/Applications/CLI/ogs.cpp +++ b/Applications/CLI/ogs.cpp @@ -13,14 +13,6 @@ #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/xml_parser.hpp> -#ifdef USE_MPI -#include <mpi.h> -#endif - -#ifdef USE_PETSC -#include <petsc.h> -#endif - // ThirdParty/tclap #include "tclap/CmdLine.h" diff --git a/MeshGeoToolsLib/GeoMapper.cpp b/MeshGeoToolsLib/GeoMapper.cpp index 7c390a381664d462d8c331adc400d0c8c6643650..1855527286bc211610669c31c2f0235767741f2f 100644 --- a/MeshGeoToolsLib/GeoMapper.cpp +++ b/MeshGeoToolsLib/GeoMapper.cpp @@ -154,18 +154,30 @@ float GeoMapper::getDemElevation(GeoLib::Point const& pnt) const return static_cast<float>(elevation); } -double GeoMapper::getMeshElevation(double x, double y, double min_val, double max_val) const +double GeoMapper::getMeshElevation( + double x, double y, double min_val, double max_val) const { - const MeshLib::Node* pnt = _grid->getNearestPoint(MathLib::Point3d{{{x,y,0}}}); - const std::vector<MeshLib::Element*> elements (_surface_mesh->getNode(pnt->getID())->getElements()); - GeoLib::Point* intersection (nullptr); + const MeshLib::Node* pnt = + _grid->getNearestPoint(MathLib::Point3d{{{x, y, 0}}}); + const std::vector<MeshLib::Element*> elements( + _surface_mesh->getNode(pnt->getID())->getElements()); + GeoLib::Point* intersection(nullptr); - for (std::size_t i=0; i<elements.size(); ++i) + for (std::size_t i = 0; i < elements.size(); ++i) { - if (intersection==nullptr && elements[i]->getGeomType() != MeshLib::MeshElemType::LINE) - intersection=GeoLib::triangleLineIntersection(*elements[i]->getNode(0), *elements[i]->getNode(1), *elements[i]->getNode(2), GeoLib::Point(x,y,max_val), GeoLib::Point(x,y,min_val)); - if (intersection==nullptr && elements[i]->getGeomType() == MeshLib::MeshElemType::QUAD) - intersection=GeoLib::triangleLineIntersection(*elements[i]->getNode(0), *elements[i]->getNode(2), *elements[i]->getNode(3), GeoLib::Point(x,y,max_val), GeoLib::Point(x,y,min_val)); + if (intersection == nullptr && + elements[i]->getGeomType() != MeshLib::MeshElemType::LINE) + intersection = GeoLib::triangleLineIntersection( + *elements[i]->getNode(0), *elements[i]->getNode(1), + *elements[i]->getNode(2), GeoLib::Point(x, y, max_val), + GeoLib::Point(x, y, min_val)); + + if (intersection == nullptr && + elements[i]->getGeomType() == MeshLib::MeshElemType::QUAD) + intersection = GeoLib::triangleLineIntersection( + *elements[i]->getNode(0), *elements[i]->getNode(2), + *elements[i]->getNode(3), GeoLib::Point(x, y, max_val), + GeoLib::Point(x, y, min_val)); } if (intersection) return (*intersection)[2]; @@ -194,7 +206,8 @@ std::vector<GeoLib::Polyline*>* copyPolylinesVector(const std::vector<GeoLib::Po } -void GeoMapper::advancedMapOnMesh(const MeshLib::Mesh* mesh, const std::string &new_geo_name) +void GeoMapper::advancedMapOnMesh( + MeshLib::Mesh const* mesh, std::string const& new_geo_name) { const std::vector<GeoLib::Point*> *points (this->_geo_objects.getPointVec(this->_geo_name)); const std::vector<GeoLib::Polyline*> *org_lines (this->_geo_objects.getPolylineVec(this->_geo_name)); @@ -212,11 +225,14 @@ void GeoMapper::advancedMapOnMesh(const MeshLib::Mesh* mesh, const std::string & GeoLib::Grid<GeoLib::Point> grid(new_points->begin(), new_points->end()); double max_segment_length (this->getMaxSegmentLength(*new_lines)); - max_segment_length *= max_segment_length; // squared so it can be compared to the squared distances calculated later + // squared so it can be compared to the squared distances calculated later + max_segment_length *= max_segment_length; const unsigned nMeshNodes ( mesh->getNNodes() ); - std::vector<int> closest_geo_point(nMeshNodes); // index of closest geo point for each mesh node in (x,y)-plane - std::vector<double> dist(nMeshNodes); // distance between geo points and mesh nodes in (x,y)-plane + // index of closest geo point for each mesh node in (x,y)-plane + std::vector<int> closest_geo_point(nMeshNodes); + // distance between geo points and mesh nodes in (x,y)-plane + std::vector<double> dist(nMeshNodes); for (std::size_t i=0; i<nMeshNodes; ++i) { auto const zero_coords = GeoLib::Point((*mesh->getNode(i))[0], diff --git a/ProcessLib/ProcessVariable.cpp b/ProcessLib/ProcessVariable.cpp index 3ae34ecd007bdec36c9a6ca495f2504375bb3161..819d32b317104438e8270ad3c2e123ae14db8b69 100644 --- a/ProcessLib/ProcessVariable.cpp +++ b/ProcessLib/ProcessVariable.cpp @@ -40,7 +40,7 @@ ProcessVariable::ProcessVariable(ConfigTree const& config, _initial_condition = createUniformInitialCondition(ic_config->second); } - if (type == "MeshProperty") + else if (type == "MeshProperty") { _initial_condition = createMeshPropertyInitialCondition(ic_config->second, _mesh);