7#include <moab/Error.hpp>
16 const boost::shared_ptr<Field> field_ptr,
17 const boost::shared_ptr<RefEntity> ref_ents_ptr,
18 boost::shared_ptr<double *const> field_data_adaptor_ptr,
19 boost::shared_ptr<const int> t_max_order_ptr)
21 tagMaxOrderPtr(t_max_order_ptr),
22 fieldDataAdaptorPtr(field_data_adaptor_ptr) {
25 ref_ents_ptr->getEnt());
36 const boost::shared_ptr<Field> &field_ptr,
37 const boost::shared_ptr<RefEntity> &ref_ents_ptr) {
40 switch (ref_ents_ptr->getEntType()) {
42 size = field_ptr->getNbOfCoeffs();
45 ref_ents_ptr->ent, &size));
49 field_ptr->moab, field_ptr->th_FieldData, ref_ents_ptr->ent, &size));
51 return boost::make_shared<FieldData *const>(ptr);
65 moab::Interface &moab = e->
sPtr->getBasicDataPtr()->moab;
70 double *tag_field_data =
nullptr;
71 int tag_field_data_size = 0;
73 auto set_verts = [&]() {
77 1, (
const void **)&tag_field_data,
78 &tag_field_data_size);
80 if (nb_dofs != tag_field_data_size) {
85 }
else if (
rval == MB_SUCCESS) {
92 1, (
const void **)&tag_field_data);
100 auto set_default = [&]() {
105 (
const void **)&tag_field_data,
106 &tag_field_data_size);
109 nb_dofs > tag_field_data_size) {
112 if (
rval == MB_SUCCESS) {
115 data.resize(tag_field_data_size);
118 static_cast<FieldData *
>(tag_field_data) + tag_field_data_size;
119 std::copy(ptr_begin, ptr_end,
data.begin());
122 if (
rval != MB_SUCCESS || nb_dofs) {
125 data.resize(nb_dofs, 0);
127 tag_size[0] =
data.size();
128 void const *tag_data[] = {&
data[0]};
133 (
const void **)&tag_field_data,
134 &tag_field_data_size);
#define MOAB_THROW(err)
Check error code of MoAB function and throw MoFEM exception.
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
int ApproximationOrder
Approximation on the entity.
implementation of Data Operators for Forces and Sources
std::ostream & operator<<(std::ostream &os, const EntitiesFieldData::EntData &e)
void * get_tag_ptr(moab::Interface &moab, Tag th, EntityHandle ent, int *tag_size)
Get the tag ptr object.
const ApproximationOrder order
void operator()(boost::shared_ptr< FieldEntity > &e)
std::vector< FieldData > data
Struct keeps handle to entity in the field.
static constexpr int dof_shift
UId getLocalUniqueIdCalculate()
Get the Local Unique Id Calculate object.
boost::shared_ptr< FieldData *const > fieldDataAdaptorPtr
static boost::shared_ptr< FieldData *const > makeSharedFieldDataAdaptorPtr(const boost::shared_ptr< Field > &field_ptr, const boost::shared_ptr< RefEntity > &ref_ents_ptr)
Return shared pointer to entity field data vector adaptor.
static constexpr int proc_shift
boost::shared_ptr< FieldData *const > & getEntFieldDataPtr() const
Get shared ptr to vector adaptor pointing to the field tag data on entity.
FieldEntity(const boost::shared_ptr< Field > field_ptr, const boost::shared_ptr< RefEntity > ref_ents_ptr, boost::shared_ptr< double *const > field_data_adaptor_ptr, boost::shared_ptr< const int > t_max_order_ptr)
ApproximationOrder getMaxOrder() const
Get order set to the entity (Allocated tag size for such number)
const ApproximationOrder * getMaxOrderPtr() const
Get pinter to Tag keeping approximation order.
UId localUId
Local unique id for this entity. Unique on CPU partition.
static constexpr int ent_shift
const UId & getLocalUniqueId() const
Get global unique id.
int getOrderNbDofs(ApproximationOrder order) const
Get number of DOFs on entity for given order of approximation.
boost::shared_ptr< const ApproximationOrder > tagMaxOrderPtr
Field data structure for finite element approximation.
Tag th_FieldData
Tag for field values on entities.
Tag th_FieldDataVerts
Tag for field values on vertices.
TagType tagFieldDataVertsType
Tag type for vertex data storage.
Struct keeps handle to refined handle.
Field interface with separate field and reference entity types.
FieldCoefficientsNumber getNbOfCoeffs() const
Get number of coefficients per DOF.
const Field * getFieldRawPtr() const
Get raw field pointer.
const char * getEntTypeName() const
boost::shared_ptr< T > sPtr
EntityHandle getOwnerEnt() const
EntityType getEntType() const
unsigned char getPStatus() const
EntityHandle getEnt() const