PeriDEM 0.3.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 - 2026 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 "mesh/mesh.h"
15#include "fracture/fracture.h"
16#include "inp/particleDeck.h"
18#include "geom/geomIncludes.h"
19#include "util/matrix.h" // definition of Matrix3
20#include "util/point.h" // definition of Point
21#include "data/modelData.h"
22
23#include <cstdint> // uint8_t type
24#include <cstring> // string and size_t type
25#include <vector>
26
28namespace particle {
29
39public:
47 RefParticle(size_t id,
48 std::shared_ptr<data::ModelData> model_data,
49 std::shared_ptr<geom::GeomObject> geom,
50 std::shared_ptr<mesh::Mesh> mesh);
51
61 std::shared_ptr<mesh::Mesh> &getMeshP() { return d_mesh_p; };
62
64 const std::shared_ptr<mesh::Mesh> &getMeshP() const { return d_mesh_p; };
65
70 std::shared_ptr<geom::GeomObject> &getGeomP() { return d_geom_p; };
71
73 const std::shared_ptr<geom::GeomObject> &getGeomP() const { return d_geom_p; };
74
79 mesh::Mesh &getMesh() { return *d_mesh_p; };
80
82 const mesh::Mesh &getMesh() const { return *d_mesh_p; };
83
88 size_t getDimension() const {
89 return d_mesh_p->getDimension();
90 };
91
96 size_t getNumNodes() const {
97 return d_mesh_p->getNumNodes();
98 };
99
105 util::Point getNode(const size_t &i) const {
106 return d_mesh_p->getNode(i);
107 };
108
114 double getNodalVolume(const size_t &i) const {
115 return d_mesh_p->getNodalVolume(i);
116 };
117
122 size_t getCenterNodeId() const { return d_centerNode; };
123
128 double getParticleRadius() const { return d_pRadius; };
129
139 std::string printStr(int nt = 0, int lvl = 0) const;
140
147 void print(int nt = 0, int lvl = 0) const { std::cout << printStr(nt, lvl); }
148
149public:
151 size_t d_id;
152
154 std::shared_ptr<data::ModelData> d_modelData_p;
155
157 std::shared_ptr<mesh::Mesh> d_mesh_p;
158
161
163 std::shared_ptr<geom::GeomObject> d_geom_p;
164
166 double d_pRadius;
167
169 std::vector<size_t> d_bNodes;
170
175 std::vector<uint8_t> d_intFlags;
176};
177
178} // namespace particle
179
180#endif // PARTILCE_REFPARTILCE_H
A class for mesh data.
Definition mesh.h:53
A class to store reference particle related data. Consider a case of multiple hexagon-shaped particle...
Definition refParticle.h:38
std::shared_ptr< mesh::Mesh > & getMeshP()
Get pointer to mesh object.
Definition refParticle.h:61
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< geom::GeomObject > & getGeomP()
Get pointer to geometry object.
Definition refParticle.h:70
size_t getDimension() const
Get the dimension of the domain.
Definition refParticle.h:88
const mesh::Mesh & getMesh() const
Get reference to mesh object.
Definition refParticle.h:82
size_t d_centerNode
Id of mesh node closest to the particle center.
mesh::Mesh & getMesh()
Get reference to mesh object.
Definition refParticle.h:79
double getNodalVolume(const size_t &i) const
Get nodal volume.
std::shared_ptr< geom::GeomObject > d_geom_p
Geometrical object defining this particle.
std::shared_ptr< data::ModelData > d_modelData_p
Reference to model class.
double d_pRadius
Particle radius.
size_t getNumNodes() const
Get the number of nodes.
Definition refParticle.h:96
std::vector< size_t > d_bNodes
List of nodes near boundary.
void print(int nt=0, int lvl=0) const
Prints the information about the object.
const std::shared_ptr< geom::GeomObject > & getGeomP() const
Get pointer to geometry object.
Definition refParticle.h:73
const std::shared_ptr< mesh::Mesh > & getMeshP() const
Get pointer to mesh object.
Definition refParticle.h:64
double getParticleRadius() const
Get radius of reference particle.
std::shared_ptr< mesh::Mesh > d_mesh_p
Pointer to mesh on reference particle.
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 finite element and mesh.
Definition mesh.cpp:29
Collection of methods and data related to particle object.
Definition modelData.h:36
A structure to represent 3d vectors.
Definition point.h:30