|
| v0.14.0
|
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
◆ Ele
◆ EleOp
◆ OpDomainMass
◆ OpDomainSource
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
- Examples
- hdiv_check_approx_in_3d.cpp.
Definition at line 129 of file hdiv_check_approx_in_3d.cpp.
135 DMType dm_name =
"DMMOFEM";
151 enum bases { AINSWORTH, DEMKOWICZ, LASBASETOP };
152 const char *list_bases[] = {
"ainsworth",
"demkowicz"};
154 PetscInt choice_base_value = AINSWORTH;
156 LASBASETOP, &choice_base_value, &flg);
158 if (flg != PETSC_TRUE)
161 if (choice_base_value == AINSWORTH)
163 else if (choice_base_value == DEMKOWICZ)
166 AinsworthOrderHooks::broken_nbfacetri_edge_hdiv = [](
int p) {
return p; };
167 AinsworthOrderHooks::broken_nbfacetri_face_hdiv = [](
int p) {
return p; };
168 AinsworthOrderHooks::broken_nbvolumetet_edge_hdiv = [](
int p) {
return p; };
169 AinsworthOrderHooks::broken_nbvolumetet_face_hdiv = [](
int p) {
return p; };
170 AinsworthOrderHooks::broken_nbvolumetet_volume_hdiv = [](
int p) {
175 constexpr
int order = 4;
178 auto dm =
simple->getDM();
182 auto assemble_matrices_and_vectors = [&]() {
186 pipeline_mng->getOpDomainRhsPipeline(), {HDIV});
187 pipeline_mng->getOpDomainRhsPipeline().push_back(
191 pipeline_mng->getOpDomainLhsPipeline(), {HDIV});
192 pipeline_mng->getOpDomainLhsPipeline().push_back(
195 [](
double x,
double,
double) {
return 1; })
200 return 2 * p_data + 1;
208 auto solve_problem = [&] {
210 auto solver = pipeline_mng->createKSP();
211 CHKERR KSPSetFromOptions(solver);
218 CHKERR VecGhostUpdateBegin(
D, INSERT_VALUES, SCATTER_FORWARD);
219 CHKERR VecGhostUpdateEnd(
D, INSERT_VALUES, SCATTER_FORWARD);
224 auto check_solution = [&] {
227 pipeline_mng->getOpDomainLhsPipeline().clear();
228 pipeline_mng->getOpDomainRhsPipeline().clear();
230 auto ptr_values = boost::make_shared<MatrixDouble>();
231 auto ptr_grad = boost::make_shared<MatrixDouble>();
235 pipeline_mng->getOpDomainRhsPipeline(), {HDIV});
238 pipeline_mng->getOpDomainRhsPipeline().push_back(
241 pipeline_mng->getOpDomainRhsPipeline().push_back(
244 pipeline_mng->getOpDomainRhsPipeline().push_back(
247 CHKERR pipeline_mng->loopFiniteElements();
252 CHKERR assemble_matrices_and_vectors();
◆ a0
◆ a1
◆ a2
◆ a3
◆ a4
◆ a5
◆ a6
◆ BASE_DIM
constexpr int BASE_DIM = 3 |
|
constexpr |
◆ help
◆ SPACE_DIM
constexpr int SPACE_DIM = 3 |
|
constexpr |
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
FormsIntegrators< EleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< BASE_DIM, SPACE_DIM > OpDomainMass
OPerator to integrate mass matrix for least square approximation.
UBlasMatrix< double > MatrixDouble
PipelineManager interface.
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
static FTensor::Tensor1< double, BASE_DIM > fUn(const double x, const double y, double z)
Simple interface for fast problem set-up.
Calculate gradient of vector field.
Deprecated interface functions.
DeprecatedCoreInterface Interface
#define CHKERR
Inline error check.
FormsIntegrators< EleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< BASE_DIM, SPACE_DIM > OpDomainSource
Operator to integrate the right hand side matrix for the problem.
auto createDMVector(DM dm)
Get smart vector from DM.
Get vector field for H-div approximation.
void simple(double P1[], double P2[], double P3[], double c[], const int N)
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Add operators pushing bases from local to physical configuration.
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
FieldApproximationBase
approximation base
const double D
diffusivity
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ HDIV
field with continuous normal traction
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...