v0.13.2
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MoFEM::OpSchurAssembleEndImpl Struct Reference

Assemble Schur complement (Implementation) More...

#include <src/finite_elements/Schur.hpp>

Inheritance diagram for MoFEM::OpSchurAssembleEndImpl:
[legend]
Collaboration diagram for MoFEM::OpSchurAssembleEndImpl:
[legend]

Public Types

using MatSetValuesRaw = boost::function< MoFEMErrorCode(Mat mat, PetscInt m, const PetscInt idxm[], PetscInt n, const PetscInt idxn[], const PetscScalar v[], InsertMode addv)>
 
- Public Types inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
enum  OpType {
  OPROW = 1 << 0 , OPCOL = 1 << 1 , OPROWCOL = 1 << 2 , OPSPACE = 1 << 3 ,
  OPLAST = 1 << 3
}
 Controls loop over entities on element. More...
 
- Public Types inherited from MoFEM::DataOperator
using DoWorkLhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)>
 
using DoWorkRhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int side, EntityType type, EntitiesFieldData::EntData &data)>
 

Public Member Functions

 OpSchurAssembleEndImpl (std::vector< std::string > fields_name, std::vector< boost::shared_ptr< Range > > field_ents, std::vector< SmartPetscObj< AO > > sequence_of_aos, std::vector< SmartPetscObj< Mat > > sequence_of_mats, std::vector< bool > sym_schur, bool symm_op=true)
 Construct a new Op Schur Assemble End object. More...
 
 OpSchurAssembleEndImpl (std::vector< std::string > fields_name, std::vector< boost::shared_ptr< Range > > field_ents, std::vector< SmartPetscObj< AO > > sequence_of_aos, std::vector< SmartPetscObj< Mat > > sequence_of_mats, std::vector< bool > sym_schur, std::vector< double > diag_eps, bool symm_op=true)
 Construct a new Op Schur Assemble End object. More...
 
- Public Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
 UserDataOperator (const FieldSpace space, const char type=OPSPACE, const bool symm=true)
 
 UserDataOperator (const std::string field_name, const char type, const bool symm=true)
 
 UserDataOperator (const std::string row_field_name, const std::string col_field_name, const char type, const bool symm=true)
 
boost::shared_ptr< const NumeredEntFiniteElementgetNumeredEntFiniteElementPtr () const
 Return raw pointer to NumeredEntFiniteElement. More...
 
EntityHandle getFEEntityHandle () const
 Return finite element entity handle. More...
 
int getFEDim () const
 Get dimension of finite element. More...
 
EntityType getFEType () const
 Get dimension of finite element. More...
 
boost::weak_ptr< SideNumbergetSideNumberPtr (const int side_number, const EntityType type)
 Get the side number pointer. More...
 
EntityHandle getSideEntity (const int side_number, const EntityType type)
 Get the side entity. More...
 
int getNumberOfNodesOnElement () const
 Get the number of nodes on finite element. More...
 
MoFEMErrorCode getProblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get row indices. More...
 
MoFEMErrorCode getProblemColIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get col indices. More...
 
const FEMethodgetFEMethod () const
 Return raw pointer to Finite Element Method object. More...
 
int getOpType () const
 Get operator types. More...
 
void setOpType (const OpType type)
 Set operator type. More...
 
void addOpType (const OpType type)
 Add operator type. More...
 
int getNinTheLoop () const
 get number of finite element in the loop More...
 
int getLoopSize () const
 get size of elements in the loop More...
 
std::string getFEName () const
 Get name of the element. More...
 
ForcesAndSourcesCoregetPtrFE () const
 
ForcesAndSourcesCoregetSidePtrFE () const
 
ForcesAndSourcesCoregetRefinePtrFE () const
 
const PetscData::SwitchesgetDataCtx () const
 
const KspMethod::KSPContext getKSPCtx () const
 
const SnesMethod::SNESContext getSNESCtx () const
 
const TSMethod::TSContext getTSCtx () const
 
Vec getKSPf () const
 
Mat getKSPA () const
 
Mat getKSPB () const
 
Vec getSNESf () const
 
Vec getSNESx () const
 
Mat getSNESA () const
 
Mat getSNESB () const
 
Vec getTSu () const
 
Vec getTSu_t () const
 
Vec getTSu_tt () const
 
Vec getTSf () const
 
Mat getTSA () const
 
Mat getTSB () const
 
int getTSstep () const
 
double getTStime () const
 
double getTStimeStep () const
 
double getTSa () const
 
double getTSaa () const
 
MatrixDoublegetGaussPts ()
 matrix of integration (Gauss) points for Volume Element More...
 
auto getFTensor0IntegrationWeight ()
 Get integration weights. More...
 
MatrixDoublegetCoordsAtGaussPts ()
 Gauss points and weight, matrix (nb. of points x 3) More...
 
auto getFTensor1CoordsAtGaussPts ()
 Get coordinates at integration points assuming linear geometry. More...
 
double getMeasure () const
 get measure of element More...
 
doublegetMeasure ()
 get measure of element More...
 
MoFEMErrorCode loopSide (const string &fe_name, ForcesAndSourcesCore *side_fe, const size_t dim, const EntityHandle ent_for_side=0, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User call this function to loop over elements on the side of face. This function calls finite element with is operator to do calculations. More...
 
MoFEMErrorCode loopThis (const string &fe_name, ForcesAndSourcesCore *parent_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User call this function to loop over parent elements. This function calls finite element with is operator to do calculations. More...
 
MoFEMErrorCode loopParent (const string &fe_name, ForcesAndSourcesCore *parent_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User call this function to loop over parent elements. This function calls finite element with is operator to do calculations. More...
 
MoFEMErrorCode loopChildren (const string &fe_name, ForcesAndSourcesCore *child_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User call this function to loop over parent elements. This function calls finite element with is operator to do calculations. More...
 
- Public Member Functions inherited from MoFEM::DataOperator
 DataOperator (const bool symm=true)
 
virtual ~DataOperator ()=default
 
virtual MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 Operator for bi-linear form, usually to calculate values on left hand side. More...
 
virtual MoFEMErrorCode opLhs (EntitiesFieldData &row_data, EntitiesFieldData &col_data)
 
virtual MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
virtual MoFEMErrorCode opRhs (EntitiesFieldData &data, const bool error_if_no_base=false)
 
bool getSymm () const
 Get if operator uses symmetry of DOFs or not. More...
 
void setSymm ()
 set if operator is executed taking in account symmetry More...
 
void unSetSymm ()
 unset if operator is executed for non symmetric problem More...
 

Public Attributes

MatSetValuesRaw matSetValuesRaw = ::MatSetValues
 
MatSetValuesRaw matSetValuesSchurRaw = ::MatSetValues
 
- Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
char opType
 
std::string rowFieldName
 
std::string colFieldName
 
FieldSpace sPace
 
- Public Attributes inherited from MoFEM::DataOperator
DoWorkLhsHookFunType doWorkLhsHook
 
DoWorkRhsHookFunType doWorkRhsHook
 
bool sYmm
 If true assume that matrix is symmetric structure. More...
 
std::array< bool, MBMAXTYPE > doEntities
 If true operator is executed for entity. More...
 
booldoVertices
 \deprectaed If false skip vertices More...
 
booldoEdges
 \deprectaed If false skip edges More...
 
booldoQuads
 \deprectaed More...
 
booldoTris
 \deprectaed More...
 
booldoTets
 \deprectaed More...
 
booldoPrisms
 \deprectaed More...
 

Protected Member Functions

template<typename I >
MoFEMErrorCode doWorkImpl (int side, EntityType type, EntitiesFieldData::EntData &data)
 
- Protected Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
virtual MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 

Protected Attributes

std::vector< std::string > fieldsName
 
std::vector< boost::shared_ptr< Range > > fieldEnts
 
std::vector< SmartPetscObj< AO > > sequenceOfAOs
 
std::vector< SmartPetscObj< Mat > > sequenceOfMats
 
std::vector< boolsymSchur
 
std::vector< doublediagEps
 
MatrixDouble invMat
 
MatrixDouble invDiagOffMat
 
MatrixDouble offMatInvDiagOffMat
 
MatrixDouble transOffMatInvDiagOffMat
 
- Protected Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoreptrFE
 

Additional Inherited Members

- Static Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
static const char *const OpTypeNames []
 

Detailed Description

Assemble Schur complement (Implementation)

Definition at line 35 of file Schur.hpp.

Member Typedef Documentation

◆ MatSetValuesRaw

using MoFEM::OpSchurAssembleEndImpl::MatSetValuesRaw = boost::function<MoFEMErrorCode( Mat mat, PetscInt m, const PetscInt idxm[], PetscInt n, const PetscInt idxn[], const PetscScalar v[], InsertMode addv)>

Definition at line 37 of file Schur.hpp.

Constructor & Destructor Documentation

◆ OpSchurAssembleEndImpl() [1/2]

MoFEM::OpSchurAssembleEndImpl::OpSchurAssembleEndImpl ( std::vector< std::string >  fields_name,
std::vector< boost::shared_ptr< Range > >  field_ents,
std::vector< SmartPetscObj< AO > >  sequence_of_aos,
std::vector< SmartPetscObj< Mat > >  sequence_of_mats,
std::vector< bool sym_schur,
bool  symm_op = true 
)

Construct a new Op Schur Assemble End object.

Parameters
fields_namelist of fields
field_entslist of entities on which schur complement is applied (can be empty)
sequence_of_aoslist of maps from base problem to Schur complement matrix
sequence_of_matslist of Schur complement matrices
sym_schurtrue if Schur complement is symmetric
symm_optrue if block diagonal is symmetric

Definition at line 146 of file Schur.cpp.

152 : ForcesAndSourcesCore::UserDataOperator(NOSPACE, OPSPACE, symm_op),
153 fieldsName(fields_name), fieldEnts(field_ents),
154 sequenceOfAOs(sequence_of_aos), sequenceOfMats(sequence_of_mats),
155 symSchur(sym_schur), diagEps(fields_name.size(), 0) {}
@ NOSPACE
Definition: definitions.h:83
@ OPSPACE
operator do Work is execute on space data
std::vector< boost::shared_ptr< Range > > fieldEnts
Definition: Schur.hpp:85
std::vector< bool > symSchur
Definition: Schur.hpp:88
std::vector< std::string > fieldsName
Definition: Schur.hpp:84
std::vector< SmartPetscObj< Mat > > sequenceOfMats
Definition: Schur.hpp:87
std::vector< SmartPetscObj< AO > > sequenceOfAOs
Definition: Schur.hpp:86
std::vector< double > diagEps
Definition: Schur.hpp:89

◆ OpSchurAssembleEndImpl() [2/2]

MoFEM::OpSchurAssembleEndImpl::OpSchurAssembleEndImpl ( std::vector< std::string >  fields_name,
std::vector< boost::shared_ptr< Range > >  field_ents,
std::vector< SmartPetscObj< AO > >  sequence_of_aos,
std::vector< SmartPetscObj< Mat > >  sequence_of_mats,
std::vector< bool sym_schur,
std::vector< double diag_eps,
bool  symm_op = true 
)

Construct a new Op Schur Assemble End object.

Parameters
fields_namelist of fields
field_entslist of entities on which schur complement is applied (can be empty)
sequence_of_aoslist of maps from base problem to Schur complement matrix
sequence_of_matslist of Schur complement matrices
sym_schurtrue if Schur complement is symmetric
diag_epsadd epsilon on diagonal of inverted matrix
symm_optrue if block diagonal is symmetric

Definition at line 135 of file Schur.cpp.

141 : ForcesAndSourcesCore::UserDataOperator(NOSPACE, OPSPACE, symm_op),
142 fieldsName(fields_name), fieldEnts(field_ents),
143 sequenceOfAOs(sequence_of_aos), sequenceOfMats(sequence_of_mats),
144 symSchur(sym_schur), diagEps(diag_eps) {}

Member Function Documentation

◆ doWorkImpl()

template<typename I >
MoFEMErrorCode MoFEM::OpSchurAssembleEndImpl::doWorkImpl ( int  side,
EntityType  type,
EntitiesFieldData::EntData data 
)
protected

Definition at line 159 of file Schur.cpp.

160 {
161
163#ifndef NDEBUG
164 MOFEM_LOG("SELF", Sev::noisy) << "Schur assemble begin -> end";
165#endif
166
167 auto assemble = [&](SmartPetscObj<Mat> M, MatSetValuesRaw mat_set_values,
168 auto &storage) {
170 if (M) {
171 for (auto &s : storage) {
172 auto &m = s.getMat();
173 if (m.size1()) {
174 auto &row_ind = s.getRowInd();
175 auto &col_ind = s.getColInd();
176
177 if (mat_set_values(M, row_ind.size(), &*row_ind.begin(),
178 col_ind.size(), &*col_ind.begin(),
179 &*m.data().begin(), ADD_VALUES)) {
180 auto field_ents = getPtrFE()->mField.get_field_ents();
181 auto row_ent_it = field_ents->find(s.uidRow);
182 auto col_ent_it = field_ents->find(s.uidCol);
183 MOFEM_LOG_CHANNEL("SELF");
184 if (row_ent_it != field_ents->end())
185 MOFEM_LOG("SELF", Sev::error)
186 << "Assemble row entity: " << (*row_ent_it)->getName() << " "
187 << (*col_ent_it)->getEntTypeName() << " side "
188 << (*row_ent_it)->getSideNumber();
189 if (col_ent_it != field_ents->end())
190 MOFEM_LOG("SELF", Sev::error)
191 << "Assemble col entity: " << (*col_ent_it)->getName() << " "
192 << (*col_ent_it)->getEntTypeName() << " side "
193 << (*col_ent_it)->getSideNumber();
194 CHK_THROW_MESSAGE(ierr, "MatSetValues");
195 }
196 }
197 }
198 }
200 };
201
202 auto apply_schur = [&](auto &storage,
203
204 const auto ss,
205
206 auto lo_uid, auto hi_uid, double eps) {
208
209 auto add_off_mat = [&](auto row_uid, auto col_uid, auto &row_ind,
210 auto &col_ind, auto &offMatInvDiagOffMat) {
212 auto it = storage.template get<SchurL2Mats::uid_mi_tag>().find(
213 boost::make_tuple(row_uid, col_uid));
214 if (it == storage.template get<SchurL2Mats::uid_mi_tag>().end()) {
215 const auto idx = SchurL2Mats::schurL2Storage.size();
216 const auto size = SchurL2Mats::locMats.size();
217 const auto nb_rows = offMatInvDiagOffMat.size1();
218 const auto nb_cols = offMatInvDiagOffMat.size2();
219 if (idx >= size) {
220 SchurL2Mats::locMats.push_back(new MatrixDouble(nb_rows, nb_cols));
221 SchurL2Mats::rowIndices.push_back(new VectorInt(nb_rows));
222 SchurL2Mats::colIndices.push_back(new VectorInt(nb_cols));
223 } else {
224 SchurL2Mats::locMats[idx].resize(nb_rows, nb_cols, false);
225 SchurL2Mats::rowIndices[idx].resize(nb_rows, false);
226 SchurL2Mats::colIndices[idx].resize(nb_cols, false);
227 }
228 auto p = SchurL2Mats::schurL2Storage.emplace(idx, row_uid, col_uid);
229 auto &mat = p.first->getMat();
230 auto &set_row_ind = p.first->getRowInd();
231 auto &set_col_ind = p.first->getColInd();
232#ifndef NDEBUG
233 if (mat.size1() != set_row_ind.size()) {
234 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
235 "Wrong size %d != %d", mat.size1(), set_row_ind.size());
236 }
237 if (mat.size2() != set_col_ind.size()) {
238 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
239 "Wrong size %d != %d", mat.size2(), set_col_ind.size());
240 }
241#endif // NDEBUG
242 noalias(mat) = offMatInvDiagOffMat;
243 noalias(set_row_ind) = row_ind;
244 noalias(set_col_ind) = col_ind;
245 } else {
246 auto &mat = it->getMat();
247#ifndef NDEBUG
248 if (mat.size1() != offMatInvDiagOffMat.size1()) {
249 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
250 "Wrong size %d != %d", mat.size1(),
251 offMatInvDiagOffMat.size1());
252 }
253 if (mat.size2() != offMatInvDiagOffMat.size2()) {
254 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
255 "Wrong size %d != %d", mat.size2(),
256 offMatInvDiagOffMat.size2());
257 }
258#endif // NDEBUG
259 mat += offMatInvDiagOffMat;
260 }
262 };
263
264 auto get_row_view = [&]() {
265 auto row_it =
266 storage.template get<SchurL2Mats::row_mi_tag>().lower_bound(lo_uid);
267 auto hi_row_it =
268 storage.template get<SchurL2Mats::row_mi_tag>().upper_bound(hi_uid);
269 std::vector<const SchurL2Mats *> schur_row_ptr_view;
270 schur_row_ptr_view.reserve(std::distance(row_it, hi_row_it));
271 for (; row_it != hi_row_it; ++row_it) {
272 schur_row_ptr_view.push_back(&*row_it);
273 }
274 return schur_row_ptr_view;
275 };
276
277 auto get_col_view = [&]() {
278 auto col_it =
279 storage.template get<SchurL2Mats::col_mi_tag>().lower_bound(lo_uid);
280 auto hi_col_it =
281 storage.template get<SchurL2Mats::col_mi_tag>().upper_bound(hi_uid);
282 std::vector<const SchurL2Mats *> schur_col_ptr_view;
283 schur_col_ptr_view.reserve(std::distance(col_it, hi_col_it));
284 for (; col_it != hi_col_it; ++col_it) {
285 schur_col_ptr_view.push_back(&*col_it);
286 }
287 return schur_col_ptr_view;
288 };
289
290 auto schur_row_ptr_view = get_row_view();
291 auto schur_col_ptr_view = get_col_view();
292
293 for (auto row_it : schur_row_ptr_view) {
294 if (row_it->uidRow == row_it->uidCol) {
295
296 CHKERR I::invertMat(row_it->getMat(), invMat, eps);
297
298 for (auto c_lo : schur_col_ptr_view) {
299
300 auto &row_uid = c_lo->uidRow;
301 if (row_uid == row_it->uidRow)
302 continue;
303
304 auto &cc_off_mat = c_lo->getMat();
305 invDiagOffMat.resize(cc_off_mat.size1(), invMat.size2(), false);
306#ifndef NDEBUG
307 if (invMat.size1() != cc_off_mat.size2()) {
308 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
309 "Wrong size %d != %d", invMat.size1(), cc_off_mat.size2());
310 }
311#endif // NDEBUG
312 noalias(invDiagOffMat) = prod(cc_off_mat, invMat);
313
314 for (auto r_lo : schur_row_ptr_view) {
315 auto &col_uid = r_lo->uidCol;
316
317 // Skip diagonal
318 if (col_uid == row_it->uidRow)
319 continue;
320
321 // If symmetry only run upper off diagonal terms
322 if (symSchur[ss] && row_uid > col_uid)
323 continue;
324
325 auto &rr_off_mat = r_lo->getMat();
326 offMatInvDiagOffMat.resize(invDiagOffMat.size1(),
327 rr_off_mat.size2(), false);
328#ifndef NDEBUG
329 if (rr_off_mat.size1() != invDiagOffMat.size2()) {
330 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
331 "Wrong size %d != %d", rr_off_mat.size1(),
332 invDiagOffMat.size2());
333 }
334#endif // NDEBUG
335 noalias(offMatInvDiagOffMat) = prod(invDiagOffMat, rr_off_mat);
336
337 CHKERR add_off_mat(row_uid, col_uid, c_lo->getRowInd(),
338 r_lo->getColInd(), offMatInvDiagOffMat);
339
340 if (symSchur[ss] && row_uid != col_uid) {
342 offMatInvDiagOffMat.size1(),
343 false);
345 CHKERR add_off_mat(col_uid, row_uid, r_lo->getColInd(),
346 c_lo->getRowInd(), transOffMatInvDiagOffMat);
347 }
348 }
349 }
350 }
351 }
352
354 };
355
356 auto erase_factored = [&](auto &storage,
357
358 const auto ss, auto lo_uid, auto hi_uid) {
360
361 auto r_lo =
362 storage.template get<SchurL2Mats::row_mi_tag>().lower_bound(lo_uid);
363 auto r_hi =
364 storage.template get<SchurL2Mats::row_mi_tag>().upper_bound(hi_uid);
365 storage.template get<SchurL2Mats::row_mi_tag>().erase(r_lo, r_hi);
366
367 auto c_lo =
368 storage.template get<SchurL2Mats::col_mi_tag>().lower_bound(lo_uid);
369 auto c_hi =
370 storage.template get<SchurL2Mats::col_mi_tag>().upper_bound(hi_uid);
371 storage.template get<SchurL2Mats::col_mi_tag>().erase(c_lo, c_hi);
372
374 };
375
376 auto assemble_off_diagonal = [&](auto &storage, const auto ss) {
378
379 // apply AO
380 for (auto &m : storage) {
381 if (auto ao = sequenceOfAOs[ss]) {
382 auto &ind_row = m.getRowInd();
383 CHKERR AOApplicationToPetsc(ao, ind_row.size(), &*ind_row.begin());
384 auto &ind_col = m.getColInd();
385 CHKERR AOApplicationToPetsc(ao, ind_col.size(), &*ind_col.begin());
386 }
387 }
388
389 // assemble Schur
390 if (sequenceOfMats[ss]) {
391 CHKERR assemble(sequenceOfMats[ss], matSetValuesSchurRaw, storage);
392 }
393
395 };
396
397 auto &storage = SchurL2Mats::schurL2Storage;
398 // Assemble to global matrix
399
400 // Assemble Schur complements
401 // Iterate complements
402 for (auto ss = 0; ss != fieldsName.size(); ++ss) {
403
404 auto assemble = [&](auto &storage, auto ss, auto lo_uid, auto hi_uid) {
406
407 CHKERR apply_schur(storage, ss, lo_uid, hi_uid, diagEps[ss]);
408 CHKERR erase_factored(storage, ss, lo_uid, hi_uid);
409 CHKERR assemble_off_diagonal(storage, ss);
411 };
412
413 auto field_bit = getPtrFE()->mField.get_field_bit_number(fieldsName[ss]);
414 auto row_ents = fieldEnts[ss];
415
416 if (row_ents) {
417 for (auto p = row_ents->pair_begin(); p != row_ents->pair_end(); ++p) {
418 auto lo_uid =
419 FieldEntity::getLoLocalEntityBitNumber(field_bit, p->first);
420 auto hi_uid =
421 FieldEntity::getHiLocalEntityBitNumber(field_bit, p->second);
422 CHKERR assemble(storage, ss, lo_uid, hi_uid);
423 }
424 } else {
425 // Iterate all entities (typically L2)
427 field_bit, get_id_for_min_type<MBVERTEX>());
429 field_bit, get_id_for_max_type<MBENTITYSET>());
430 CHKERR assemble(storage, ss, lo_uid, hi_uid);
431 }
432 }
433
434#ifndef NDEBUG
435 MOFEM_LOG("SELF", Sev::noisy) << "Schur assemble done";
436#endif
437
439}
static Index< 'M', 3 > M
static Index< 'p', 3 > p
static const double eps
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:595
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
FTensor::Index< 'm', SPACE_DIM > m
virtual const FieldEntity_multiIndex * get_field_ents() const =0
Get the field ents object.
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:284
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
UBlasVector< int > VectorInt
Definition: Types.hpp:67
virtual FieldBitNumber get_field_bit_number(const std::string name) const =0
get field bit number
static UId getLoLocalEntityBitNumber(const char bit_number, const EntityHandle ent)
static UId getHiLocalEntityBitNumber(const char bit_number, const EntityHandle ent)
MatrixDouble offMatInvDiagOffMat
Definition: Schur.hpp:93
boost::function< MoFEMErrorCode(Mat mat, PetscInt m, const PetscInt idxm[], PetscInt n, const PetscInt idxn[], const PetscScalar v[], InsertMode addv)> MatSetValuesRaw
Definition: Schur.hpp:39
MatSetValuesRaw matSetValuesSchurRaw
Definition: Schur.hpp:42
MatrixDouble invDiagOffMat
Definition: Schur.hpp:92
MatrixDouble transOffMatInvDiagOffMat
Definition: Schur.hpp:94
static boost::ptr_vector< VectorInt > rowIndices
Definition: Schur.hpp:183
static SchurL2Storage schurL2Storage
Definition: Schur.hpp:185
static boost::ptr_vector< VectorInt > colIndices
Definition: Schur.hpp:184
static boost::ptr_vector< MatrixDouble > locMats
Definition: Schur.hpp:182

Member Data Documentation

◆ diagEps

std::vector<double> MoFEM::OpSchurAssembleEndImpl::diagEps
protected

Definition at line 89 of file Schur.hpp.

◆ fieldEnts

std::vector<boost::shared_ptr<Range> > MoFEM::OpSchurAssembleEndImpl::fieldEnts
protected

Definition at line 85 of file Schur.hpp.

◆ fieldsName

std::vector<std::string> MoFEM::OpSchurAssembleEndImpl::fieldsName
protected

Definition at line 84 of file Schur.hpp.

◆ invDiagOffMat

MatrixDouble MoFEM::OpSchurAssembleEndImpl::invDiagOffMat
protected

Definition at line 92 of file Schur.hpp.

◆ invMat

MatrixDouble MoFEM::OpSchurAssembleEndImpl::invMat
protected

Definition at line 91 of file Schur.hpp.

◆ matSetValuesRaw

MatSetValuesRaw MoFEM::OpSchurAssembleEndImpl::matSetValuesRaw = ::MatSetValues

Definition at line 41 of file Schur.hpp.

◆ matSetValuesSchurRaw

MatSetValuesRaw MoFEM::OpSchurAssembleEndImpl::matSetValuesSchurRaw = ::MatSetValues

Definition at line 42 of file Schur.hpp.

◆ offMatInvDiagOffMat

MatrixDouble MoFEM::OpSchurAssembleEndImpl::offMatInvDiagOffMat
protected

Definition at line 93 of file Schur.hpp.

◆ sequenceOfAOs

std::vector<SmartPetscObj<AO> > MoFEM::OpSchurAssembleEndImpl::sequenceOfAOs
protected

Definition at line 86 of file Schur.hpp.

◆ sequenceOfMats

std::vector<SmartPetscObj<Mat> > MoFEM::OpSchurAssembleEndImpl::sequenceOfMats
protected

Definition at line 87 of file Schur.hpp.

◆ symSchur

std::vector<bool> MoFEM::OpSchurAssembleEndImpl::symSchur
protected

Definition at line 88 of file Schur.hpp.

◆ transOffMatInvDiagOffMat

MatrixDouble MoFEM::OpSchurAssembleEndImpl::transOffMatInvDiagOffMat
protected

Definition at line 94 of file Schur.hpp.


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