|
| v0.14.0
|
Go to the documentation of this file.
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);
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);
std::ostream & operator<<(std::ostream &os, const EntitiesFieldData::EntData &e)
TagType tagFieldDataVertsType
void * get_tag_ptr(moab::Interface &moab, Tag th, EntityHandle ent, int *tag_size)
Get the tag ptr object.
int getOrderNbDofs(ApproximationOrder order) const
Get number of DOFs on entity for given order of approximation.
const ApproximationOrder order
Struct keeps handle to refined handle.
boost::shared_ptr< T > sPtr
Tag th_FieldData
Tag storing field values on entity in the field.
EntityHandle getEnt() const
Get the entity handle.
#define MOAB_THROW(err)
Check error code of MoAB function and throw MoFEM exception.
unsigned char getPStatus() const
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
boost::shared_ptr< FieldData *const > & getEntFieldDataPtr() const
Get shared ptr to vector adaptor pointing to the field tag data on entity.
Provide data structure for (tensor) field approximation.
DeprecatedCoreInterface Interface
const char * getEntTypeName() const
Get the Ent Type Name.
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
implementation of Data Operators for Forces and Sources
Tag th_FieldDataVerts
Tag storing field values on vertices in the field.
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.
UId getLocalUniqueIdCalculate()
Get the Local Unique Id Calculate object.
boost::shared_ptr< const ApproximationOrder > tagMaxOrderPtr
Struct keeps handle to entity in the field.
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)
FieldCoefficientsNumber getNbOfCoeffs() const
static constexpr int proc_shift
boost::shared_ptr< FieldData *const > fieldDataAdaptorPtr
void operator()(boost::shared_ptr< FieldEntity > &e)
ApproximationOrder getMaxOrder() const
Get order set to the entity (Allocated tag size for such number)
int ApproximationOrder
Approximation on the entity.
static constexpr int ent_shift
static constexpr int dof_shift
const ApproximationOrder * getMaxOrderPtr() const
Get pinter to Tag keeping approximation order.
EntityType getEntType() const
Get entity type.
std::vector< FieldData > data
const Field * getFieldRawPtr() const
EntityHandle getOwnerEnt() const
UId localUId
Local unique id for this entity. Unique on CPU partition.
const UId & getLocalUniqueId() const
Get global unique id.