◆ OpK()
OpK::OpK |
( |
bool |
symm = true | ) |
|
|
inline |
Definition at line 29 of file simple_elasticity.cpp.
30 : VolumeElementForcesAndSourcesCore::UserDataOperator("U", "U", OPROWCOL,
31 symm) {
32
33
34
35
38
39
41
46
48
52
56
63
64 tD(
i,
j,
k,
l) *= coefficient;
65 }
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
FTensor::Ddg< double, 3, 3 > tD
◆ aSsemble()
Assemble local entity block matrix.
- Parameters
-
row_data | row data (consist base functions on row entity) |
col_data | column data (consist base functions on column entity) |
- Returns
- error code
- Examples
- simple_elasticity.cpp.
Definition at line 205 of file simple_elasticity.cpp.
206 {
208
209 const int *row_indices = &*row_data.
getIndices().data().begin();
210
211 const int *col_indices = &*col_data.
getIndices().data().begin();
212 Mat
B = getFEMethod()->ksp_B != PETSC_NULL ? getFEMethod()->ksp_B
213 : getFEMethod()->snes_B;
214
216 &*
K.data().begin(), ADD_VALUES);
217
219
220
223 &*
K.data().begin(), ADD_VALUES);
224 }
226 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
const VectorInt & getIndices() const
Get global indices of dofs on entity.
bool isDiag
true if this block is on diagonal
int nbRows
number of dofs on rows
int nbCols
number if dof on column
◆ doWork()
Do calculations for give operator.
- Parameters
-
row_side | row side number (local number) of entity on element |
col_side | column side number (local number) of entity on element |
row_type | type of row entity MBVERTEX, MBEDGE, MBTRI or MBTET |
col_type | type of column entity MBVERTEX, MBEDGE, MBTRI or MBTET |
row_data | data for row |
col_data | data for column |
- Returns
- error code
- Examples
- simple_elasticity.cpp.
Definition at line 77 of file simple_elasticity.cpp.
80 {
81
83
84
86
89
90
92
95
96
97
98
99
102
103
105
106 if (row_side == col_side && row_type == col_type) {
108 } else {
110 }
111
112
114
115
117
119 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
Integrate B^T D B operator.
int nbIntegrationPts
number of integration points
MoFEMErrorCode aSsemble(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
Assemble local entity block matrix.
◆ iNtegrate()
Integrate B^T D B operator.
- Parameters
-
row_data | row data (consist base functions on row entity) |
col_data | column data (consist base functions on column entity) |
- Returns
- error code
- Examples
- simple_elasticity.cpp.
Definition at line 133 of file simple_elasticity.cpp.
134 {
136
137
138
141 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2),
142 &
m(r + 1,
c + 0), &
m(r + 1,
c + 1), &
m(r + 1,
c + 2),
143 &
m(r + 2,
c + 0), &
m(r + 2,
c + 1), &
m(r + 2,
c + 2));
144 };
145
150
151
152 double vol = getVolume();
153
154
155 auto t_w = getFTensor0IntegrationWeight();
156
157
159
161
162
163 const double a = t_w * vol;
164
165
166 for (
int rr = 0; rr !=
nbRows / 3; ++rr) {
167
168
169 auto t_m = get_tensor2(
K, 3 * rr, 0);
170
171
173
174
175 for (
int cc = 0; cc !=
nbCols / 3; ++cc) {
176
177
179 a * (
tD(
i,
j,
k,
l) * (t_row_diff_base(
j) * t_col_diff_base(
l)));
180
181
182 ++t_col_diff_base;
183
184
185 ++t_m;
186 }
187
188
189 ++t_row_diff_base;
190 }
191
192
193 ++t_w;
194 }
195
197 }
FTensor::Index< 'm', SPACE_DIM > m
const double c
speed of light (cm/ns)
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
◆ isDiag
◆ nbCols
◆ nbIntegrationPts
int OpK::nbIntegrationPts |
|
protected |
◆ nbRows
◆ pOisson
◆ tD
◆ yOung
The documentation for this struct was generated from the following file: