|
| v0.14.0
|
Go to the documentation of this file.
12 : mField(m_field), fieldName(
field_name), vErbose(verb) {}
19 <<
"Only working well for first order AINSWORTH_BERNSTEIN_BEZIER_BASE!";
33 if (
dofPtr->getEntType() == MBVERTEX) {
40 "val = %6.7e\n",
dofPtr->getFieldData());
46 if (
dofPtr->getEntType() != MBEDGE) {
49 if (
dofPtr->getEntDofIdx() !=
dofPtr->getDofCoeffIdx()) {
55 "this method works only elements which are type of MBEDGE");
61 if ((num_nodes != 2) && (num_nodes != 3)) {
63 "this method works only 4 node and 10 node tets");
65 coords.resize(num_nodes * 3);
69 for (
int dd = 0;
dd < 3;
dd++) {
78 const auto base =
dofPtr->getApproxBase();
79 double edge_shape_function_val;
82 edge_shape_function_val = 0.25;
100 if (
dofPtr->getNbOfCoeffs() > 3) {
102 "this method works only fields which are rank 3 or lower");
115 std::string _fieldName,
120 onCoords(on_coords), onTag(on_tag), maxApproximationOrder(20) {}
123 Field_multiIndex::index<FieldName_mi_tag>::type::iterator
field_it;
130 if (
onTag ==
"NoNE") {
132 "tag name not specified");
139 int field_rank = (*field_it)->getNbOfCoeffs();
140 VectorDouble def_VAL = ublas::zero_vector<double>(field_rank);
142 onTag.c_str(), field_rank, MB_TYPE_DOUBLE,
th,
143 MB_TAG_CREAT | MB_TAG_SPARSE, &*def_VAL.data().begin());
149 &*
L.data().begin(), NULL, 3);
161 if (
dofPtr->getEntType() == MBVERTEX) {
169 int field_rank = (*field_it)->getNbOfCoeffs();
170 if (field_rank !=
dofPtr->getNbOfCoeffs()) {
172 "data inconsistency");
177 th, &node, 1, (
const void **)&tag_value, &tag_size);
178 if (tag_size !=
dofPtr->getNbOfCoeffs()) {
179 SETERRQ(PETSC_COMM_SELF, 1,
"data inconsistency");
181 tag_value[
dofPtr->getDofCoeffIdx()] =
dofPtr->getFieldData();
186 if (
dofPtr->getEntType() != MBEDGE) {
192 "this method works only elements which are type of MBEDGE");
198 if ((num_nodes != 2) && (num_nodes != 3)) {
200 "this method works only 4 node and 10 node tets");
202 if (num_nodes == 2) {
208 "too big approximation order, increase constant "
209 "max_ApproximationOrder");
211 double approx_val = 0;
215 approx_val = 0.25 *
L[
dofPtr->getDofOrder() - 2] *
dofPtr->getFieldData();
218 approx_val = 0.25 *
K[
dofPtr->getDofOrder() - 2] *
dofPtr->getFieldData();
225 coords.resize(num_nodes * 3);
228 if (
dofPtr->getEntDofIdx() ==
dofPtr->getDofCoeffIdx()) {
230 double ave_mid = (
coords[3 * 0 +
dofPtr->getDofCoeffIdx()] +
239 double *tag_value[num_nodes];
241 th, conn, num_nodes, (
const void **)tag_value, &tag_size);
242 if (tag_size !=
dofPtr->getNbOfCoeffs()) {
245 if (
dofPtr->getEntDofIdx() ==
dofPtr->getDofCoeffIdx()) {
247 double ave_mid = (tag_value[0][
dofPtr->getDofCoeffIdx()] +
248 tag_value[1][
dofPtr->getDofCoeffIdx()]) *
250 tag_value[2][
dofPtr->getDofCoeffIdx()] = ave_mid;
252 tag_value[2][
dofPtr->getDofCoeffIdx()] += approx_val;
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
MoFEMErrorCode postProcess()
function is run at the end of loop
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
virtual const Field * get_field_structure(const std::string &name, enum MoFEMTypes bh=MF_EXIST) const =0
get field structure
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
const int maxApproximationOrder
MultiIndex Tag for field name.
Projection of edge entities with one mid-node on hierarchical basis.
#define MOAB_THROW(err)
Check error code of MoAB function and throw MoFEM exception.
boost::shared_ptr< DofEntity > dofPtr
Field_multiIndex::index< FieldName_mi_tag >::type::iterator field_it
Deprecated interface functions.
const Field_multiIndex * fieldsPtr
raw pointer to fields container
MoFEMErrorCode preProcess()
function is run at the beginning of loop
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
#define CHKERR
Inline error check.
virtual moab::Interface & get_moab()=0
implementation of Data Operators for Forces and Sources
VectorDouble3 aveMidCoord
auto type_from_handle(const EntityHandle h)
get type from entity handle
PetscErrorCode Legendre_polynomials(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
Calculate Legendre approximation basis.
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")
constexpr auto field_name
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
PetscErrorCode LobattoKernel_polynomials(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
Calculate Kernel Lobatto base functions.
#define LOBATTO_PHI0(x)
Definitions taken from Hermes2d code.
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)
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define MOFEM_TAG_AND_LOG_C(channel, severity, tag, format,...)
Tag and log in channel.
MoFEMErrorCode operator()()
function is run for every finite element
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ MOFEM_DATA_INCONSISTENCY
FieldApproximationBase
approximation base
UBlasVector< double > VectorDouble
MoFEMErrorCode operator()()
function is run for every finite element
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Field_multiIndex::index< FieldName_mi_tag >::type::iterator field_it
Projection10NodeCoordsOnField(Interface &m_field, std::string field_name, int verb=0)
VectorDouble3 midNodeCoord
VectorDouble3 diffNodeCoord