v0.14.0
Public Member Functions | Public Attributes | List of all members
BCs_RVELagrange_Trac::CommonFunctions Struct Reference

#include <users_modules/homogenisation/src/BCs_RVELagrange_Trac.hpp>

Collaboration diagram for BCs_RVELagrange_Trac::CommonFunctions:
[legend]

Public Member Functions

PetscErrorCode shapeMat (int rank, unsigned int gg, DataForcesAndSourcesCore::EntData &col_data, MatrixDouble &n)
 
PetscErrorCode hMat (VectorDouble face_normal, int rank, MatrixDouble &n_mat, MatrixDouble &h_mat)
 

Public Attributes

MatrixDouble H_mat_1Node
 

Detailed Description

Definition at line 31 of file BCs_RVELagrange_Trac.hpp.

Member Function Documentation

◆ hMat()

PetscErrorCode BCs_RVELagrange_Trac::CommonFunctions::hMat ( VectorDouble  face_normal,
int  rank,
MatrixDouble &  n_mat,
MatrixDouble &  h_mat 
)
inline

Definition at line 58 of file BCs_RVELagrange_Trac.hpp.

63  {
64  PetscFunctionBegin;
65 
66  switch(rank) {
67  //Mechanical problem
68  case 3: {
69  H_mat_1Node.resize(6,3);
70  H_mat_1Node.clear(); //for one node
71  if(face_normal[0]>0) { //+X face of the RVE
72  H_mat_1Node(0,0) = 1.0;
73  H_mat_1Node(3,1) = 1.0;
74  H_mat_1Node(5,2) = 1.0;
75  } else if(face_normal[0]<0) { //-X face of the RVE
76  H_mat_1Node(0,0) = -1.0;
77  H_mat_1Node(3,1) = -1.0;
78  H_mat_1Node(5,2) = -1.0;
79  } else if(face_normal[1]>0) { //+Y face of the RVE
80  H_mat_1Node(1,1) = 1.0;
81  H_mat_1Node(3,0) = 1.0;
82  H_mat_1Node(4,2) = 1.0;
83  } else if(face_normal[1]<0) { //-Y face of the RVE
84  H_mat_1Node(1,1) = -1.0;
85  H_mat_1Node(3,0) = -1.0;
86  H_mat_1Node(4,2) = -1.0;
87  } else if(face_normal[2]>0) { //+Z face of the RVE
88  H_mat_1Node(2,2) = 1.0;
89  H_mat_1Node(4,1) = 1.0;
90  H_mat_1Node(5,0) = 1.0;
91  } else if(face_normal[2]<0) { //-Z face of the RVE
92  H_mat_1Node(2,2) = -1.0;
93  H_mat_1Node(4,1) = -1.0;
94  H_mat_1Node(5,0) = -1.0;
95  } else {
96  SETERRQ(PETSC_COMM_SELF,MOFEM_IMPOSIBLE_CASE,"Can not be ?!");
97  }
98 
99  int num_col = n_mat.size2();
100  h_mat.resize(6,num_col);
101 
102  int cc1 = 0;
103  for(int bb = 0; bb<num_col/3; bb++) {
104  //blocks of 6x3
105  for(int rr = 0; rr<6; rr++) {
106  for(int cc = 0; cc<3; cc++) {
107  h_mat(rr,(cc+cc1)) = H_mat_1Node(rr,cc);
108  }
109  }
110  cc1+=3;
111  }
112 
113  }
114  break;
115  case 1: //Moisture transport or thermal problem
116  {
117  H_mat_1Node.resize(3,1);
118  H_mat_1Node.clear();
119  if(face_normal[0]>0) { //+X face of the RVE
120  H_mat_1Node(0,0) = 1.0;
121  }
122  if(face_normal[0]<0) { //-X face of the RVE
123  H_mat_1Node(0,0) = -1.0;
124  }
125  if(face_normal[1]>0) { //+Y face of the RVE
126  H_mat_1Node(1,0) = 1.0;
127  }
128  if(face_normal[1]<0) { //-Y face of the RVE
129  H_mat_1Node(1,0) = -1.0;
130  }
131  if(face_normal[2]>0) { //+Z face of the RVE
132  H_mat_1Node(2,0) = 1.0;
133  }
134  if(face_normal[2]<0) { //-Z face of the RVE
135  H_mat_1Node(2,0) = -1.0;
136  }
137 
138  int num_col = n_mat.size2();
139  h_mat.resize(3,num_col);
140 
141  int cc1 = 0;
142  for(int bb = 0; bb<num_col; bb++) {
143  //blocks of 3x1
144  for(int rr = 0; rr<3; rr++) {
145  for(int cc = 0; cc<1; cc++) {
146  h_mat(rr,(cc+cc1))=H_mat_1Node(rr,cc);
147  }
148  }
149  cc1+=1;
150  }
151 
152  }
153  break;
154  default:
155  SETERRQ(PETSC_COMM_SELF,MOFEM_NOT_IMPLEMENTED,"not implemented");
156  }
157  PetscFunctionReturn(0);
158  }

◆ shapeMat()

PetscErrorCode BCs_RVELagrange_Trac::CommonFunctions::shapeMat ( int  rank,
unsigned int  gg,
DataForcesAndSourcesCore::EntData col_data,
MatrixDouble &  n 
)
inline

Definition at line 33 of file BCs_RVELagrange_Trac.hpp.

35  {
36  PetscFunctionBegin;
37 
38  int shape_size = col_data.getN().size2();
39 
40  n.resize(rank,shape_size*rank);
41  n.clear();
42 
43  int kk = 0;
44  for(int ii=0; ii<shape_size; ii++){
45  double val = col_data.getN()(gg,ii);
46  for(int jj=0; jj<rank; jj++){
47  n(jj,kk) = val;
48  kk++;
49  }
50  }
51 
52  PetscFunctionReturn(0);
53  }

Member Data Documentation

◆ H_mat_1Node

MatrixDouble BCs_RVELagrange_Trac::CommonFunctions::H_mat_1Node

Definition at line 56 of file BCs_RVELagrange_Trac.hpp.


The documentation for this struct was generated from the following file:
convert.n
n
Definition: convert.py:82
BCs_RVELagrange_Trac::CommonFunctions::H_mat_1Node
MatrixDouble H_mat_1Node
Definition: BCs_RVELagrange_Trac.hpp:56
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32