-
Notifications
You must be signed in to change notification settings - Fork 3
/
ElasticState.h
248 lines (196 loc) · 5.82 KB
/
ElasticState.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
// Copyright (c) 2019 Patrick Diehl
//
// Distributed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
// (See accompanying file LICENSE.txt)
#ifndef MATERIAL_PD_ELASTIC_STATEMATERIAL_H
#define MATERIAL_PD_ELASTIC_STATEMATERIAL_H
#include "baseMaterial.h"
#include "util/point.h"
#include "util/matrixBlaze.h"
#include "geometry/neighbor.h"
#include "fe/mesh.h"
#include "geometry/volumeCorrection.h"
#include <vector>
#include <hpx/include/parallel_algorithm.hpp>
// forward declaration
namespace inp {
struct MaterialDeck;
struct OutputDeck;
}
// forward declaration
namespace data {
class DataManager;
}
// forward declaration of class
namespace fe {
class Mesh;
} // namespace fe
namespace geometry {
class VolumeCorrection;
} // namespace geometry
namespace util {
class StateBasedHelperFunctions;
} // namespace material
namespace material {
namespace pd {
/*! @brief A class implementing the state-based elastic material model
*
* This class implements the the state-based elastic material model
* as described by [Silling](https://doi.org/10.1007/s10659-007-9125-1)
* and implementation details are described by [Littlewood](https://www.sandia.gov/~djlittl/docs/PeridynamicSoftwareRoadmap.pdf).
*
* @see https://doi.org/10.1007/s10659-007-9125-1
*/
class ElasticState : public BaseMaterial {
public:
/*!
* @brief Constructor
* @param deck Pointer to the input deck
* @param DataManager Pointer to the data manager object
*/
ElasticState(inp::MaterialDeck *deck, data::DataManager *dataManager);
/*!
* @brief Returns energy and force state between node i and node j
* @param i Id of node i
* @param j Local id in the neighbor list of node i
* @return Value Pair of energy and force
*/
std::pair<util::Point3, double> getBondEF(size_t i, size_t j);
/*!
* @brief Returns critical bond strain between node i and node j
*
* @param i Id of node i
* @param j Id of node j
* @return Value Critical strain
*/
double getSc(size_t i, size_t j);
/*!
* @brief Computes the stress tensor for one node
* @param i Id of node i
* @return The stress tensor for node i
*/
util::Matrix33 getStress(size_t i);
/*!
* @brief Computes the strain vector for one node
* @param i ID of node i
* @return The strain tensor for node I
*/
util::Matrix33 getStrain(size_t i);
/*!
* @brief return the factor for two-dimensional problems
*/
double getFactor2D();
void update();
/*!
* @brief Get direction of bond force
* @return vector Unit vector along the bond force
*/
util::Point3
getBondForceDirection(const util::Point3 &dx,
const util::Point3 &du) const override {
return dx / dx.length();
}
/*!
* @brief Returns the value of influence function
*
* @param r Reference (initial) bond length
* @return value Influence function at r
*/
double getInfFn(const double &r) const {return 1.; };
private:
/*!
* @brief Computes elastic state-based material parameters from elastic constants
*
* Either Young's modulus E or bulk modulus K, and Poisson ratio \f$ \nu \f$,
* are needed.
*
* @param deck Input material deck
* @param M Moment of influence function
*/
void computeParameters(inp::MaterialDeck *deck, size_t dim);
/**
* @name Helper functions to compute the stress and strain
*/
/**@{*/
/*!
* @brief Computes the deformation gradient for node i
* @param i Id of node
* @return The deformation gradient for node i
*
*/
util::Matrix33 deformation_gradient(size_t i);
/*!
* @brief Computes the x vector state between node i and node j
* @param i Id of node
* @param j Id of node
* @return The x vector state
*
*/
util::Point3 X_vector_state(size_t i, size_t j);
/*!
* @brief Computes the y vector state between node i and node j
* @param i Id of node
* @param j Id of node
* @return The y vector state
*
*/
util::Point3 Y_vector_state(size_t i, size_t j);
/*!
* @brief Computes the K shape tensor for node i
* @param i Id of node
* @return The K shape tensor for node i
*
*/
util::Matrix33 K_shape_tensor(size_t i);
/*!
* @brief Computes the K modulus tensor
* @param i Node i
* @param j Neighbor j
* @param k Neighbor k
* @param m Index for the volume correction
* @return The K modulus tensor
*
*/
util::Matrix33 K_modulus_tensor(size_t i, size_t j, size_t k, size_t m);
/*!
* @brief Provide the image of x under the Dirac Delta Function
* @param deck The input deck
* @param problem The corresponding problem
* @param x Node x
* @param i Node i
* @param j Neighbor j
* @param k Neighbor k
* @param m Index for the volume correction
* @return 1 if x is a null-vector, otherwise 0
*/
double dirac_delta(util::Point3 x, size_t i, size_t j, size_t m);
/*@}*/
/*! @brief Correction factor for using plain stress */
double d_factor2D;
/*! @brief Dimension of the problem */
size_t dim;
double horizon;
/*! @brief Compute strain energy */
bool strainEnergy;
/**
* @name Pointers for the function parameters
*/
/**@{*/
/*! @brief Pointer to the material deck */
const inp::MaterialDeck *d_deck;
/*! @brief Pointer to the nodes */
//const std::vector<util::Point3> *d_nodes;
/*! @brief Pointer to the weighted volumes of the nodes */
//const std::vector<double> *d_weightedVolume;
/*! @brief Pointer to the volume correction of the nodes */
//const std::vector<std::vector<double>> *d_volumeCorrection;
/*! @brief Pointer to the volumes of the nodes */
//const std::vector<double> * d_volumes;
/*! @brief Pointer to the neighbors of the nodes */
//geometry::Neighbor *d_neighbors;
data::DataManager *d_dataManager_p;
/*@}*/
};
} // namespace pd
} // namespace material
#endif // MATERIAL_PD_ELASTIC_STATEMATERIAL_H