v0.16.0
Loading...
Searching...
No Matches
affine_tet_stress_gram.cpp
Go to the documentation of this file.
1/**
2 * \file affine_tet_stress_gram.cpp
3 *
4 * \brief One-tetrahedron diagnostic for the EP stress block.
5 */
6
7constexpr int adolc_tag = 1;
8
9#include <MoFEM.hpp>
10using namespace MoFEM;
11
12#include <algorithm>
13#include <cmath>
14#include <iomanip>
15#include <limits>
16#include <numeric>
17#include <sstream>
18#include <string>
19#include <vector>
20
21#include <MatOps.hpp>
22#include <MatElastic.hpp>
24using namespace EshelbianPlasticity;
25
26static char help[] =
27 "Assemble EP P+bubble stress diagnostics on one affine tet.\n"
28 " -diag_matrix_type gram|a00\n"
29 " -diag_include_bubble true|false\n"
30 " -diag_rank_tol <real>\n"
31 " -diag_check_full_rank true|false\n"
32 " -diag_view_matrix true|false\n"
33 " -broken_hdiv_base demkowicz|ainsworth\n\n";
34
35/// Selects which diagnostic matrix is assembled.
37
38/// Reads -diag_matrix_type from PETSc options.
41
42 char matrix_type[32] = "gram";
43 CHKERR PetscOptionsGetString(PETSC_NULLPTR, "", "-diag_matrix_type",
44 matrix_type, sizeof(matrix_type),
45 PETSC_NULLPTR);
46 const std::string type_name(matrix_type);
47
48 if (type_name == "gram") {
50 } else if (type_name == "a00") {
52 } else {
53 SETERRQ(PETSC_COMM_SELF, MOFEM_INVALID_DATA,
54 "Unknown -diag_matrix_type '%s'; use 'gram' or 'a00'",
55 matrix_type);
56 }
57
59}
60
61/// Returns the PETSc option name for a diagnostic matrix type.
63 switch (type) {
65 return "gram";
67 return "a00";
68 }
69 return "unknown";
70}
71
72/// Stores a short rank summary for the assembled matrix.
74 size_t rowsNb = 0;
75 size_t colsNb = 0;
76 size_t maxRank = 0;
77 size_t rank = 0;
78 double frobeniusNorm = 0;
79 double symmetryDefect = 0;
80 double absRankTol = 0;
82 double maxSingular = 0;
83};
84
85/// Creates one unit affine tetrahedron mesh.
86static MoFEMErrorCode createAffineTet(moab::Interface &moab,
87 EntityHandle &meshset) {
89
90 double tet_coords[] = {0, 0, 0, 1.0, 0, 0,
91 0, 1.0, 0, 0, 0, 1.0};
92 EntityHandle nodes[4];
93 for (int nn = 0; nn < 4; nn++) {
94 CHKERR moab.create_vertex(&tet_coords[3 * nn], nodes[nn]);
95 }
96
97 EntityHandle tet;
98 CHKERR moab.create_element(MBTET, nodes, 4, tet);
99 CHKERR moab.create_meshset(MESHSET_SET | MESHSET_TRACK_OWNER, meshset);
100
101 Range tets;
102 tets.insert(tet);
103 CHKERR moab.add_entities(meshset, tets);
104 for (int dim = 0; dim != 3; ++dim) {
105 Range adj;
106 CHKERR moab.get_adjacencies(tets, dim, true, adj,
107 moab::Interface::UNION);
108 CHKERR moab.add_entities(meshset, adj);
109 }
110
112}
113
114/// Copies a PETSc matrix into a dense uBLAS matrix.
117
118 PetscInt rows_nb, cols_nb;
119 CHKERR MatGetSize(A, &rows_nb, &cols_nb);
120 dense.resize(rows_nb, cols_nb, false);
121 dense.clear();
122
123 std::vector<PetscInt> rows(rows_nb), cols(cols_nb);
124 std::iota(rows.begin(), rows.end(), 0);
125 std::iota(cols.begin(), cols.end(), 0);
126
127 std::vector<PetscScalar> values(rows_nb * cols_nb, 0);
128 CHKERR MatGetValues(A, rows_nb, rows.data(), cols_nb, cols.data(),
129 values.data());
130 for (PetscInt rr = 0; rr != rows_nb; ++rr) {
131 for (PetscInt cc = 0; cc != cols_nb; ++cc) {
132 dense(rr, cc) = PetscRealPart(values[rr * cols_nb + cc]);
133 }
134 }
135
137}
138
139/// Prints a dense matrix row by row.
142 for (size_t rr = 0; rr != dense.size1(); ++rr) {
143 std::ostringstream line;
144 line << std::scientific << std::setprecision(16);
145 for (size_t cc = 0; cc != dense.size2(); ++cc) {
146 line << (cc ? " " : "") << dense(rr, cc);
147 }
148 MOFEM_LOG("EP", Sev::inform) << line.str();
149 }
151}
152
153/// Computes rank from the smaller of A*A^T and A^T*A.
155 const double rel_rank_tol,
156 RankDiagnostic &rank_data) {
158
159 rank_data.rowsNb = dense.size1();
160 rank_data.colsNb = dense.size2();
161 rank_data.maxRank = std::min(rank_data.rowsNb, rank_data.colsNb);
162
163 for (size_t rr = 0; rr != rank_data.rowsNb; ++rr) {
164 for (size_t cc = 0; cc != rank_data.colsNb; ++cc) {
165 const double a = dense(rr, cc);
166 rank_data.frobeniusNorm += a * a;
167 if (rank_data.rowsNb == rank_data.colsNb) {
168 const double d = a - dense(cc, rr);
169 rank_data.symmetryDefect += d * d;
170 }
171 }
172 }
173 rank_data.frobeniusNorm = std::sqrt(rank_data.frobeniusNorm);
174 rank_data.symmetryDefect = std::sqrt(rank_data.symmetryDefect);
175
176 if (!rank_data.maxRank)
178
179 const bool use_row_gram = rank_data.rowsNb <= rank_data.colsNb;
180 MatrixDouble gram(rank_data.maxRank, rank_data.maxRank);
181 gram.clear();
182
183 if (use_row_gram) {
184 for (size_t ii = 0; ii != rank_data.rowsNb; ++ii) {
185 for (size_t jj = ii; jj != rank_data.rowsNb; ++jj) {
186 double value = 0;
187 for (size_t cc = 0; cc != rank_data.colsNb; ++cc)
188 value += dense(ii, cc) * dense(jj, cc);
189 gram(ii, jj) = value;
190 gram(jj, ii) = value;
191 }
192 }
193 } else {
194 for (size_t ii = 0; ii != rank_data.colsNb; ++ii) {
195 for (size_t jj = ii; jj != rank_data.colsNb; ++jj) {
196 double value = 0;
197 for (size_t rr = 0; rr != rank_data.rowsNb; ++rr)
198 value += dense(rr, ii) * dense(rr, jj);
199 gram(ii, jj) = value;
200 gram(jj, ii) = value;
201 }
202 }
203 }
204
205 VectorDouble eig(rank_data.maxRank);
206 MatrixDouble eig_vec(rank_data.maxRank, rank_data.maxRank);
207 CHKERR computeEigenValuesSymmetric(gram, eig, eig_vec);
208
209 double max_eig = 0;
210 for (size_t ii = 0; ii != rank_data.maxRank; ++ii)
211 max_eig = std::max(max_eig, std::abs(eig(ii)));
212 rank_data.maxSingular = std::sqrt(std::max(max_eig, 0.0));
213 rank_data.absRankTol =
214 rel_rank_tol * std::max(rank_data.maxSingular, 1.0);
215
216 const double eig_abs_tol = rank_data.absRankTol * rank_data.absRankTol;
217 double min_nonzero = std::numeric_limits<double>::max();
218 for (size_t ii = 0; ii != rank_data.maxRank; ++ii) {
219 const double a = std::abs(eig(ii));
220 if (a > eig_abs_tol) {
221 ++rank_data.rank;
222 min_nonzero = std::min(min_nonzero, std::sqrt(a));
223 }
224 }
225 rank_data.minNonzeroSingular = rank_data.rank ? min_nonzero : 0.0;
226
228}
229
230/// Prints a compact rank summary for the assembled matrix.
232 const MatrixDouble &dense, const DiagnosticMatrixType matrix_type,
233 const PetscBool include_bubble, const double rel_rank_tol,
234 const PetscBool check_full_rank, const PetscBool view_matrix) {
236
237 RankDiagnostic rank_data;
238 CHKERR computeRankDiagnostic(dense, rel_rank_tol, rank_data);
239
240 MOFEM_LOG("EP", Sev::inform)
241 << "diagnostic matrix type: " << getDiagnosticMatrixTypeName(matrix_type);
242 if (matrix_type == DiagnosticMatrixType::GRAM) {
243 MOFEM_LOG("EP", Sev::inform)
244 << "stress basis: " << (include_bubble ? "P+bubble" : "P");
245 } else {
246 MOFEM_LOG("EP", Sev::inform)
247 << "A00 fields: u, bubble, P, omega, wL2";
248 }
249 MOFEM_LOG("EP", Sev::inform)
250 << "matrix size: " << rank_data.rowsNb << " x " << rank_data.colsNb;
251 MOFEM_LOG("EP", Sev::inform)
252 << std::scientific << std::setprecision(16)
253 << "frobenius norm: " << rank_data.frobeniusNorm;
254 if (rank_data.rowsNb == rank_data.colsNb) {
255 MOFEM_LOG("EP", Sev::inform)
256 << std::scientific << std::setprecision(16)
257 << "symmetry defect ||A-A^T||_F: " << rank_data.symmetryDefect;
258 }
259 MOFEM_LOG("EP", Sev::inform)
260 << std::scientific << std::setprecision(16)
261 << "relative rank tolerance: " << rel_rank_tol;
262 MOFEM_LOG("EP", Sev::inform)
263 << std::scientific << std::setprecision(16)
264 << "absolute singular tolerance: " << rank_data.absRankTol;
265 MOFEM_LOG("EP", Sev::inform)
266 << std::scientific << std::setprecision(16)
267 << "singular value range approx: [" << rank_data.minNonzeroSingular
268 << ", " << rank_data.maxSingular << "]";
269 MOFEM_LOG("EP", Sev::inform)
270 << "numerical rank: " << rank_data.rank << " / " << rank_data.maxRank;
271
272 if (view_matrix) {
273 MOFEM_LOG("EP", Sev::inform) << "dense diagnostic matrix:";
275 }
276
277 if (check_full_rank && rank_data.rank != rank_data.maxRank) {
278 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
279 "%s diagnostic block is rank deficient: rank %zu / %zu",
280 getDiagnosticMatrixTypeName(matrix_type), rank_data.rank,
281 rank_data.maxRank);
282 }
283
285}
286
287/// Builds the affine tet problem and assembles the diagnostic matrix.
289 const DiagnosticMatrixType matrix_type, const PetscBool include_bubble,
290 const double rel_rank_tol, const PetscBool check_full_rank,
291 const PetscBool view_matrix) {
293
294 int comm_size = 0;
295 MPI_Comm_size(PETSC_COMM_WORLD, &comm_size);
296 if (comm_size != 1) {
297 SETERRQ(PETSC_COMM_WORLD, MOFEM_NOT_IMPLEMENTED,
298 "affine_tet_stress_gram is a serial diagnostic; run with -np 1");
299 }
300
301 DMType dm_name = "DMMOFEM";
302 CHKERR DMRegister_MoFEM(dm_name);
303
304 moab::Core moab_core;
305 moab::Interface &moab = moab_core;
306 ParallelComm *pcomm = ParallelComm::get_pcomm(&moab, MYPCOMM_INDEX);
307 if (pcomm == nullptr) {
308 pcomm = new ParallelComm(&moab, PETSC_COMM_SELF);
309 }
310
311 EntityHandle meshset;
312 CHKERR createAffineTet(moab, meshset);
313
314 MoFEM::Core mofem_core(moab, PETSC_COMM_SELF, -2);
315 MoFEM::Interface &m_field = mofem_core;
316
317 BitRefLevel bit_level0 = BitRefLevel().set(0);
318 CHKERR m_field.getInterface<BitRefManager>()->setBitRefLevelByDim(
319 meshset, 3, bit_level0);
320
322 EshelbianCore ep(m_field);
323
324 ep.bcSpatialDispVecPtr = boost::make_shared<BcDispVec>();
325 ep.bcSpatialRotationVecPtr = boost::make_shared<BcRotVec>();
326 ep.bcSpatialTractionVecPtr = boost::make_shared<TractionBcVec>();
328 boost::make_shared<AnalyticalTractionBcVec>();
329 ep.bcSpatialPressureVecPtr = boost::make_shared<PressureBcVec>();
331 boost::make_shared<NormalDisplacementBcVec>();
333 boost::make_shared<AnalyticalDisplacementBcVec>();
334 ep.externalStrainVecPtr = boost::make_shared<ExternalStrainVec>();
335 ep.bcSpatialFreeTractionVecPtr = boost::make_shared<TractionFreeBc>();
337 "CONTACT");
338
339 CHKERR ep.addFields(meshset, include_bubble);
340 CHKERR ep.projectGeometry(meshset, 0.0);
341 CHKERR ep.addVolumeFiniteElement(meshset, include_bubble);
342 CHKERR m_field.build_adjacencies(bit_level0, QUIET);
343
344 auto dm = createDM(m_field.get_comm(), "DMMOFEM");
345 CHKERR DMMoFEMCreateMoFEM(dm, &m_field, "AFFINE_TET_EP", bit_level0,
346 BitRefLevel().set());
347 CHKERR DMMoFEMSetDestroyProblem(dm, PETSC_TRUE);
348 CHKERR DMMoFEMSetSquareProblem(dm, PETSC_TRUE);
349 CHKERR DMMoFEMSetIsPartitioned(dm, PETSC_FALSE);
351 m_field.getInterface<ProblemsManager>()->buildProblemFromFields = PETSC_TRUE;
352 CHKERR DMSetUp(dm);
353 m_field.getInterface<ProblemsManager>()->buildProblemFromFields = PETSC_FALSE;
354
355 ep.solTSStep = createDMVector(dm);
356 CHKERR VecZeroEntries(ep.solTSStep);
357
358 auto diag_dm = createDM(m_field.get_comm(), "DMMOFEM");
359 CHKERR DMMoFEMCreateSubDM(diag_dm, dm, "AFFINE_TET_STRESS_DIAG");
360 CHKERR DMMoFEMSetDestroyProblem(diag_dm, PETSC_TRUE);
361 CHKERR DMMoFEMSetSquareProblem(diag_dm, PETSC_TRUE);
362 CHKERR DMMoFEMSetIsPartitioned(diag_dm, PETSC_FALSE);
364
365 switch (matrix_type) {
369 if (include_bubble) {
372 }
373 break;
375 if (!include_bubble) {
376 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
377 "P-only diagnostic is implemented for -diag_matrix_type gram");
378 }
379 for (const auto field_name : {ep.stretchTensor, ep.bubbleField,
380 ep.piolaStress, ep.rotAxis,
381 ep.spatialL2Disp}) {
384 }
385 break;
386 }
387 CHKERR DMSetUp(diag_dm);
388
389 CHKERR ep.addMaterial_Hencky(5.0, 0.25);
390
391 auto fe_lhs = boost::make_shared<VolumeElementForcesAndSourcesCore>(m_field);
392 CHKERR ep.setBaseVolumeElementOps(adolc_tag, false, true, false, fe_lhs,
393 include_bubble);
394 switch (matrix_type) {
396 if (include_bubble) {
397 CHKERR ep.pushStressGramOps(fe_lhs);
398 } else {
400 }
401 break;
405 } else {
407 }
408 break;
409 }
410
411 auto A = createDMMatrix(diag_dm);
412 CHKERR MatZeroEntries(A);
413 fe_lhs->ksp_B = A;
414 fe_lhs->ts_A = A;
415 fe_lhs->ts_B = A;
416 fe_lhs->ts_u = ep.solTSStep;
417 fe_lhs->ts_u_t = ep.solTSStep;
418 fe_lhs->ts_a = 0.0;
419 fe_lhs->data_ctx = PetscData::CtxSetA | PetscData::CtxSetB |
422 CHKERR MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY);
423 CHKERR MatAssemblyEnd(A, MAT_FINAL_ASSEMBLY);
424
425 MatrixDouble dense;
426 CHKERR getDenseMatrix(A, dense);
427
428 CHKERR analyseDenseStressBlock(dense, matrix_type, include_bubble,
429 rel_rank_tol, check_full_rank, view_matrix);
430
432}
433
434/// Parses options, sets logging, and runs the diagnostic.
435int main(int argc, char *argv[]) {
436 MoFEM::Core::Initialize(&argc, &argv, (char *)0, help);
437
438 auto core_log = logging::core::get();
439 core_log->add_sink(LogManager::createSink(LogManager::getStrmWorld(), "EP"));
440 LogManager::setLog("EP");
441 MOFEM_LOG_TAG("EP", "affine_tet_stress_gram");
442 core_log->add_sink(
444 LogManager::setLog("EPSELF");
445 MOFEM_LOG_TAG("EPSELF", "affine_tet_stress_gram");
446 core_log->add_sink(
448 LogManager::setLog("EPSYNC");
449 MOFEM_LOG_TAG("EPSYNC", "affine_tet_stress_gram");
450
451 try {
452 PetscBool view_matrix = PETSC_FALSE;
453 CHKERR PetscOptionsGetBool(PETSC_NULLPTR, "", "-diag_view_matrix",
454 &view_matrix, PETSC_NULLPTR);
455 double rel_rank_tol = 1e-10;
456 CHKERR PetscOptionsGetReal(PETSC_NULLPTR, "", "-diag_rank_tol",
457 &rel_rank_tol, PETSC_NULLPTR);
458 PetscBool check_full_rank = PETSC_FALSE;
459 CHKERR PetscOptionsGetBool(PETSC_NULLPTR, "", "-diag_check_full_rank",
460 &check_full_rank, PETSC_NULLPTR);
461 PetscBool include_bubble = PETSC_TRUE;
462 CHKERR PetscOptionsGetBool(PETSC_NULLPTR, "", "-diag_include_bubble",
463 &include_bubble, PETSC_NULLPTR);
464 DiagnosticMatrixType matrix_type;
465 CHKERR getDiagnosticMatrixType(matrix_type);
466 CHKERR assembleStressDiagnostic(matrix_type, include_bubble, rel_rank_tol,
467 check_full_rank, view_matrix);
468 }
470
472 return 0;
473}
Eshelbian plasticity interface.
std::string type
int main()
static MoFEMErrorCode analyseDenseStressBlock(const MatrixDouble &dense, const DiagnosticMatrixType matrix_type, const PetscBool include_bubble, const double rel_rank_tol, const PetscBool check_full_rank, const PetscBool view_matrix)
Prints a compact rank summary for the assembled matrix.
static MoFEMErrorCode getDiagnosticMatrixType(DiagnosticMatrixType &type)
Reads -diag_matrix_type from PETSc options.
static MoFEMErrorCode getDenseMatrix(Mat A, MatrixDouble &dense)
Copies a PETSc matrix into a dense uBLAS matrix.
static const char * getDiagnosticMatrixTypeName(DiagnosticMatrixType type)
Returns the PETSc option name for a diagnostic matrix type.
static char help[]
static MoFEMErrorCode computeRankDiagnostic(const MatrixDouble &dense, const double rel_rank_tol, RankDiagnostic &rank_data)
Computes rank from the smaller of A*A^T and A^T*A.
static MoFEMErrorCode printDenseMatrix(const MatrixDouble &dense)
Prints a dense matrix row by row.
static MoFEMErrorCode createAffineTet(moab::Interface &moab, EntityHandle &meshset)
Creates one unit affine tetrahedron mesh.
static MoFEMErrorCode assembleStressDiagnostic(const DiagnosticMatrixType matrix_type, const PetscBool include_bubble, const double rel_rank_tol, const PetscBool check_full_rank, const PetscBool view_matrix)
Builds the affine tet problem and assembles the diagnostic matrix.
constexpr int adolc_tag
DiagnosticMatrixType
Selects which diagnostic matrix is assembled.
constexpr double a
@ QUIET
#define CATCH_ERRORS
Catch errors.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MYPCOMM_INDEX
default communicator number PCOMM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
@ MOFEM_INVALID_DATA
Definition definitions.h:36
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
PetscErrorCode DMMoFEMSetIsPartitioned(DM dm, PetscBool is_partitioned)
Definition DMMoFEM.cpp:1113
PetscErrorCode DMMoFEMCreateSubDM(DM subdm, DM dm, const char problem_name[])
Must be called by user to set Sub DM MoFEM data structures.
Definition DMMoFEM.cpp:215
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
Definition DMMoFEM.cpp:488
PetscErrorCode DMMoFEMSetSquareProblem(DM dm, PetscBool square_problem)
set squared problem
Definition DMMoFEM.cpp:450
PetscErrorCode DMMoFEMCreateMoFEM(DM dm, MoFEM::Interface *m_field_ptr, const char problem_name[], const MoFEM::BitRefLevel bit_level, const MoFEM::BitRefLevel bit_mask=MoFEM::BitRefLevel().set())
Must be called by user to set MoFEM data structures.
Definition DMMoFEM.cpp:114
PetscErrorCode DMMoFEMAddSubFieldRow(DM dm, const char field_name[])
Definition DMMoFEM.cpp:238
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition DMMoFEM.cpp:43
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
Definition DMMoFEM.cpp:576
auto createDMVector(DM dm, RowColData rc=RowColData::COL)
Get smart vector from DM.
Definition DMMoFEM.hpp:1237
PetscErrorCode DMMoFEMAddSubFieldCol(DM dm, const char field_name[])
Definition DMMoFEM.cpp:280
auto createDMMatrix(DM dm)
Get smart matrix from DM.
Definition DMMoFEM.hpp:1194
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition Types.hpp:40
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
PetscErrorCode DMMoFEMSetDestroyProblem(DM dm, PetscBool destroy_problem)
Definition DMMoFEM.cpp:434
PetscErrorCode PetscOptionsGetReal(PetscOptions *, const char pre[], const char name[], PetscReal *dval, PetscBool *set)
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
MoFEMErrorCode computeEigenValuesSymmetric(const MatrixDouble &mat, VectorDouble &eig, MatrixDouble &eigen_vec)
compute eigenvalues of a symmetric matrix using lapack dsyev
auto createDM(MPI_Comm comm, const std::string dm_type_name)
Creates smart DM object.
constexpr AssemblyType A
constexpr auto field_name
boost::shared_ptr< ExternalStrainVec > externalStrainVecPtr
boost::shared_ptr< TractionBcVec > bcSpatialTractionVecPtr
const std::string spatialL2Disp
MoFEMErrorCode addMaterial_Hencky(double E, double nu)
static enum StretchHandling stretchHandling
boost::shared_ptr< TractionFreeBc > bcSpatialFreeTractionVecPtr
MoFEMErrorCode getTractionFreeBc(const EntityHandle meshset, boost::shared_ptr< TractionFreeBc > &bc_ptr, const std::string contact_set_name)
Remove all, but entities where kinematic constrains are applied.
const std::string elementVolumeName
boost::shared_ptr< BcRotVec > bcSpatialRotationVecPtr
boost::shared_ptr< NormalDisplacementBcVec > bcSpatialNormalDisplacementVecPtr
const std::string piolaStress
const std::string bubbleField
boost::shared_ptr< AnalyticalDisplacementBcVec > bcSpatialAnalyticalDisplacementVecPtr
MoFEMErrorCode projectGeometry(const EntityHandle meshset=0, double time=0)
const std::string rotAxis
boost::shared_ptr< BcDispVec > bcSpatialDispVecPtr
MoFEMErrorCode addVolumeFiniteElement(const EntityHandle meshset=0, const bool add_bubble=true)
MoFEMErrorCode pushNoStretchVolumeA00Ops(boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe_lhs)
MoFEMErrorCode setBaseVolumeElementOps(const int tag, const bool do_rhs, const bool do_lhs, const bool calc_rates, boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe, const bool add_bubble=true)
boost::shared_ptr< AnalyticalTractionBcVec > bcSpatialAnalyticalTractionVecPtr
static bool hasNonHomogeneousMaterialBlock
MoFEMErrorCode pushStretchVolumeA00Ops(boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe_lhs)
boost::shared_ptr< PressureBcVec > bcSpatialPressureVecPtr
SmartPetscObj< Vec > solTSStep
const std::string stretchTensor
MoFEMErrorCode addFields(const EntityHandle meshset=0, const bool add_bubble=true)
MoFEMErrorCode pushStressGramOps(boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe_lhs)
MoFEMErrorCode pushPiolaStressGramOps(boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe_lhs)
Managing BitRefLevels.
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
virtual MPI_Comm & get_comm() const =0
Core (interface) class.
Definition Core.hpp:83
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:68
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:123
Deprecated interface functions.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
static boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
static constexpr Switches CtxSetA
Jacobian matrix switch.
static constexpr Switches CtxSetX
Solution vector switch.
static constexpr Switches CtxSetX_T
First time derivative switch.
static constexpr Switches CtxSetB
Preconditioner matrix switch.
Problem manager is used to build and partition problems.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Stores a short rank summary for the assembled matrix.