127 {
129
130
132 const auto in_the_loop =
134
135#ifndef NDEBUG
136 const std::array<std::string, 2> ele_type_name = {"BOUNDARY", "SKELETON"};
138 << "OpL2LhsPenalty inTheLoop " << ele_type_name[in_the_loop];
141#endif
142
143
146
147
148 auto t_normal = getFTensor1Normal();
149 t_normal.normalize();
150
151
152 const size_t nb_integration_pts = getGaussPts().size2();
153
154
155
156 const double beta =
static_cast<double>(
nitsche) / (in_the_loop + 1);
157
158
160
161
163
164 if (nb_rows) {
165
166
167 const auto sense_row =
senseMap[s0];
168
169
172
173
174 const auto sense_col =
senseMap[s1];
175
176
177
179
180
181 locMat.resize(nb_rows, nb_cols,
false);
183
184
187 auto t_w = getFTensor0IntegrationWeight();
188
189
190 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
191
192
193
194 const double alpha = getMeasure() * t_w;
195 auto t_mat =
locMat.data().begin();
196
197
198 size_t rr = 0;
199 for (; rr != nb_rows; ++rr) {
200
201
203 t_vn_plus(
i) = beta * (
phi * t_diff_row_base(
i) / p);
205 t_vn(
i) = t_row_base * t_normal(
i) * sense_row - t_vn_plus(
i);
206
207
209 auto t_diff_col_base =
211
212
213 for (size_t cc = 0; cc != nb_cols; ++cc) {
214
215
217 t_un(
i) = -p * (t_col_base * t_normal(
i) * sense_col -
218 beta * t_diff_col_base(
i) / p);
219
220
221 *t_mat -= alpha * (t_vn(
i) * t_un(
i));
222 *t_mat -= alpha * (t_vn_plus(
i) * (beta * t_diff_col_base(
i)));
223
224
225 ++t_col_base;
226 ++t_diff_col_base;
227 ++t_mat;
228 }
229
230
231 ++t_row_base;
232 ++t_diff_row_base;
233 }
234
235
236
237
238
239 for (; rr < nb_row_base_functions; ++rr) {
240 ++t_row_base;
241 ++t_diff_row_base;
242 }
243
244 ++t_w;
245 }
246
247
252 &*
locMat.data().begin(), ADD_VALUES);
253
254
255 if (!in_the_loop)
257 }
258 }
259 }
260
262 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#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.
#define MOFEM_LOG(channel, severity)
Log.
auto get_ntensor(T &base_mat)
std::array< MatrixDouble, 2 > rowBaseSideMap
std::array< VectorInt, 2 > indicesColSideMap
indices on columns for left hand-side
FTensor::Index< 'i', SPACE_DIM > i
std::array< MatrixDouble, 2 > colDiffBaseSideMap
std::array< double, 2 > areaMap
std::array< MatrixDouble, 2 > colBaseSideMap
std::array< VectorInt, 2 > indicesRowSideMap
indices on rows for left hand-side
std::array< int, 2 > senseMap
auto get_diff_ntensor(T &base_mat)
std::array< MatrixDouble, 2 > rowDiffBaseSideMap
MatrixDouble locMat
local operator matrix