23 Interface &m_field, std::string field_name,
int verb)
24 : mField(m_field), fieldName(field_name), vErbose(verb) {}
31 <<
"Only working well for first order AINSWORTH_BERNSTEIN_BEZIER_BASE!";
45 if (
dofPtr->getEntType() == MBVERTEX) {
52 "val = %6.7e\n",
dofPtr->getFieldData());
58 if (
dofPtr->getEntType() != MBEDGE) {
61 if (
dofPtr->getEntDofIdx() !=
dofPtr->getDofCoeffIdx()) {
67 "this method works only elements which are type of MBEDGE");
73 if ((num_nodes != 2) && (num_nodes != 3)) {
75 "this method works only 4 node and 10 node tets");
77 coords.resize(num_nodes * 3);
81 for (
int dd = 0;
dd < 3;
dd++) {
90 const auto base =
dofPtr->getApproxBase();
91 double edge_shape_function_val;
94 edge_shape_function_val = 0.25;
112 if (
dofPtr->getNbOfCoeffs() != 3) {
114 "this method works only fields which are rank 3");
127 std::string _fieldName,
132 onCoords(on_coords), onTag(on_tag), maxApproximationOrder(20) {}
135 Field_multiIndex::index<FieldName_mi_tag>::type::iterator
field_it;
142 if (
onTag ==
"NoNE") {
144 "tag name not specified");
151 int field_rank = (*field_it)->getNbOfCoeffs();
152 VectorDouble def_VAL = ublas::zero_vector<double>(field_rank);
154 onTag.c_str(), field_rank, MB_TYPE_DOUBLE,
th,
155 MB_TAG_CREAT | MB_TAG_SPARSE, &*def_VAL.data().begin());
161 &*
L.data().begin(), NULL, 3);
173 if (
dofPtr->getEntType() == MBVERTEX) {
181 int field_rank = (*field_it)->getNbOfCoeffs();
182 if (field_rank !=
dofPtr->getNbOfCoeffs()) {
184 "data inconsistency");
189 th, &node, 1, (
const void **)&tag_value, &tag_size);
190 if (tag_size !=
dofPtr->getNbOfCoeffs()) {
191 SETERRQ(PETSC_COMM_SELF, 1,
"data inconsistency");
193 tag_value[
dofPtr->getDofCoeffIdx()] =
dofPtr->getFieldData();
198 if (
dofPtr->getEntType() != MBEDGE) {
204 "this method works only elements which are type of MBEDGE");
210 if ((num_nodes != 2) && (num_nodes != 3)) {
212 "this method works only 4 node and 10 node tets");
214 if (num_nodes == 2) {
220 "too big approximation order, increase constant "
221 "max_ApproximationOrder");
223 double approx_val = 0;
227 approx_val = 0.25 *
L[
dofPtr->getDofOrder() - 2] *
dofPtr->getFieldData();
230 approx_val = 0.25 *
K[
dofPtr->getDofOrder() - 2] *
dofPtr->getFieldData();
237 coords.resize(num_nodes * 3);
240 if (
dofPtr->getEntDofIdx() ==
dofPtr->getDofCoeffIdx()) {
242 double ave_mid = (
coords[3 * 0 +
dofPtr->getDofCoeffIdx()] +
251 double *tag_value[num_nodes];
253 th, conn, num_nodes, (
const void **)tag_value, &tag_size);
254 if (tag_size !=
dofPtr->getNbOfCoeffs()) {
257 if (
dofPtr->getEntDofIdx() ==
dofPtr->getDofCoeffIdx()) {
259 double ave_mid = (tag_value[0][
dofPtr->getDofCoeffIdx()] +
260 tag_value[1][
dofPtr->getDofCoeffIdx()]) *
262 tag_value[2][
dofPtr->getDofCoeffIdx()] = ave_mid;
264 tag_value[2][
dofPtr->getDofCoeffIdx()] += approx_val;
#define MOFEM_TAG_AND_LOG_C(channel, severity, tag, format,...)
Tag and log in channel.
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define LOBATTO_PHI0(x)
Definitions taken from Hermes2d code.
FieldApproximationBase
approximation base
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
#define MOAB_THROW(err)
Check error code of MoAB function and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ MOFEM_DATA_INCONSISTENCY
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
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.
virtual Field * get_field_structure(const std::string &name)=0
get field structure
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasVector< double > VectorDouble
implementation of Data Operators for Forces and Sources
auto type_from_handle
get type from entity handle
Field_multiIndex::index< FieldName_mi_tag >::type::iterator field_it
const Field_multiIndex * fieldsPtr
raw pointer to fields container
virtual moab::Interface & get_moab()=0
Deprecated interface functions.
boost::shared_ptr< DofEntity > dofPtr
MultiIndex Tag for field name.
Projection of edge entities with one mid-node on hierarchical basis.
VectorDouble3 diffNodeCoord
VectorDouble3 midNodeCoord
MoFEMErrorCode postProcess()
function is run at the end of loop
VectorDouble3 aveMidCoord
MoFEMErrorCode operator()()
function is run for every finite element
Projection10NodeCoordsOnField(Interface &m_field, std::string field_name, int verb=0)
MoFEMErrorCode preProcess()
function is run at the beginning of loop
MoFEMErrorCode preProcess()
function is run at the beginning of loop
ProjectionFieldOn10NodeTet(Interface &m_field, std::string _fieldName, bool set_nodes, bool on_coords, std::string on_tag="NoNE")
MoFEMErrorCode operator()()
function is run for every finite element
const int maxApproximationOrder
Field_multiIndex::index< FieldName_mi_tag >::type::iterator field_it