PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
refParticle.h
Go to the documentation of this file.
1/*
2 * -------------------------------------------
3 * Copyright (c) 2021 - 2024 Prashant K. Jha
4 * -------------------------------------------
5 * PeriDEM https://github.com/prashjha/PeriDEM
6 *
7 * Distributed under the Boost Software License, Version 1.0. (See accompanying
8 * file LICENSE)
9 */
10
11#ifndef PARTILCE_REFPARTILCE_H
12#define PARTILCE_REFPARTILCE_H
13
14#include "fe/mesh.h"
15#include "geometry/fracture.h"
18#include "util/geomObjects.h"
19#include "util/matrix.h" // definition of Matrix3
20#include "util/point.h" // definition of Point
21#include "util/transformation.h"
22#include "particleTransform.h"
23#include "model/modelData.h"
24
25#include <cstdint> // uint8_t type
26#include <cstring> // string and size_t type
27#include <vector>
28
30namespace particle {
31
41public:
49 RefParticle(size_t id,
50 std::shared_ptr<model::ModelData> model_data,
51 std::shared_ptr<util::geometry::GeomObject> geom,
52 std::shared_ptr<fe::Mesh> mesh);
53
63 std::shared_ptr<fe::Mesh> &getMeshP() { return d_mesh_p; };
64
66 const std::shared_ptr<fe::Mesh> &getMeshP() const { return d_mesh_p; };
67
72 std::shared_ptr<util::geometry::GeomObject> &getGeomP() { return d_geom_p; };
73
75 const std::shared_ptr<util::geometry::GeomObject> &getGeomP() const { return d_geom_p; };
76
81 fe::Mesh &getMesh() { return *d_mesh_p; };
82
84 const fe::Mesh &getMesh() const { return *d_mesh_p; };
85
90 size_t getDimension() const {
91 return d_mesh_p->getDimension();
92 };
93
98 size_t getNumNodes() const {
99 return d_mesh_p->getNumNodes();
100 };
101
107 util::Point getNode(const size_t &i) const {
108 return d_mesh_p->getNode(i);
109 };
110
116 double getNodalVolume(const size_t &i) const {
117 return d_mesh_p->getNodalVolume(i);
118 };
119
124 size_t getCenterNodeId() const { return d_centerNode; };
125
130 double getParticleRadius() const { return d_pRadius; };
131
141 std::string printStr(int nt = 0, int lvl = 0) const;
142
149 void print(int nt = 0, int lvl = 0) const { std::cout << printStr(nt, lvl); }
150
151public:
153 size_t d_id;
154
156 std::shared_ptr<model::ModelData> d_modelData_p;
157
159 std::shared_ptr<fe::Mesh> d_mesh_p;
160
163
165 std::shared_ptr<util::geometry::GeomObject> d_geom_p;
166
168 double d_pRadius;
169
171 std::vector<size_t> d_bNodes;
172
177 std::vector<uint8_t> d_intFlags;
178};
179
180} // namespace particle
181
182#endif // PARTILCE_REFPARTILCE_H
A class for mesh data.
Definition mesh.h:51
A class to store reference particle related data. Consider a case of multiple hexagon-shaped particle...
Definition refParticle.h:40
std::shared_ptr< model::ModelData > d_modelData_p
Reference to model class.
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
size_t getCenterNodeId() const
Get id of center node of particle.
size_t d_id
Id of reference particle in list d_referenceParticles in ModelData.
util::Point getNode(const size_t &i) const
Get reference coordinate of a node.
std::shared_ptr< fe::Mesh > & getMeshP()
Get pointer to mesh object.
Definition refParticle.h:63
const fe::Mesh & getMesh() const
Get reference to mesh object.
Definition refParticle.h:84
size_t getDimension() const
Get the dimension of the domain.
Definition refParticle.h:90
const std::shared_ptr< fe::Mesh > & getMeshP() const
Get pointer to mesh object.
Definition refParticle.h:66
const std::shared_ptr< util::geometry::GeomObject > & getGeomP() const
Get pointer to geometry object.
Definition refParticle.h:75
size_t d_centerNode
Id of mesh node closest to the particle center.
double getNodalVolume(const size_t &i) const
Get nodal volume.
double d_pRadius
Particle radius.
size_t getNumNodes() const
Get the number of nodes.
Definition refParticle.h:98
std::shared_ptr< fe::Mesh > d_mesh_p
Pointer to mesh on reference particle.
std::vector< size_t > d_bNodes
List of nodes near boundary.
std::shared_ptr< util::geometry::GeomObject > & getGeomP()
Get pointer to geometry object.
Definition refParticle.h:72
void print(int nt=0, int lvl=0) const
Prints the information about the object.
std::shared_ptr< util::geometry::GeomObject > d_geom_p
Geometrical object defining this particle.
double getParticleRadius() const
Get radius of reference particle.
fe::Mesh & getMesh()
Get reference to mesh object.
Definition refParticle.h:81
std::vector< uint8_t > d_intFlags
Interior flags. For given node i the flag is d_intFlags[i%8]. We use 1 bit per node.
Collection of methods and data related to particle object.
A structure to represent 3d vectors.
Definition point.h:30