19#include <range/v3/view/transform.hpp>
30 class NodeWiseMeshPartitioner;
45 const std::vector<std::size_t>& nodes);
55 Mesh(std::string name,
126 std::size_t node_id)
const;
128 Node const& node)
const;
184PropertyVector<int>
const*
materialIDs(Mesh
const& mesh);
186PropertyVector<std::size_t>
const*
bulkNodeIDs(Mesh
const& mesh);
187PropertyVector<std::size_t>
const*
bulkElementIDs(Mesh
const& mesh);
192 std::vector<Element const*>
const& elements_connected_to_node);
196 std::vector<Element*>
const& elements);
203 if constexpr (std::is_pointer_v<T>)
205 return a->getID() < b->getID();
209 return a.getID() < b.getID();
217inline constexpr ranges::views::view_closure
ids =
218 ranges::views::transform([](
auto const& a) {
return a->getID(); });
221inline constexpr ranges::views::view_closure
names =
222 ranges::views::transform([](
auto const& a) {
return a->getName(); });
224inline constexpr ranges::views::view_closure
coords =
226 {
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.
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.
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)
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)