Revision 5b60c866971edc2a6b0ddaacb8e469e0fe0d1938 authored by Dmitry Yu. Naumov on 09 July 2021, 12:56:44 UTC, committed by Dmitry Yu. Naumov on 09 July 2021, 12:56:44 UTC
Material lib adsorbtion code improvements See merge request ogs/ogs!3700
MeshNodesAlongSurface.cpp
/**
* \author Norihiro Watanabe
* \date 2014-03-14
*
* \file
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*/
#include "MeshNodesAlongSurface.h"
#include <algorithm>
#include "BaseLib/quicksort.h"
#include "GeoLib/Surface.h"
#include "MathLib/MathTools.h"
#include "MeshLib/Mesh.h"
#include "MeshLib/Node.h"
namespace MeshGeoToolsLib
{
MeshNodesAlongSurface::MeshNodesAlongSurface(MeshLib::Mesh const& mesh,
GeoLib::Surface const& sfc,
double epsilon_radius,
SearchAllNodes search_all_nodes)
: _mesh(mesh), _sfc(sfc)
{
auto const& mesh_nodes = _mesh.getNodes();
const std::size_t n_nodes(search_all_nodes == SearchAllNodes::Yes
? _mesh.getNumberOfNodes()
: _mesh.getNumberOfBaseNodes());
// loop over all nodes
for (std::size_t i = 0; i < n_nodes; i++)
{
auto* node = mesh_nodes[i];
if (!sfc.isPntInBoundingVolume(*node, epsilon_radius))
{
continue;
}
if (sfc.isPntInSfc(*node, epsilon_radius))
{
_msh_node_ids.push_back(node->getID());
}
}
}
MeshLib::Mesh const& MeshNodesAlongSurface::getMesh() const
{
return _mesh;
}
std::vector<std::size_t> const& MeshNodesAlongSurface::getNodeIDs() const
{
return _msh_node_ids;
}
GeoLib::Surface const& MeshNodesAlongSurface::getSurface() const
{
return _sfc;
}
} // end namespace MeshGeoToolsLib
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...