v0.13.1
Public Member Functions | List of all members
SmallStrainPlasticity::MakeB Struct Reference

#include <users_modules/small_strain_plasticity/src/SmallStrainPlasticity.hpp>

Inheritance diagram for SmallStrainPlasticity::MakeB:
[legend]

Public Member Functions

PetscErrorCode makeB (const MatrixAdaptor &diffN, MatrixDouble &B)
 
PetscErrorCode addVolumetricB (const MatrixAdaptor &diffN, MatrixDouble &volB, double alpha)
 

Detailed Description

Definition at line 433 of file SmallStrainPlasticity.hpp.

Member Function Documentation

◆ addVolumetricB()

PetscErrorCode SmallStrainPlasticity::MakeB::addVolumetricB ( const MatrixAdaptor diffN,
MatrixDouble &  volB,
double  alpha 
)
Examples
SmallStrainPlasticity.hpp.

Definition at line 200 of file SmallStrainPlasticity.cpp.

202 {
203 PetscFunctionBegin;
204 int nb_dofs = diffN.size1();
205 for(int dd = 0;dd<nb_dofs;dd++) {
206 const double diff[] = {
207 diffN(dd,0), diffN(dd,1), diffN(dd,2)
208 };
209 const int dd3 = 3*dd;
210 for(int rr1 = 0;rr1<3;rr1++) {
211 for(int rr2 = 0;rr2<3;rr2++) {
212 volB(rr1,dd3+rr2) += alpha*diff[rr2]/3.;
213 }
214 }
215 }
216 PetscFunctionReturn(0);
217}
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33

◆ makeB()

PetscErrorCode SmallStrainPlasticity::MakeB::makeB ( const MatrixAdaptor diffN,
MatrixDouble &  B 
)
Examples
SmallStrainPlasticity.hpp.

Definition at line 172 of file SmallStrainPlasticity.cpp.

172 {
173 PetscFunctionBegin;
174 unsigned int nb_dofs = diffN.size1();
175 if(B.size2()!=3*nb_dofs) {
176 B.resize(6,3*nb_dofs,false);
177 }
178 B.clear();
179 for(int dd = 0;dd<nb_dofs;dd++) {
180 const double diff[] = {
181 diffN(dd,0), diffN(dd,1), diffN(dd,2)
182 };
183 const int dd3 = 3*dd;
184 for(int rr = 0;rr<3;rr++) {
185 B(rr,dd3+rr) = diff[rr];
186 }
187 // gamma_xy
188 B(3,dd3+0) = diff[1];
189 B(3,dd3+1) = diff[0];
190 // gamma_yz
191 B(4,dd3+1) = diff[2];
192 B(4,dd3+2) = diff[1];
193 // gamma_xz
194 B(5,dd3+0) = diff[2];
195 B(5,dd3+2) = diff[0];
196 }
197 PetscFunctionReturn(0);
198}

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