57 GAUSS>::OpGradSymTensorGrad<1, SPACE_DIM, SPACE_DIM, 0>;
69static double phi = -1;
90#include <OpPostProcElastic.hpp>
92using namespace Tutorial;
101 UserDataOperator::OpType type);
118 boost::shared_ptr<MatrixDouble> d_mat_fluid_ptr,
119 boost::shared_ptr<MatrixDouble> d_mat_solid_ptr,
120 boost::shared_ptr<MatrixDouble> d_mat_visc_fluid_ptr,
121 boost::shared_ptr<MatrixDouble> d_mat_visc_solid_ptr,
122 boost::shared_ptr<Range> r_visc_fluid_ptr,
130 boost::shared_ptr<FaceSideEle>
213 const char *list_solvers[]{
"eps",
"pep"};
218 auto set_matrial_stiffens = [&](
auto &mat_d,
auto K,
auto G) {
224 auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(mat_d);
226 constexpr double A = 1;
236 auto set_viscosity = [&](
auto &mat_d,
auto MU) {
242 auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(mat_d);
249 matGradPtr = boost::make_shared<MatrixDouble>();
294 simple->getAddSkeletonFE() =
true;
299 const std::string block_names[] = {
"SOLID",
"FLUID",
"INTERFACE"};
301 if (it->getName().compare(0, block_names[0].length(), block_names[0]) ==
306 }
else if (it->getName().compare(0, block_names[1].length(),
307 block_names[1]) == 0) {
311 }
else if (it->getName().compare(0, block_names[2].length(),
312 block_names[2]) == 0) {
319 for (
auto d =
SPACE_DIM - 1; d >= 0; --d) {
320 auto add_adj = [&](
auto &r,
auto dim) {
324 r.subset_by_dimension(
dim), d,
false, adj, moab::Interface::UNION);
361 auto add_fe_field = [&](
auto field) {
368 CHKERR add_fe_field(
"Uf");
369 CHKERR add_fe_field(
"Us");
373 simple->getOtherFiniteElements().push_back(
"INTERFACE");
399 auto &bc_map = bc_mng->getBcMapByBlockName();
401 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"FIX_X",
403 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"FIX_Y",
405 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"FIX_Z",
407 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"FIX_ALL",
410 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"FIX_X",
412 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"FIX_Y",
414 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"FIX_Z",
416 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"FIX_ALL",
429 auto &bc_map = bc_mng->getBcMapByBlockName();
431 auto dm =
simple->getDM();
445 auto basic_ops = [&]() {
447 auto det_ptr = boost::make_shared<VectorDouble>();
448 auto jac_ptr = boost::make_shared<MatrixDouble>();
449 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
450 pipeline_mng->getOpDomainLhsPipeline().push_back(
452 pipeline_mng->getOpDomainLhsPipeline().push_back(
454 pipeline_mng->getOpDomainLhsPipeline().push_back(
456 pipeline_mng->getOpDomainLhsPipeline().push_back(
465 auto calculate_stiffness_matrix = [&]() {
467 pipeline_mng->getDomainLhsFE().reset();
472 pipeline_mng->getOpDomainLhsPipeline().push_back(
474 pipeline_mng->getOpDomainLhsPipeline().push_back(
477 pipeline_mng->getDomainLhsFE()->B =
K;
478 CHKERR pipeline_mng->loopFiniteElements();
482 auto calculate_L_matrix = [&]() {
485 auto get_side_fe = [&]() {
486 auto side_fe_ptr = boost::make_shared<FaceSideEle>(
mField);
487 auto det_ptr = boost::make_shared<VectorDouble>();
488 auto jac_ptr = boost::make_shared<MatrixDouble>();
489 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
490 side_fe_ptr->getOpPtrVector().push_back(
492 side_fe_ptr->getOpPtrVector().push_back(
494 side_fe_ptr->getOpPtrVector().push_back(
496 side_fe_ptr->getOpPtrVector().push_back(
498 side_fe_ptr->getOpPtrVector().push_back(
503 auto fe_side_ptr = boost::make_shared<SkeletonEle>(
mField);
507 boost::make_shared<Range>(
rSolid),
K,
C,
M));
509 auto rules = fe_side_ptr->getRuleHook = [](int, int,
int p) ->
int {
519 auto calculate_damping_matrix = [&]() {
522 pipeline_mng->getDomainLhsFE().reset();
527 pipeline_mng->getOpDomainLhsPipeline().push_back(
530 pipeline_mng->getDomainLhsFE()->B =
C;
531 CHKERR pipeline_mng->loopFiniteElements();
536 auto calculate_mass_matrix = [&]() {
539 pipeline_mng->getDomainLhsFE().reset();
544 pipeline_mng->getOpDomainLhsPipeline().push_back(
new OpMass(
546 [](
const double,
const double,
const double) {
return rho_solid; },
548 pipeline_mng->getOpDomainLhsPipeline().push_back(
new OpMass(
550 [](
const double,
const double,
const double) {
return rho_fluid; },
553 pipeline_mng->getDomainLhsFE()->B =
M;
554 CHKERR pipeline_mng->loopFiniteElements();
559 CHKERR calculate_L_matrix();
561 CHKERR calculate_stiffness_matrix();
562 CHKERR calculate_damping_matrix();
563 CHKERR calculate_mass_matrix();
565 CHKERR MatAssemblyBegin(
K, MAT_FINAL_ASSEMBLY);
566 CHKERR MatAssemblyEnd(
K, MAT_FINAL_ASSEMBLY);
567 CHKERR MatAssemblyBegin(
C, MAT_FINAL_ASSEMBLY);
568 CHKERR MatAssemblyEnd(
C, MAT_FINAL_ASSEMBLY);
569 CHKERR MatAssemblyBegin(
M, MAT_FINAL_ASSEMBLY);
570 CHKERR MatAssemblyEnd(
M, MAT_FINAL_ASSEMBLY);
596 auto create_eps = [&](MPI_Comm comm) {
603 auto print_info_eps = [&](
auto eps) {
608 PetscInt nev, maxit, its;
611 MOFEM_LOG_C(
"FSI", Sev::inform,
" Number of iterations of the method: %d",
615 MOFEM_LOG_C(
"FSI", Sev::inform,
" Solution method: %s", type);
616 CHKERR EPSGetDimensions(
eps, &nev, NULL, NULL);
617 MOFEM_LOG_C(
"FSI", Sev::inform,
" Number of requested eigenvalues: %d",
620 MOFEM_LOG_C(
"FSI", Sev::inform,
" Stopping condition: tol=%.4g, maxit=%d",
623 PetscScalar eigr, eigi;
624 for (
int nn = 0; nn < nev; nn++) {
625 CHKERR EPSGetEigenpair(
eps, nn, &eigr, &eigi, PETSC_NULL, PETSC_NULL);
627 " ncov = %d eigr = %.8g eigi = %.8g (inv eigr = %.8g)", nn,
628 eigr, eigi, 1. / eigr);
634 auto setup_eps = [&](
auto eps) {
640 Mat
A[3] = {
K.get(),
C.get(),
M.get()};
642 auto create_pep = [&](MPI_Comm comm) {
644 CHKERR PEPCreate(comm, &pep);
645 CHKERR PEPSetOperators(pep, 3,
A);
649 auto setup_pep = [&](
auto pep) {
651 CHKERR PEPSetFromOptions(pep);
655 auto print_info_pep = [&](
auto pep) {
658 double kr, ki, error;
660 for (
int j = 0;
j < nconv; ++
j) {
661 CHKERR PEPGetEigenpair(pep,
j, &kr, &ki, PETSC_NULL, PETSC_NULL);
662 MOFEM_LOG_C(
"FSI", Sev::verbose,
" ncov = %d eigr = %.8g eigi = %.8g",
j,
697 pipeline_mng->getDomainLhsFE().reset();
698 pipeline_mng->getDomainRhsFE().reset();
699 auto post_proc_fe = boost::make_shared<PostProcEle>(
mField);
700 post_proc_fe->generateReferenceElementMesh();
702 auto det_ptr = boost::make_shared<VectorDouble>();
703 auto jac_ptr = boost::make_shared<MatrixDouble>();
704 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
705 post_proc_fe->getOpPtrVector().push_back(
707 post_proc_fe->getOpPtrVector().push_back(
709 post_proc_fe->getOpPtrVector().push_back(
712 auto us_ptr = boost::make_shared<MatrixDouble>();
713 auto grad_ptr = boost::make_shared<MatrixDouble>();
714 auto strain_s_ptr = boost::make_shared<MatrixDouble>();
715 auto uf_ptr = boost::make_shared<MatrixDouble>();
716 auto strain_f_ptr = boost::make_shared<MatrixDouble>();
720 post_proc_fe->getOpPtrVector().push_back(
722 post_proc_fe->getOpPtrVector().push_back(
724 post_proc_fe->getOpPtrVector().push_back(
727 post_proc_fe->getOpPtrVector().push_back(
729 post_proc_fe->getOpPtrVector().push_back(
731 post_proc_fe->getOpPtrVector().push_back(
736 post_proc_fe->getOpPtrVector().push_back(
738 new OpPPMap(post_proc_fe->postProcMesh, post_proc_fe->mapGaussPts,
747 {
"STRAINf", strain_f_ptr}}
753 auto bc_mng = mField.getInterface<
BcManager>();
757 op_tag_handle->doWorkRhsHook = [&](
DataOperator *op_ptr,
int side,
762 auto get_tag = [&]() {
766 "BLOCK", 1, MB_TYPE_INTEGER,
th,
767 MB_TAG_CREAT | MB_TAG_SPARSE, &def_val),
768 "Can not create tag on post-proc mesh");
772 auto fe_ent =
static_cast<DomainEleOp *
>(op_ptr)->getFEEntityHandle();
775 if (rFluid.find(fe_ent) != rFluid.end()) {
778 if (rSolid.find(fe_ent) != rSolid.end()) {
782 auto &nodes_vec = post_proc_fe->mapGaussPts;
784 post_proc_fe->postProcMesh.tag_clear_data(
785 get_tag(), &*nodes_vec.begin(), nodes_vec.size(), &
marker),
791 post_proc_fe->getOpPtrVector().push_back(op_tag_handle);
793 pipeline_mng->getDomainRhsFE() = post_proc_fe;
795 auto dm =
simple->getDM();
797 auto save_vec = [&](
auto file_name,
auto v) {
800 CHKERR pipeline_mng->loopFiniteElements();
801 post_proc_fe->writeFile(file_name);
805 auto post_proc_eps = [&](
auto eps) {
810 CHKERR EPSGetDimensions(ePS, &nev, NULL, NULL);
811 PetscScalar eigr, eigi, nrm2r;
812 for (
int nn = 0; nn < nev; nn++) {
813 CHKERR EPSGetEigenpair(ePS, nn, &eigr, &eigi,
v, PETSC_NULL);
814 CHKERR VecGhostUpdateBegin(
v, INSERT_VALUES, SCATTER_FORWARD);
815 CHKERR VecGhostUpdateEnd(
v, INSERT_VALUES, SCATTER_FORWARD);
816 CHKERR VecNorm(
v, NORM_2, &nrm2r);
819 " ncov = %d omega2 = %.8g omega = %.8g osc frequency = %.8g kHz",
820 nn, eigr, std::sqrt(std::abs(eigr)),
821 std::sqrt(std::abs(eigr)) / (2 * M_PI));
824 "out_eig_" + boost::lexical_cast<std::string>(nn) +
".h5m",
v);
830 auto post_proc_pep = [&](
auto eps) {
837 CHKERR PEPGetConverged(pEP, &nev);
838 PetscScalar ki, kr, error, nrm2r;
841 for (
int nn = 0; nn < nev; nn++) {
843 CHKERR PEPGetEigenpair(pEP, nn, &kr, &ki, re_vec, im_vec);
844 CHKERR PEPComputeError(pEP, nn, PEP_ERROR_BACKWARD, &error);
846 CHKERR VecGhostUpdateBegin(re_vec, INSERT_VALUES, SCATTER_FORWARD);
847 CHKERR VecGhostUpdateEnd(re_vec, INSERT_VALUES, SCATTER_FORWARD);
848 CHKERR VecGhostUpdateBegin(im_vec, INSERT_VALUES, SCATTER_FORWARD);
849 CHKERR VecGhostUpdateEnd(im_vec, INSERT_VALUES, SCATTER_FORWARD);
852 kr < std::numeric_limits<float>::epsilon()) {
853 CHKERR save_vec(
"out_pep_re_" + boost::lexical_cast<std::string>(idx) +
856 CHKERR save_vec(
"out_pep_im_" + boost::lexical_cast<std::string>(idx) +
863 "idx = %d ncov = %d eigr = %.8g eigi = %.8g angular "
864 "frequency = %.8g kHz "
866 idx - 1, nn, kr, ki, ki / (2 * M_PI), error);
871 if (solverType == EPS_SOLVER)
872 CHKERR post_proc_eps(ePS);
873 else if (solverType == PEP_SOLVER)
874 CHKERR post_proc_pep(pEP);
882int main(
int argc,
char *argv[]) {
890 auto core_log = logging::core::get();
898 DMType dm_name =
"DMMOFEM";
903 moab::Core mb_instance;
904 moab::Interface &moab = mb_instance;
938 std::string col_field_name,
939 UserDataOperator::OpType type)
940 :
FaceSideOp(row_field_name, col_field_name, type) {}
946 const auto nb_in_loop = getFEMethod()->nInTheLoop;
948 auto clear = [](
auto nb) {
957 if (getOpType() == OPROW) {
959 if (type == MBVERTEX) {
960 areaMap[nb_in_loop] = getMeasure();
961 senseMap[nb_in_loop] = getSkeletonSense();
972 const auto nb_dofs = data.
getIndices().size();
976 data.
getN(BaseDerivatives::ZeroDerivative));
978 data.
getN(BaseDerivatives::FirstDerivative));
980 }
else if (getOpType() == OPCOL) {
982 if (type == MBVERTEX) {
983 if (
areaMap[nb_in_loop] != getMeasure()) {
985 "Should be the same");
987 if (
senseMap[nb_in_loop] != getSkeletonSense()) {
989 "Should be the same");
991 if (
sideHandle[nb_in_loop] != getFEEntityHandle()) {
993 "Should be the same");
997 const auto nb_dofs = data.
getIndices().size();
1001 data.
getN(BaseDerivatives::ZeroDerivative));
1003 data.
getN(BaseDerivatives::FirstDerivative));
1008 OpTypeNames[getOpType()]);
1018 &*base_mat.data().begin());
1021template <
typename T>
inline auto get_ntensor(T &base_mat,
int gg,
int bb) {
1022 double *ptr = &base_mat(gg, bb);
1027 double *ptr = &*base_mat.data().begin();
1028 return getFTensor1FromPtr<SPACE_DIM>(ptr);
1031template <
typename T>
1033 double *ptr = &base_mat(gg,
SPACE_DIM * bb);
1034 return getFTensor1FromPtr<SPACE_DIM>(ptr);
1043 boost::shared_ptr<FaceSideEle> side_fe_ptr,
1044 boost::shared_ptr<MatrixDouble> mat_d_fluid_ptr,
1045 boost::shared_ptr<MatrixDouble> mat_d_solid_ptr,
1046 boost::shared_ptr<MatrixDouble> mat_d_visc_fluid_ptr,
1047 boost::shared_ptr<MatrixDouble> mat_d_visc_solid_ptr,
1048 boost::shared_ptr<Range> r_fluid_ptr, boost::shared_ptr<Range> r_solid_ptr,
1051 dMatFluidPtr(mat_d_fluid_ptr), dMatSolidPtr(mat_d_solid_ptr),
1052 dViscFluidPtr(mat_d_visc_fluid_ptr), dViscSolidPtr(mat_d_visc_solid_ptr),
1053 rFluidPtr(r_fluid_ptr), rSolidPtr(r_solid_ptr),
K(
K), C(C),
M(
M) {}
1060 auto t_normal = getFTensor1Normal();
1061 t_normal(
i) /= sqrt(t_normal(
j) * t_normal(
j));
1065 const auto in_the_loop =
1068 std::array<boost::shared_ptr<MatrixDouble>, 2> d_ptr;
1069 std::array<boost::shared_ptr<MatrixDouble>, 2> d_vis_ptr;
1071 std::array<std::vector<VectorInt>, 2> indices_side_map;
1072 std::array<std::vector<MatrixDouble>, 2> base_side_map;
1073 std::array<std::vector<MatrixDouble>, 2> diff_base_side_map;
1095 auto set_row_col = [&](
auto a,
auto b) {
1112 "Other side should be fluid");
1124 "Other side should be solid");
1134 "Side is not fluid or solid");
1146 const size_t nb_integration_pts = getGaussPts().size2();
1149 const double beta = 1. / (in_the_loop + 1);
1151 auto integrate = [&](
auto sense_row,
auto &row_ind,
auto &row,
auto &row_diff,
1152 auto sense_col,
auto &col_ind,
auto &col,
auto &col_diff,
1153 auto &d_row,
auto &d_col,
auto &d_vis_row,
1159 const auto nb_rows = row_ind.size();
1160 const auto nb_cols = col_ind.size();
1162 const auto nb_row_base_functions = row.size2();
1164 auto t_D_row = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(d_row);
1165 auto t_D_col = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(d_col);
1168 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(d_vis_row);
1170 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(d_vis_col);
1175 locMatK.resize(nb_rows, nb_cols,
false);
1177 locMatC.resize(nb_rows, nb_cols,
false);
1179 locMatM.resize(nb_rows, nb_cols,
false);
1188 t_P(
i,
j) = t_normal(
i) * t_normal(
j);
1190 auto t_w = getFTensor0IntegrationWeight();
1193 for (
size_t gg = 0; gg != nb_integration_pts; ++gg) {
1197 const double alpha = getMeasure() * t_w;
1201 for (; rr != nb_rows /
SPACE_DIM; ++rr) {
1203 auto get_vn_plus = [&](
auto &t_D) {
1205 t_vn_plus(
i,
j,
k) =
1207 (
t_kd(
i,
m) * t_D(
m,
j,
k,
l) * t_diff_row_base(
l));
1211 auto get_vn = [&]() {
1213 t_vn(
i,
j,
k) = t_normal(
j) * (
t_kd(
i,
k) * t_row_base * sense_row);
1217 auto t_vn_plus = get_vn_plus(t_D_row);
1218 auto t_vn = get_vn();
1219 auto t_vn_lambda_plus = get_vn_plus(t_vis_D_row);
1225 auto t_mat_K = getFTensor2FromArray<SPACE_DIM, SPACE_DIM, SPACE_DIM>(
1227 auto t_mat_C = getFTensor2FromArray<SPACE_DIM, SPACE_DIM, SPACE_DIM>(
1229 auto t_mat_M = getFTensor2FromArray<SPACE_DIM, SPACE_DIM, SPACE_DIM>(
1233 for (
size_t cc = 0; cc != nb_cols /
SPACE_DIM; ++cc) {
1235 auto get_un_plus = [&](
auto &t_D) {
1238 t_un_plus(
i,
j,
k) =
1239 beta * ((t_P(
i,
m) * t_D(
m,
j,
k,
l)) * t_diff_col_base(
l));
1243 auto get_un = [&]() {
1246 (t_normal(
j) * (t_P(
i,
k) * t_col_base * sense_col));
1250 auto t_un_plus = get_un_plus(t_D_col);
1251 auto t_un = get_un();
1252 auto t_un_lambda_plus = get_un_plus(t_vis_D_col);
1256 alpha * (t_vn(
m,
n,
i) - t_vn_plus(
m,
n,
i)) *
1257 ((-
p) * (t_un(
m,
n,
j) - (t_un_plus(
m,
n,
j) /
p)));
1258 t_mat_K(
i,
j) -= alpha * (t_vn_plus(
m,
n,
i) * t_un_plus(
m,
n,
j));
1262 alpha * (-t_vn_lambda_plus(
m,
n,
i)) *
1263 ((-
p) * (t_un(
m,
n,
j) - (t_un_plus(
m,
n,
j) /
p)));
1265 alpha * (t_vn_lambda_plus(
m,
n,
i) * t_un_plus(
m,
n,
j));
1268 t_mat_C(
i,
j) -= alpha * (t_vn(
m,
n,
i) - t_vn_plus(
m,
n,
i)) *
1269 ((-
p) * (t_un_lambda_plus(
m,
n,
j) / (-
p)));
1271 alpha * (t_vn_plus(
m,
n,
i) * t_un_lambda_plus(
m,
n,
j));
1274 t_mat_M(
i,
j) -= alpha * (-t_vn_lambda_plus(
m,
n,
i)) *
1275 ((-
p) * (t_un_lambda_plus(
m,
n,
j) / (-
p)));
1277 alpha * (t_vn_lambda_plus(
m,
n,
i) * t_un_lambda_plus(
m,
n,
j));
1292 for (; rr < nb_row_base_functions; ++rr) {
1302 CHKERR ::MatSetValues(
K, nb_rows, &*row_ind.begin(), col_ind.size(),
1303 &*col_ind.begin(), &*
locMatK.data().begin(),
1305 CHKERR ::MatSetValues(
C, nb_rows, &*row_ind.begin(), col_ind.size(),
1306 &*col_ind.begin(), &*
locMatC.data().begin(),
1308 CHKERR ::MatSetValues(
M, nb_rows, &*row_ind.begin(), col_ind.size(),
1309 &*col_ind.begin(), &*
locMatM.data().begin(),
1318 const auto sense_row =
senseMap[s0];
1320 for (
auto x0 = 0; x0 != indices_side_map[s0].size(); ++x0) {
1323 const auto sense_col =
senseMap[s1];
1325 for (
auto x1 = 0; x1 != indices_side_map[s1].size(); ++x1) {
1327 CHKERR integrate(sense_row, indices_side_map[s0][x0],
1328 base_side_map[s0][x0], diff_base_side_map[s0][x0],
1330 sense_col, indices_side_map[s1][x1],
1331 base_side_map[s1][x1], diff_base_side_map[s1][x1],
1333 *d_ptr[s0], *d_ptr[s1], *d_vis_ptr[s0],
#define MOFEM_LOG_C(channel, severity, format,...)
void simple(double P1[], double P2[], double P3[], double c[], const int N)
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
Kronecker Delta class symmetric.
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
#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 CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
auto get_diff_ntensor(T &base_mat)
std::array< std::vector< MatrixDouble >, 2 > baseUfSideMap
ElementsAndOps< SPACE_DIM >::DomainEleOp DomainEleOp
FTensor::Index< 'j', SPACE_DIM > j
static char help[]
[Postprocess results]
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM > OpMass
FTensor::Index< 'k', SPACE_DIM > k
std::array< std::vector< MatrixDouble >, 2 > baseUsSideMap
FTensor::Index< 'i', SPACE_DIM > i
auto get_ntensor(T &base_mat)
ElementsAndOps< SPACE_DIM >::SkeletonEle SkeletonEle
FTensor::Index< 'l', SPACE_DIM > l
std::array< double, 2 > areaMap
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradSymTensorGrad< 1, SPACE_DIM, SPACE_DIM, 0 > OpK
std::array< int, 2 > senseMap
std::array< std::vector< VectorInt >, 2 > indicesUfSideMap
FTensor::Index< 'n', SPACE_DIM > n
std::array< EntityHandle, 2 > sideHandle
std::array< std::vector< MatrixDouble >, 2 > diffUfBaseSideMap
FTensor::Index< 'm', SPACE_DIM > m
ElementsAndOps< SPACE_DIM >::FaceSideEle FaceSideEle
std::array< std::vector< MatrixDouble >, 2 > diffUsBaseSideMap
std::array< std::vector< VectorInt >, 2 > indicesUsSideMap
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
PetscErrorCode DMCreateMatrix_MoFEM(DM dm, Mat *M)
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
auto smartCreateDMVector(DM dm)
Get smart vector from DM.
virtual MoFEMErrorCode add_ents_to_finite_element_by_dim(const EntityHandle entities, const int dim, const std::string &name, const bool recursive=true)=0
add entities to finite element
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string name_row)=0
set field col which finite element use
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_filed)=0
set finite element field data
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string name_row)=0
set field row which finite element use
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.
virtual MoFEMErrorCode loop_finite_elements(const std::string problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)=0
Make a loop over finite elements.
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
auto marker
set bit to marker
const double v
phase velocity of light in medium (cm/ns)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
SmartPetscObj< Mat > smartMatDuplicate(Mat &mat, MatDuplicateOption op)
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
SmartPetscObj< Vec > smartVectorDuplicate(SmartPetscObj< Vec > &vec)
Create duplicate vector of smart vector.
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
#define EXECUTABLE_DIMENSION
constexpr IntegrationType G
std::array< double, 2 > areaMap
std::array< int, 2 > senseMap
constexpr auto field_name
static constexpr int approx_order
MoFEM::Interface & mField
MoFEMErrorCode setupProblem()
[Read mesh]
MoFEMErrorCode assembleSystem()
[Boundary condition]
boost::shared_ptr< MatrixDouble > matDFluidPtr
MoFEMErrorCode createCommonData()
[Create common data]
boost::shared_ptr< MatrixDouble > matDFViscSolidPtr
MoFEMErrorCode runProblem()
[Create common data]
boost::shared_ptr< MatrixDouble > matDFViscFluidPtr
boost::shared_ptr< MatrixDouble > matStressPtr
boost::shared_ptr< MatrixDouble > matDSolidPtr
boost::shared_ptr< MatrixDouble > matGradPtr
FSI(MoFEM::Interface &m_field)
MoFEMErrorCode solveSystem()
[Push operators to pipeline]
MoFEMErrorCode boundaryCondition()
[Set up problem]
boost::shared_ptr< MatrixDouble > matStrainPtr
MoFEMErrorCode outputResults()
[Solve]
MoFEMErrorCode readMesh()
[Run problem]
Simple interface for fast problem set-up.
BcMapByBlockName & getBcMapByBlockName()
Get the bc map.
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
base operator to do operations at Gauss Pt. level
Deprecated interface functions.
default operator for EDGE element
Data on single entity (This is passed as argument to DataOperator::doWork)
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorInt & getIndices() const
Get global indices of dofs on entity.
default operator for TRI element
default operator for Face element
Base face element used to integrate on skeleton.
@ OPSPACE
operator do Work is execute on space data
Section manager is used to create indexes and sections.
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.
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
Get values at integration pts for tensor filed rank 1, i.e. vector field.
Post post-proc data at points from hash maps.
std::map< std::string, boost::shared_ptr< VectorDouble > > DataMapVec
std::map< std::string, boost::shared_ptr< MatrixDouble > > DataMapMat
Set inverse jacobian to base functions.
Modify integration weights on face to take in account higher-order geometry.
PipelineManager interface.
Problem manager is used to build and partition problems.
Simple interface for fast problem set-up.
intrusive_ptr for managing petsc objects
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
Volume finite element base.
default operator for TET element
Base volume element used to integrate on skeleton.
Operator tp collect data from elements on the side of Edge/Face.
OpCalculateSideData(std::string field_name, std::string col_field_name, UserDataOperator::OpType type)
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator the left hand side matrix.
boost::shared_ptr< MatrixDouble > dMatSolidPtr
boost::shared_ptr< Range > rSolidPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
OpLhsSkeleton(boost::shared_ptr< FaceSideEle > side_fe_ptr, boost::shared_ptr< MatrixDouble > d_mat_fluid_ptr, boost::shared_ptr< MatrixDouble > d_mat_solid_ptr, boost::shared_ptr< MatrixDouble > d_mat_visc_fluid_ptr, boost::shared_ptr< MatrixDouble > d_mat_visc_solid_ptr, boost::shared_ptr< Range > r_visc_fluid_ptr, boost::shared_ptr< Range > r_visc_solid_ptr, SmartPetscObj< Mat > K, SmartPetscObj< Mat > C, SmartPetscObj< Mat > M)
Construct a new OpH1LhsSkeleton.
boost::shared_ptr< MatrixDouble > dMatFluidPtr
boost::shared_ptr< Range > rFluidPtr
boost::shared_ptr< MatrixDouble > dViscSolidPtr
boost::shared_ptr< FaceSideEle > sideFEPtr
pointer to element to get data on edge/face sides
boost::shared_ptr< MatrixDouble > dViscFluidPtr
Post post-proc data at points from hash maps.