v0.14.0
Loading...
Searching...
No Matches
EntPolynomialBaseCtx.cpp
Go to the documentation of this file.
1/** \file EntPolynomialBaseCtx.cpp
2\brief Implementation of Ainsworth-Cole H1 base on tetrahedral
3
4*/
5
6
7
8using namespace MoFEM;
9
11EntPolynomialBaseCtx::query_interface(boost::typeindex::type_index type_index,
12 UnknownInterface **iface) const {
13 *iface = const_cast<EntPolynomialBaseCtx *>(this);
14 return 0;
15}
16
18 EntitiesFieldData &data, const FieldSpace space,
19 const FieldApproximationBase base,
20 const FieldApproximationBase copy_node_base)
21 : dAta(data), sPace(space), bAse(base), copyNodeBase(copy_node_base) {
22 ierr = setBase();
23 CHKERRABORT(PETSC_COMM_WORLD, ierr);
24}
25
27 EntitiesFieldData &data, const std::string field_name,
28 const FieldSpace space, const FieldApproximationBase base,
29 const FieldApproximationBase copy_node_base)
30 : dAta(data), sPace(space), bAse(base), fieldName(field_name),
31 copyNodeBase(copy_node_base) {
32 ierr = setBase();
33 CHKERRABORT(PETSC_COMM_WORLD, ierr);
34}
35
38 switch (bAse) {
40 switch (sPace) {
41 case NOSPACE:
42 case NOFIELD:
43 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Makes no sense");
44 case H1:
45 case HCURL:
46 case HDIV:
47 case L2:
49 break;
50 default:
51 SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
52 "Not implemented for this space", FieldSpaceNames[sPace]);
53 }
54 break;
56 switch (sPace) {
57 case NOSPACE:
58 case NOFIELD:
59 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Makes no sense");
60 case H1:
61 case HCURL:
62 case HDIV:
63 case L2:
65 break;
66 default:
67 SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
68 "Not implemented for this space", FieldSpaceNames[sPace]);
69 }
70 break;
72 if(fieldName.empty())
73 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Field name not set");
74 switch (sPace) {
75 case NOSPACE:
76 case NOFIELD:
77 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Makes no sense");
78 case H1:
79 case L2:
80 break;
81 default:
82 SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
83 "Not implemented for this space", FieldSpaceNames[sPace]);
84 }
85 break;
87 switch (sPace) {
88 case NOSPACE:
89 case NOFIELD:
90 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Makes no sense");
91 case H1:
92 case HCURL:
93 case HDIV:
94 case L2:
96 break;
97 default:
98 SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
99 "Not implemented for this space",
101 }
102 break;
103 case USER_BASE:
104 break;
105 default:
106 SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
107 "Not implemented for this base <%s>",
109 }
111}
PetscErrorCode Jacobi_polynomials(int p, double alpha, double x, double t, double *diff_x, double *diff_t, double *L, double *diffL, const int dim)
Calculate Jacobi approximation basis.
FieldApproximationBase
approximation base
Definition: definitions.h:58
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:60
@ AINSWORTH_LOBATTO_BASE
Definition: definitions.h:62
@ USER_BASE
user implemented approximation base
Definition: definitions.h:68
@ DEMKOWICZ_JACOBI_BASE
Definition: definitions.h:66
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
Definition: definitions.h:64
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
FieldSpace
approximation spaces
Definition: definitions.h:82
@ L2
field with C-1 continuity
Definition: definitions.h:88
@ NOFIELD
scalar or vector of scalars describe (no true field)
Definition: definitions.h:84
@ H1
continuous field
Definition: definitions.h:85
@ NOSPACE
Definition: definitions.h:83
@ HCURL
field with continuous tangents
Definition: definitions.h:86
@ HDIV
field with continuous normal traction
Definition: definitions.h:87
static const char *const FieldSpaceNames[]
Definition: definitions.h:92
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
static const char *const ApproximationBaseNames[]
Definition: definitions.h:72
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
PetscErrorCode Legendre_polynomials(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
Calculate Legendre approximation basis.
PetscErrorCode LobattoKernel_polynomials(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
Calculate Kernel Lobatto base functions.
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
constexpr auto field_name
Class used to pass element data to calculate base functions on tet,triangle,edge.
EntPolynomialBaseCtx(EntitiesFieldData &data, const FieldSpace space, const FieldApproximationBase base, const FieldApproximationBase copy_node_base=LASTBASE)
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
PetscErrorCode(* basePolynomialsType0)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
PetscErrorCode(* basePolynomialsType1)(int p, double alpha, double x, double t, double *diff_x, double *diff_t, double *L, double *diffL, const int dim)
const FieldApproximationBase bAse
data structure for finite element entity
base class for all interface classes