v0.15.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
BCs_RVELagrange_Disp::OpDmatRhs Struct Reference

#include "users_modules/mofem_um_homogenisation/src/BCs_RVELagrange_Disp.hpp"

Inheritance diagram for BCs_RVELagrange_Disp::OpDmatRhs:
[legend]
Collaboration diagram for BCs_RVELagrange_Disp::OpDmatRhs:
[legend]

Public Member Functions

 OpDmatRhs (const string field_name, const string lagrang_field_name, RVEBC_Data &data, bool ho_geometry=false)
 
PetscErrorCode calculateDmat (int side, EntityType type, DataForcesAndSurcesCore::EntData &data)
 

Public Attributes

RVEBC_DatadAta
 
bool hoGeometry
 
VectorDouble f
 
VectorDouble applied_strain
 
MatrixDouble X_mat
 
MatrixDouble N_mat
 
MatrixDouble D_mat
 
int rank
 
int nb_row_dofs
 

Detailed Description

Definition at line 212 of file BCs_RVELagrange_Disp.hpp.

Constructor & Destructor Documentation

◆ OpDmatRhs()

BCs_RVELagrange_Disp::OpDmatRhs::OpDmatRhs ( const string  field_name,
const string  lagrang_field_name,
RVEBC_Data data,
bool  ho_geometry = false 
)
inline

Definition at line 217 of file BCs_RVELagrange_Disp.hpp.

220 :
221 FaceElementForcesAndSourcesCore::UserDataOperator(
222 lagrang_field_name,UserDataOperator::OPROW
223 ),
224 dAta(data),hoGeometry(ho_geometry) {
225 }
@ OPROW
operator doWork function is executed on FE rows

Member Function Documentation

◆ calculateDmat()

PetscErrorCode BCs_RVELagrange_Disp::OpDmatRhs::calculateDmat ( int  side,
EntityType  type,
DataForcesAndSurcesCore::EntData &  data 
)
inline

Definition at line 232 of file BCs_RVELagrange_Disp.hpp.

232 {
233 PetscFunctionBegin;
234
235 double x,y,z;
236 for(unsigned int gg = 0;gg<data.getN().size1();gg++) {
237
238 double area;
239 if(hoGeometry) {
240 area = norm_2(getNormalsAtGaussPt(gg))*0.5;
241 } else {
242 area = getArea();
243 }
244 double val = getGaussPts()(2,gg)*area;
245
246 x = getHoCoordsAtGaussPts()(gg,0);
247 y = getHoCoordsAtGaussPts()(gg,1);
248 z = getHoCoordsAtGaussPts()(gg,2);
249
250 switch(rank) {
251 case 3: //mech problem
252 X_mat.resize(3,6,false);
253 X_mat.clear();
254 X_mat(0,0) = 2.0*x; X_mat(0,3)=y; X_mat(0,5)=z;
255 X_mat(1,1) = 2.0*y; X_mat(1,3)=x; X_mat(1,4)=z;
256 X_mat(2,2) = 2.0*z; X_mat(2,4)=y; X_mat(2,5)=x;
257 X_mat = 0.5*X_mat;
258 break;
259 case 1: //moisture transport or thermal problem
260 X_mat.resize(3,3,false);
261 X_mat.clear();
262 X_mat(0,0)= x; X_mat(0,1)= y; X_mat(0,2) = z;
263 break;
264 default:
265 SETERRQ(PETSC_COMM_SELF,1,"not implemented");
266 }
267
268 int shape_size = data.getN().size2();
269 N_mat.resize(rank,shape_size*rank);
270 N_mat.clear();
271
272 // FIXME: this is inefficient implementation
273 {
274 int kk=0;
275 for(int ii=0; ii<shape_size; ii++){
276 //number of shape functions
277 double val = data.getN()(gg,ii);
278 for(int jj=0; jj<rank; jj++) {
279 N_mat(jj,kk) = val;
280 kk++;
281 }
282 }
283 if(gg==0) {
284 D_mat = val*prod(trans(N_mat),X_mat);
285 } else{
286 D_mat += val*prod(trans(N_mat),X_mat);
287 }
288 }
289
290 }
291
292 PetscFunctionReturn(0);
293 }

Member Data Documentation

◆ applied_strain

VectorDouble BCs_RVELagrange_Disp::OpDmatRhs::applied_strain

Definition at line 227 of file BCs_RVELagrange_Disp.hpp.

◆ D_mat

MatrixDouble BCs_RVELagrange_Disp::OpDmatRhs::D_mat

Definition at line 228 of file BCs_RVELagrange_Disp.hpp.

◆ dAta

RVEBC_Data& BCs_RVELagrange_Disp::OpDmatRhs::dAta

Definition at line 214 of file BCs_RVELagrange_Disp.hpp.

◆ f

VectorDouble BCs_RVELagrange_Disp::OpDmatRhs::f

Definition at line 227 of file BCs_RVELagrange_Disp.hpp.

◆ hoGeometry

bool BCs_RVELagrange_Disp::OpDmatRhs::hoGeometry

Definition at line 215 of file BCs_RVELagrange_Disp.hpp.

◆ N_mat

MatrixDouble BCs_RVELagrange_Disp::OpDmatRhs::N_mat

Definition at line 228 of file BCs_RVELagrange_Disp.hpp.

◆ nb_row_dofs

int BCs_RVELagrange_Disp::OpDmatRhs::nb_row_dofs

Definition at line 230 of file BCs_RVELagrange_Disp.hpp.

◆ rank

int BCs_RVELagrange_Disp::OpDmatRhs::rank

Definition at line 230 of file BCs_RVELagrange_Disp.hpp.

◆ X_mat

MatrixDouble BCs_RVELagrange_Disp::OpDmatRhs::X_mat

Definition at line 228 of file BCs_RVELagrange_Disp.hpp.


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