PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
fe::B Class Reference

#include <bMatrix.h>

Collaboration diagram for fe::B:

Public Member Functions

 B (const std::vector< std::vector< double > > &dNdx, int dim)
 
int nStrain () const
 
int nDof () const
 
int dim () const
 
double operator() (int i, int j) const
 

Private Attributes

int d_dim
 
int d_nStrain
 
int d_nDof
 
std::vector< double > d_data
 

Detailed Description

Strain-displacement matrix B at a quadrature point, from physical dN/dx. Voigt rows: 2D [εxx, εyy, εxy], 3D [εxx, εyy, εzz, εyz, εxz, εxy] (tensor shear, not engineering γ). Columns are nodal u packed [u1x, u1y, (u1z,) u2x, ...]. Does not take displacements; ε = B u is applied by the caller.

Definition at line 25 of file bMatrix.h.

Constructor & Destructor Documentation

◆ B()

fe::B::B ( const std::vector< std::vector< double > > &  dNdx,
int  dim 
)

Definition at line 13 of file bMatrix.cpp.

14 : d_dim(dim), d_nStrain(dim == 2 ? 3 : (dim == 3 ? 6 : 1)),
15 d_nDof(dim * static_cast<int>(dNdx.size())),
16 d_data(static_cast<size_t>(d_nStrain * d_nDof), 0.) {
17 const int n = static_cast<int>(dNdx.size());
18 for (int a = 0; a < n; a++) {
19 const auto &dN = dNdx[a];
20 const int c = dim * a;
21 auto set = [&](int i, int j, double v) { d_data[i * d_nDof + j] = v; };
22
23 set(0, c, dN[0]);
24 if (dim == 1)
25 continue;
26 set(1, c + 1, dN[1]);
27 if (dim == 2) {
28 set(2, c, 0.5 * dN[1]);
29 set(2, c + 1, 0.5 * dN[0]);
30 continue;
31 }
32 set(2, c + 2, dN[2]);
33 set(3, c + 1, 0.5 * dN[2]);
34 set(3, c + 2, 0.5 * dN[1]);
35 set(4, c, 0.5 * dN[2]);
36 set(4, c + 2, 0.5 * dN[0]);
37 set(5, c, 0.5 * dN[1]);
38 set(5, c + 1, 0.5 * dN[0]);
39 }
40}
int d_nDof
Definition bMatrix.h:40
int dim() const
Definition bMatrix.h:31
int d_nStrain
Definition bMatrix.h:39
int d_dim
Definition bMatrix.h:38
std::vector< double > d_data
Definition bMatrix.h:41

References d_data, d_nDof, and dim().

Here is the call graph for this function:

Member Function Documentation

◆ dim()

int fe::B::dim ( ) const
inline

Definition at line 31 of file bMatrix.h.

31{ return d_dim; }

References d_dim.

Referenced by B(), anonymous_namespace{meshUtil.cpp}::strainFromB(), and anonymous_namespace{testFeLib.cpp}::strainFromB().

Here is the caller graph for this function:

◆ nDof()

int fe::B::nDof ( ) const
inline

Definition at line 30 of file bMatrix.h.

30{ return d_nDof; }

References d_nDof.

Referenced by anonymous_namespace{meshUtil.cpp}::strainFromB(), and anonymous_namespace{testFeLib.cpp}::strainFromB().

Here is the caller graph for this function:

◆ nStrain()

int fe::B::nStrain ( ) const
inline

Definition at line 29 of file bMatrix.h.

29{ return d_nStrain; }

References d_nStrain.

Referenced by anonymous_namespace{meshUtil.cpp}::strainFromB(), and anonymous_namespace{testFeLib.cpp}::strainFromB().

Here is the caller graph for this function:

◆ operator()()

double fe::B::operator() ( int  i,
int  j 
) const
inline

Definition at line 33 of file bMatrix.h.

33 {
34 return d_data[i * d_nDof + j];
35 }

References d_data, and d_nDof.

Field Documentation

◆ d_data

std::vector<double> fe::B::d_data
private

Definition at line 41 of file bMatrix.h.

Referenced by B(), and operator()().

◆ d_dim

int fe::B::d_dim
private

Definition at line 38 of file bMatrix.h.

Referenced by dim().

◆ d_nDof

int fe::B::d_nDof
private

Definition at line 40 of file bMatrix.h.

Referenced by B(), nDof(), and operator()().

◆ d_nStrain

int fe::B::d_nStrain
private

Definition at line 39 of file bMatrix.h.

Referenced by nStrain().


The documentation for this class was generated from the following files: