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

#include <users_modules/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, DataForcesAndSourcesCore::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 218 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 223 of file BCs_RVELagrange_Disp.hpp.

226 :
227 FaceElementForcesAndSourcesCore::UserDataOperator(
228 lagrang_field_name,UserDataOperator::OPROW
229 ),
230 dAta(data),hoGeometry(ho_geometry) {
231 }

Member Function Documentation

◆ calculateDmat()

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

Definition at line 238 of file BCs_RVELagrange_Disp.hpp.

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

Member Data Documentation

◆ applied_strain

VectorDouble BCs_RVELagrange_Disp::OpDmatRhs::applied_strain

Definition at line 233 of file BCs_RVELagrange_Disp.hpp.

◆ D_mat

MatrixDouble BCs_RVELagrange_Disp::OpDmatRhs::D_mat

Definition at line 234 of file BCs_RVELagrange_Disp.hpp.

◆ dAta

RVEBC_Data& BCs_RVELagrange_Disp::OpDmatRhs::dAta

Definition at line 220 of file BCs_RVELagrange_Disp.hpp.

◆ f

VectorDouble BCs_RVELagrange_Disp::OpDmatRhs::f

Definition at line 233 of file BCs_RVELagrange_Disp.hpp.

◆ hoGeometry

bool BCs_RVELagrange_Disp::OpDmatRhs::hoGeometry

Definition at line 221 of file BCs_RVELagrange_Disp.hpp.

◆ N_mat

MatrixDouble BCs_RVELagrange_Disp::OpDmatRhs::N_mat

Definition at line 234 of file BCs_RVELagrange_Disp.hpp.

◆ nb_row_dofs

int BCs_RVELagrange_Disp::OpDmatRhs::nb_row_dofs

Definition at line 236 of file BCs_RVELagrange_Disp.hpp.

◆ rank

int BCs_RVELagrange_Disp::OpDmatRhs::rank

Definition at line 236 of file BCs_RVELagrange_Disp.hpp.

◆ X_mat

MatrixDouble BCs_RVELagrange_Disp::OpDmatRhs::X_mat

Definition at line 234 of file BCs_RVELagrange_Disp.hpp.


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