v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
PeriodicNitscheConstrains::OpGetFaceData Struct Reference

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

Inheritance diagram for PeriodicNitscheConstrains::OpGetFaceData:
[legend]
Collaboration diagram for PeriodicNitscheConstrains::OpGetFaceData:
[legend]

Public Member Functions

 OpGetFaceData (CommonData &common_data, bool field_disp=true)
 
PetscErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 

Public Attributes

CommonDatacommonData
 
bool fieldDisp
 

Detailed Description

Definition at line 83 of file NitschePeriodicMethod.hpp.

Constructor & Destructor Documentation

◆ OpGetFaceData()

PeriodicNitscheConstrains::OpGetFaceData::OpGetFaceData ( CommonData common_data,
bool  field_disp = true 
)
inline

Definition at line 88 of file NitschePeriodicMethod.hpp.

88 :
89 FaceElementForcesAndSourcesCore::UserDataOperator("DISPLACEMENT",OPROW),
90 commonData(common_data),
91 fieldDisp(field_disp) {
92 }

Member Function Documentation

◆ doWork()

PetscErrorCode PeriodicNitscheConstrains::OpGetFaceData::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData &  data 
)
inline

Definition at line 94 of file NitschePeriodicMethod.hpp.

94 {
95 PetscFunctionBegin;
96
97 if(data.getIndices().size()==0) PetscFunctionReturn(0);
98 try {
99 EntityHandle this_face = getNumeredEntFiniteElementPtr()->getEnt();
100 int nb_gauss_pts_on_this_face = data.getN().size1();
101 for(int ffgg = 0;ffgg<nb_gauss_pts_on_this_face;ffgg++) {
102 int gg = commonData.inTetFaceGaussPtsNumber[this_face][ffgg];
103 CommonData::MultiIndexData gauss_pt_data(gg,side,type);
104 pair<CommonData::Container::iterator,bool> p;
105 p = commonData.facesContainer.insert(gauss_pt_data);
106 if(!p.second) {
107 SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data not inserted");
108 }
109 CommonData::MultiIndexData &p_data = const_cast<CommonData::MultiIndexData&>(*p.first);
110 VectorDouble &shape_fun = p_data.shapeFunctions;
111 int nb_shape_fun = data.getN().size2();
112 shape_fun.resize(nb_shape_fun);
113 cblas_dcopy(nb_shape_fun,&data.getN()(ffgg,0),1,&shape_fun[0],1);
114 p_data.iNdices = data.getIndices();
115 p_data.dofOrders.resize(data.getFieldDofs().size(),false);
116 for(unsigned int dd = 0;dd<data.getFieldDofs().size();dd++) {
117 p_data.dofOrders[dd] = data.getFieldDofs()[dd]->getDofOrder();
118 }
119 int nb_dofs = data.getFieldData().size();
120 if(type == MBVERTEX) {
121 commonData.dIsplacements[gg].resize(3,false);
122 commonData.coordsAtGaussPts[gg].resize(3,false);
123 commonData.hoCoordsAtGaussPts[gg].resize(3,false);
124 for(int rr = 0;rr<3;rr++) {
125 (commonData.dIsplacements[gg])[rr] = cblas_ddot(
126 nb_dofs/3,&data.getFieldData()[rr],3,&data.getN()(ffgg,0),1
127 );
128 if(!fieldDisp) {
129 (commonData.dIsplacements[gg])[rr] -= getCoordsAtGaussPts()(ffgg,rr);
130 }
131 commonData.coordsAtGaussPts[gg][rr] = getCoordsAtGaussPts()(ffgg,rr);
132 commonData.hoCoordsAtGaussPts[gg][rr] = getCoordsAtGaussPts()(ffgg,rr);
133 }
134 } else {
135 for(int rr = 0;rr<3;rr++) {
136 commonData.dIsplacements[gg][rr] += cblas_ddot(
137 nb_dofs/3,&data.getFieldData()[rr],3,&data.getN()(ffgg,0),1
138 );
139 }
140 }
141 }
142 } catch (const std::exception& ex) {
143 ostringstream ss;
144 ss << "throw in method: " << ex.what() << endl;
145 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
146 }
147
148 //cerr << "done\n";
149 PetscFunctionReturn(0);
150 }
static Index< 'p', 3 > p
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
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
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
map< EntityHandle, vector< int > > inTetFaceGaussPtsNumber

Member Data Documentation

◆ commonData

CommonData& PeriodicNitscheConstrains::OpGetFaceData::commonData

Definition at line 85 of file NitschePeriodicMethod.hpp.

◆ fieldDisp

bool PeriodicNitscheConstrains::OpGetFaceData::fieldDisp

Definition at line 86 of file NitschePeriodicMethod.hpp.


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