dynLattice
Loading...
Searching...
No Matches
Line3D.h
Go to the documentation of this file.
1
7#pragma once
8
9#include "utils/helpers.h"
10#include <jem/util/Properties.h>
11#include <jive/Array.h>
12#include <jive/geom/ParametricLine.h>
13#include <jive/geom/Shape.h>
14#include <jive/geom/StdShape.h>
15
16using jem::idx_t;
17using jem::String;
18using jem::util::Properties;
19using jive::Cubix;
20using jive::Matrix;
21using jive::Vector;
22using jive::geom::ParametricLine;
23using jive::geom::Shape;
25
41class Line3D : public Shape
42{
43public:
44 static const String PROP_NODES;
45 static const String PROP_INT;
46 static const String PROP_LOCAL;
47 static const idx_t GLOB_RANK;
48
57 explicit Line3D(const String &name,
58 const Properties &conf,
59 const Properties &props);
60
65 inline idx_t globalRank() const override;
66 inline idx_t localRank() const override;
67 inline idx_t nodeCount() const override;
68 inline idx_t vertexCount() const override;
69 inline idx_t ipointCount() const override;
70 inline idx_t shapeFuncCount() const override;
71
72 inline Matrix getVertexCoords() const override;
73 inline Matrix getIntegrationScheme() const override;
74
75 inline bool containsLocalPoint(const Vector &u) const override;
76
83 void getIntegrationWeights(const Vector &w,
84 const Matrix &c) const override;
85
86 inline Matrix getVertexFunctions() const override;
87
88 inline Matrix getShapeFunctions() const override;
89
97 void getGlobalPoint(const Vector &x,
98 const Vector &u,
99 const Matrix &c) const override;
100
107 void getShapeGradients(const Matrix &g,
108 const Vector &w,
109 const Matrix &c) const;
110
116 void getRotations(const Cubix &Ri,
117 const Cubix &Rn) const;
118
127 void getXi(const Quadix &Xi,
128 const Vector &w,
129 const Matrix &u,
130 const Matrix &c) const;
131
139 void getPsi(const Quadix &Psi,
140 const Vector &w,
141 const Matrix &c) const;
149 void getPi(const Cubix &Pi,
150 const Cubix &Ri,
151 const Cubix &Rn) const;
152
159 void getPi(const Cubix &Pi,
160 const Cubix &Rn) const;
161
170 void getRotationGradients(const Cubix &LambdaP,
171 const Vector &w,
172 const Matrix &c,
173 const Cubix &nodeLambda) const;
174
184 void getRotationGradients(const Cubix &LambdaP,
185 const Vector &w,
186 const Cubix &Rn,
187 const Matrix &c,
188 const Matrix &theta) const;
189
190 //------------------------------------------------
191 // local location functions
192 //------------------------------------------------
198 inline void evalShapeFunctions(const Vector &h,
199 const Vector &u) const override;
200
207 inline void evalShapeGradients(const Vector &h,
208 const Vector &g,
209 const Vector &u) const;
210
218 inline void evalShapeGradGrads(const Vector &h,
219 const Vector &g,
220 const Vector &gg,
221 const Vector &u) const;
222
223private:
230 void getRefRot_(const Matrix Lambda_r,
231 const Cubix Rn) const;
232
240 void getNodeRotVecs_(const Matrix psi,
241 const Matrix Lambda_r,
242 const Cubix Rn) const;
243
244protected:
245 jem::Ref<ParametricLine> intLine_;
246};
247
248//=====================================================================
249// inline implementations
250//=====================================================================
252{
253 return GLOB_RANK;
254}
255
256idx_t Line3D::localRank() const
257{
258 return intLine_->localRank();
259}
260
261idx_t Line3D::nodeCount() const
262{
263 return intLine_->nodeCount();
264}
265
267{
268 return intLine_->vertexCount();
269}
270
272{
273 return intLine_->ipointCount();
274}
275
277{
278 return intLine_->shapeFuncCount();
279}
280
282{
283 return intLine_->getVertexCoords();
284}
285
287{
288 return intLine_->getIntegrationScheme();
289}
290
291bool Line3D::containsLocalPoint(const Vector &u) const
292{
293 return intLine_->containsLocalPoint(u);
294}
295
297{
298 return intLine_->getVertexFunctions();
299}
300
301void Line3D::evalShapeFunctions(const Vector &h,
302 const Vector &u) const
303{
304 JEM_ASSERT2(u.size() == localRank(), "internal coordinates do not match the rank");
305 intLine_->evalShapeFunctions(h, u);
306}
307
308void Line3D::evalShapeGradients(const Vector &h,
309 const Vector &g,
310 const Vector &u) const
311{
312 JEM_ASSERT2(u.size() == localRank(), "internal coordinates do not match the rank");
313 Matrix g_dummy(1, g.size());
314 intLine_->getSShape()->evalShapeGradients(h, g_dummy, u);
315 g = g_dummy(0, ALL);
316}
317
318void Line3D::evalShapeGradGrads(const Vector &h,
319 const Vector &g,
320 const Vector &gg,
321 const Vector &u) const
322{
323 JEM_ASSERT2(u.size() == localRank(), "internal coordinates do not match the rank");
324 Matrix g_dummy(1, g.size());
325 Matrix gg_dummy(1, gg.size());
326 intLine_->getSShape()->evalShapeGradGrads(h, g_dummy, gg_dummy, u);
327 g = g_dummy(0, ALL);
328 gg = gg_dummy(0, ALL);
329}
330
332{
333 return intLine_->getShapeFunctions();
334}
Shape function for 1D line elements in 3D space.
Definition Line3D.h:42
idx_t shapeFuncCount() const override
Definition Line3D.h:276
idx_t globalRank() const override
Get the global rank (spatial dimension).
Definition Line3D.h:251
Matrix getVertexCoords() const override
Definition Line3D.h:281
void getPi(const Cubix &Pi, const Cubix &Ri, const Cubix &Rn) const
Get the Pi at the integration points.
Definition Line3D.cpp:202
void evalShapeFunctions(const Vector &h, const Vector &u) const override
Evaluate shape functions at given local coordinates.
Definition Line3D.h:301
void getXi(const Quadix &Xi, const Vector &w, const Matrix &u, const Matrix &c) const
Get the Xi at the integration points.
Definition Line3D.cpp:141
void getRotationGradients(const Cubix &LambdaP, const Vector &w, const Matrix &c, const Cubix &nodeLambda) const
Get the rotation gradients at the integration points from the rotations (Crisfield/Jelenic)
Definition Line3D.cpp:216
Matrix getVertexFunctions() const override
Definition Line3D.h:296
static const String PROP_INT
Property name for integration scheme.
Definition Line3D.h:45
void getRotationGradients(const Cubix &LambdaP, const Vector &w, const Cubix &Rn, const Matrix &c, const Matrix &theta) const
Get the rotation gradients at the integration points from the rotations (Crisfield/Jelenic)
void getShapeGradients(const Matrix &g, const Vector &w, const Matrix &c) const
get the gradients of the shape functions at the integration points
Definition Line3D.cpp:102
static const String PROP_LOCAL
Property name for local coordinates.
Definition Line3D.h:46
bool containsLocalPoint(const Vector &u) const override
Definition Line3D.h:291
idx_t localRank() const override
Definition Line3D.h:256
idx_t nodeCount() const override
Definition Line3D.h:261
Matrix getIntegrationScheme() const override
Definition Line3D.h:286
void getIntegrationWeights(const Vector &w, const Matrix &c) const override
Compute integration weights for numerical integration.
Definition Line3D.cpp:91
void getPsi(const Quadix &Psi, const Vector &w, const Matrix &c) const
Get the Psi at the integration points.
Definition Line3D.cpp:164
Matrix getShapeFunctions() const override
Definition Line3D.h:331
void evalShapeGradients(const Vector &h, const Vector &g, const Vector &u) const
Evaluate shape functions and their gradients at local coordinates.
Definition Line3D.h:308
void getRotations(const Cubix &Ri, const Cubix &Rn) const
return the rotations at the integration points
Definition Line3D.cpp:117
void getGlobalPoint(const Vector &x, const Vector &u, const Matrix &c) const override
Transform local coordinates to global coordinates.
Definition Line3D.cpp:81
static const String PROP_NODES
Property name for number of nodes.
Definition Line3D.h:44
jem::Ref< ParametricLine > intLine_
internal line element for some standard functions
Definition Line3D.h:245
idx_t vertexCount() const override
Definition Line3D.h:266
static const idx_t GLOB_RANK
Global rank (always 3 for 3D space)
Definition Line3D.h:47
idx_t ipointCount() const override
Definition Line3D.h:271
void evalShapeGradGrads(const Vector &h, const Vector &g, const Vector &gg, const Vector &u) const
Evaluate shape functions, gradients, and second derivatives.
Definition Line3D.h:318
file containing some basic helper functions
Array< double, 4 > Quadix
Definition helpers.h:48