v0.15.4
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
approx_sphere.cpp File Reference
#include <MoFEM.hpp>

Go to the source code of this file.

Classes

struct  ElementsAndOps< DIM >
 
struct  ElementsAndOps< 2 >
 
struct  OpRhs
 
struct  OpLhs
 
struct  OpError
 
struct  ApproxSphere
 

Typedefs

using DomainEle = ElementsAndOps< FM_DIM >::DomainEle
 
using DomainEleOp = DomainEle::UserDataOperator
 
using EntData = EntitiesFieldData::EntData
 
using AssemblyDomainEleOp = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::OpBase
 

Functions

int main (int argc, char *argv[])
 [Postprocess results]
 

Variables

static char help [] = "...\n\n"
 
constexpr int FM_DIM = 2
 
constexpr double a = 1
 
constexpr double a2 = a * a
 
constexpr double a4 = a2 * a2
 
constexpr double A = 6371220
 
FTensor::Index< 'i', 3 > i
 
FTensor::Index< 'j', 3 > j
 
FTensor::Index< 'k', 3 > k
 
auto res_J
 
auto res_J_dx
 
auto lhs_J_dx2
 

Typedef Documentation

◆ AssemblyDomainEleOp

Definition at line 27 of file approx_sphere.cpp.

◆ DomainEle

Definition at line 23 of file approx_sphere.cpp.

◆ DomainEleOp

Definition at line 24 of file approx_sphere.cpp.

◆ EntData

Definition at line 25 of file approx_sphere.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

[Postprocess results]

[Register MoFEM discrete manager in PETSc]

[Register MoFEM discrete manager in PETSc

[Create MoAB]

< mesh database

< mesh database interface

[Create MoAB]

[Create MoFEM]

< finite element database

< finite element database insterface

[Create MoFEM]

[ApproxSphere]

[ApproxSphere]

Definition at line 473 of file approx_sphere.cpp.

473 {
474
475 // Initialisation of MoFEM/PETSc and MOAB data structures
476 const char param_file[] = "param_file.petsc";
477 MoFEM::Core::Initialize(&argc, &argv, param_file, help);
478
479 auto core_log = logging::core::get();
480 core_log->add_sink(
482 LogManager::setLog("EXAMPLE");
483 MOFEM_LOG_TAG("EXAMPLE", "example");
484
485 try {
486
487 //! [Register MoFEM discrete manager in PETSc]
488 DMType dm_name = "DMMOFEM";
489 CHKERR DMRegister_MoFEM(dm_name);
490 //! [Register MoFEM discrete manager in PETSc
491
492 //! [Create MoAB]
493 moab::Core mb_instance; ///< mesh database
494 moab::Interface &moab = mb_instance; ///< mesh database interface
495 //! [Create MoAB]
496
497 //! [Create MoFEM]
498 MoFEM::Core core(moab); ///< finite element database
499 MoFEM::Interface &m_field = core; ///< finite element database insterface
500 //! [Create MoFEM]
501
502 //! [ApproxSphere]
503 ApproxSphere ex(m_field);
504 CHKERR ex.runProblem();
505 //! [ApproxSphere]
506 }
508
510}
static char help[]
#define CATCH_ERRORS
Catch errors.
#define CHKERR
Inline error check.
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition DMMoFEM.cpp:43
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Core (interface) class.
Definition Core.hpp:82
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:72
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:118
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.

Variable Documentation

◆ a

constexpr double a = 1
constexpr
Examples
HenckyOps.hpp, PlasticOpsGeneric.hpp, mofem/atom_tests/matrix_function.cpp, mofem/atom_tests/prism_polynomial_approximation.cpp, mofem/atom_tests/quad_polynomial_approximation.cpp, mofem/tutorials/adv-0_plasticity/plastic.cpp, mofem/tutorials/adv-0_plasticity/src/PlasticOpsGeneric.hpp, mofem/tutorials/adv-5_poroelasticity/src/SeepageOps.hpp, mofem/tutorials/cor-0to1_unsaturated_transport/src/UnsaturatedFlow.hpp, mofem/tutorials/cor-2to5_analytical_poisson/analytical_poisson_field_split.cpp, mofem/tutorials/cor-2to5_analytical_poisson/src/PoissonOperators.hpp, mofem/tutorials/cor-6_simple_elasticity/simple_elasticity.cpp, mofem/tutorials/cor-9_reaction_diffusion/reaction_diffusion.cpp, mofem/tutorials/scl-1_poisson_2d_homogeneous/src/poisson_2d_homogeneous.hpp, mofem/tutorials/scl-6_heat_equation/heat_equation.cpp, mofem/tutorials/scl-9_heat_method/heat_method.cpp, mofem/tutorials/vec-2_nonlinear_elasticity/src/HenckyOps.hpp, mofem/tutorials/vec-4_shallow_wave/approx_sphere.cpp, mofem/tutorials/vec-4_shallow_wave/shallow_wave.cpp, mofem/tutorials/vec-5_free_surface/free_surface.cpp, mofem/tutorials/vec-6_dg_kirchhoff_plate/plate.cpp, mofem/tutorials/vec-7_shape_optimisation/adjoint.cpp, mofem/users_modules/adolc-plasticity/adolc_plasticity.cpp, mofem/users_modules/basic_finite_elements/src/HookeElement.hpp, mofem/users_modules/basic_finite_elements/src/impl/HookeElement.cpp, mofem/users_modules/bone_remodelling/src/impl/Remodeling.cpp, mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianOperators.cpp, plastic.cpp, and thermoplastic.cpp.

Definition at line 30 of file approx_sphere.cpp.

◆ A

constexpr double A = 6371220
constexpr

◆ a2

constexpr double a2 = a * a
constexpr

Definition at line 31 of file approx_sphere.cpp.

◆ a4

constexpr double a4 = a2 * a2
constexpr

Definition at line 32 of file approx_sphere.cpp.

◆ FM_DIM

constexpr int FM_DIM = 2
constexpr

◆ help

char help[] = "...\n\n"
static

Definition at line 11 of file approx_sphere.cpp.

◆ i

FTensor::Index<'i', 3> i

◆ j

FTensor::Index<'j', 3> j

◆ k

FTensor::Index<'k', 3> k

◆ lhs_J_dx2

auto lhs_J_dx2
Initial value:
= [](const double x, const double y, const double z) {
const double res = res_J(x, y, z);
(res * 2 + (4 * x * x)),
(4 * y * x),
(4 * z * x),
(4 * x * y),
(2 * res + (4 * y * y)),
(4 * z * y),
(4 * x * z),
(4 * y * z),
(2 * res + (4 * z * z))};
}
auto res_J
Examples
mofem/tutorials/vec-4_shallow_wave/approx_sphere.cpp.

Definition at line 51 of file approx_sphere.cpp.

51 {
52 const double res = res_J(x, y, z);
54
55 (res * 2 + (4 * x * x)),
56 (4 * y * x),
57 (4 * z * x),
58
59 (4 * x * y),
60 (2 * res + (4 * y * y)),
61 (4 * z * y),
62
63 (4 * x * z),
64 (4 * y * z),
65 (2 * res + (4 * z * z))};
66};

◆ res_J

auto res_J
Initial value:
= [](const double x, const double y, const double z) {
const double res = (x * x + y * y + z * z - a2);
return res;
}
constexpr double a2
Examples
mofem/tutorials/vec-4_shallow_wave/approx_sphere.cpp.

Definition at line 40 of file approx_sphere.cpp.

40 {
41 const double res = (x * x + y * y + z * z - a2);
42 return res;
43};

◆ res_J_dx

auto res_J_dx
Initial value:
= [](const double x, const double y, const double z) {
const double res = res_J(x, y, z);
return FTensor::Tensor1<double, 3>{res * (2 * x), res * (2 * y),
res * (2 * z)};
}
Examples
mofem/tutorials/vec-4_shallow_wave/approx_sphere.cpp.

Definition at line 45 of file approx_sphere.cpp.

45 {
46 const double res = res_J(x, y, z);
47 return FTensor::Tensor1<double, 3>{res * (2 * x), res * (2 * y),
48 res * (2 * z)};
49};