19#include <range/v3/view/transform.hpp>
31 class NodeWiseMeshPartitioner;
46 const std::vector<std::size_t>& nodes);
58 Mesh(std::string name,
63 bool const compute_element_neighbors =
false,
130 std::size_t node_id)
const;
132 Node const& node)
const;
189PropertyVector<int>
const*
materialIDs(Mesh
const& mesh);
191PropertyVector<std::size_t>
const*
bulkNodeIDs(Mesh
const& mesh);
192PropertyVector<std::size_t>
const*
bulkElementIDs(Mesh
const& mesh);
197 std::vector<Element const*>
const& elements_connected_to_node);
201 std::vector<Element*>
const& elements);
208 if constexpr (std::is_pointer_v<T>)
210 return a->getID() < b->getID();
214 return a.getID() < b.getID();
218Mesh&
findMeshByName(std::vector<std::unique_ptr<Mesh>>
const& meshes,
219 std::string_view
const name);
225inline constexpr ranges::views::view_closure
ids =
226 ranges::views::transform([](
auto const& a) {
return a->getID(); });
229inline constexpr ranges::views::view_closure
names =
230 ranges::views::transform([](
auto const& a) {
return a->getName(); });
232inline constexpr ranges::views::view_closure
coords =
234 {
return std::span(n->
data(), n->
data() + 3); });
Definition of mesh-related Enumerations.
Definition of the class Properties that implements a container of properties.
Definition of the Point3d class.
const double * data() const
bool isAxiallySymmetric() const
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
void calcEdgeLengthRange()
Set the minimum and maximum length over the edges of the mesh.
bool const _compute_element_neighbors
std::vector< std::vector< Element const * > > _elements_connected_to_nodes
void setName(const std::string &name)
Changes the name of the mesh.
void addElement(Element *elem)
Add an element to the mesh.
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
std::size_t computeNumberOfBaseNodes() const
Get the number of base nodes.
friend void removeMeshNodes(Mesh &mesh, const std::vector< std::size_t > &nodes)
Mesh & operator=(Mesh &&mesh)=delete
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
std::size_t getID() const
Get id of the mesh.
void resetNodeIDs()
Resets the IDs of all mesh-nodes to their position in the node vector.
const Node * getNode(std::size_t idx) const
Get the node with the given index.
Properties & getProperties()
const Element * getElement(std::size_t idx) const
Get the element with the given index.
std::vector< Element * > _elements
void setDimension()
Sets the dimension of the mesh.
const std::string getName() const
Get name of the mesh.
void resetElementIDs()
Resets the IDs of all mesh-elements to their position in the element vector.
void setElementNeighbors()
virtual ~Mesh()
Destructor.
Mesh(std::string name, std::vector< Node * > nodes, std::vector< Element * > elements, bool const compute_element_neighbors=false, Properties const &properties=Properties())
std::size_t getNumberOfNodes() const
Get the number of nodes.
std::vector< Element const * > const & getElementsConnectedToNode(std::size_t node_id) const
void setAxiallySymmetric(bool is_axial_symmetric)
std::pair< double, double > _node_distance
The minimal and maximal distance of nodes within an element over all elements in the mesh.
Mesh & operator=(const Mesh &mesh)=delete
Properties const & getProperties() const
bool hasNonlinearElement() const
Check if the mesh contains any nonlinear element.
std::size_t getNumberOfElements() const
Get the number of elements.
std::vector< Node * > _nodes
bool _is_axially_symmetric
Property manager on mesh items. Class Properties manages scalar, vector or matrix properties....
constexpr ranges::views::view_closure ids
For an element of a range view return its id.
constexpr ranges::views::view_closure coords
constexpr ranges::views::view_closure names
For an element of a range view return its name.
std::vector< std::vector< Node * > > calculateNodesConnectedByElements(Mesh const &mesh)
Mesh & findMeshByName(std::vector< std::unique_ptr< Mesh > > const &meshes, std::string_view const name)
bool idsComparator(T const a, T const b)
PropertyVector< int > const * materialIDs(Mesh const &mesh)
PropertyVector< std::size_t > const * bulkElementIDs(Mesh const &mesh)
std::pair< double, double > minMaxEdgeLength(std::vector< Element * > const &elements)
Returns the minimum and maximum edge length for given elements.
bool operator==(Mesh const &a, Mesh const &b)
Meshes are equal if their id's are equal.
bool operator!=(Mesh const &a, Mesh const &b)
bool isBaseNode(Node const &node, std::vector< Element const * > const &elements_connected_to_node)
PropertyVector< std::size_t > const * bulkNodeIDs(Mesh const &mesh)