v0.8.23
Public Member Functions | Public Attributes | List of all members
MyTransport Struct Reference

Application of mix transport data structure. More...

Inheritance diagram for MyTransport:
[legend]
Collaboration diagram for MyTransport:
[legend]

Public Member Functions

 MyTransport (MoFEM::Interface &m_field)
 
MoFEMErrorCode getSource (EntityHandle ent, const double x, const double y, const double z, double &flux)
 set source term More...
 
MoFEMErrorCode getBcOnValues (const EntityHandle ent, const double x, const double y, const double z, double &value)
 
MoFEMErrorCode getBcOnFluxes (const EntityHandle ent, const double x, const double y, const double z, double &flux)
 essential (Neumann) boundary condition (set fluxes) More...
 
 MyTransport (MoFEM::Interface &m_field, BcFluxMap &bc_flux_map)
 
MoFEMErrorCode getSource (EntityHandle ent, const double x, const double y, const double z, double &flux)
 set source term More...
 
MoFEMErrorCode getBcOnValues (const EntityHandle ent, const double x, const double y, const double z, double &value)
 natural (Dirihlet) boundary conditions (set values) More...
 
MoFEMErrorCode getBcOnFluxes (const EntityHandle ent, const double x, const double y, const double z, double &flux)
 essential (Neumann) boundary condition (set fluxes) More...
 
MoFEMErrorCode addBoundaryElements (BitRefLevel &ref_level)
 set-up boundary conditions More...
 
MoFEMErrorCode refineMesh (MixTransportElement &ufe, const int nb_levels, const int order)
 Refine mesh. More...
 
MoFEMErrorCode squashBits ()
 Squash bits of entities. More...
 
MoFEMErrorCode updateMeshsetsFieldsAndElements (const int nb_levels)
 update meshsets with new entities after mesh refinement More...
 
- Public Member Functions inherited from MixTransport::MixTransportElement
 MixTransportElement (MoFEM::Interface &m_field)
 construction of this data structure More...
 
virtual ~MixTransportElement ()
 destructor More...
 
MoFEMErrorCode getDirichletBCIndices (IS *is)
 get dof indices where essential boundary conditions are applied More...
 
virtual MoFEMErrorCode getResistivity (const EntityHandle ent, const double x, const double y, const double z, MatrixDouble3by3 &inv_k)
 natural (Dirichlet) boundary conditions (set values) More...
 
virtual MoFEMErrorCode getBcOnValues (const EntityHandle ent, const int gg, const double x, const double y, const double z, double &value)
 evaluate natural (Dirichlet) boundary conditions More...
 
MoFEMErrorCode addFields (const std::string &values, const std::string &fluxes, const int order)
 Add fields to database. More...
 
MoFEMErrorCode addFiniteElements (const std::string &fluxes_name, const std::string &values_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
 add finite elements More...
 
MoFEMErrorCode buildProblem (BitRefLevel &ref_level)
 Build problem. More...
 
MoFEMErrorCode postProc (const string out_file)
 Post process results. More...
 
MoFEMErrorCode createMatrices ()
 create matrices More...
 
MoFEMErrorCode solveLinearProblem ()
 solve problem More...
 
MoFEMErrorCode calculateResidual ()
 calculate residual More...
 
MoFEMErrorCode evaluateError ()
 Calculate error on elements. More...
 
MoFEMErrorCode destroyMatrices ()
 destroy matrices More...
 

Public Attributes

BcFluxMapbcFluxMap
 
EntityHandle lastEnt
 
double lastFlux
 
- Public Attributes inherited from MixTransport::MixTransportElement
MoFEM::InterfacemField
 
MyVolumeFE feVol
 Instance of volume element. More...
 
MyTriFE feTri
 Instance of surface element. More...
 
VectorDouble valuesAtGaussPts
 values at integration points on element More...
 
MatrixDouble valuesGradientAtGaussPts
 gradients at integration points on element More...
 
VectorDouble divergenceAtGaussPts
 divergence at integration points on element More...
 
MatrixDouble fluxesAtGaussPts
 fluxes at integration points on element More...
 
set< intbcIndices
 
std::map< int, BlockDatasetOfBlocks
 maps block set id with appropriate BlockData More...
 
Vec D
 
Vec D0
 
Vec F
 
Mat Aij
 
map< double, EntityHandleerrorMap
 
double sumErrorFlux
 
double sumErrorDiv
 
double sumErrorJump
 

Detailed Description

Application of mix transport data structure.

define sources and other stuff

MixTransportElement is a class collecting functions, operators and data for mix implementation of transport element. See there to learn how elements are created or how operators look like.

Some methods in MixTransportElement are abstract, f.e. user need to implement own source therm.

MixTransportElement is a class collecting functions, operators and data for mix implementation of transport element. See there to learn how elements are created or how operators look like.

Some methods in MixTransportElement are abstract, f.e. user need to implement own source therm.

Definition at line 36 of file mix_transport.cpp.

Constructor & Destructor Documentation

◆ MyTransport() [1/2]

MyTransport::MyTransport ( MoFEM::Interface m_field)

Definition at line 38 of file mix_transport.cpp.

38 : MixTransportElement(m_field){};
MixTransportElement(MoFEM::Interface &m_field)
construction of this data structure

◆ MyTransport() [2/2]

MyTransport::MyTransport ( MoFEM::Interface m_field,
BcFluxMap bc_flux_map 
)

Definition at line 62 of file h_adaptive_transport.cpp.

63  : MixTransportElement(m_field), bcFluxMap(bc_flux_map), lastEnt(0),
64  lastFlux(0) {}
BcFluxMap & bcFluxMap
EntityHandle lastEnt
MixTransportElement(MoFEM::Interface &m_field)
construction of this data structure

Member Function Documentation

◆ addBoundaryElements()

MoFEMErrorCode MyTransport::addBoundaryElements ( BitRefLevel ref_level)

set-up boundary conditions

Parameters
ref_levelmesh refinement level
Note
It is assumed that user would like to something non-standard with boundary conditions, have a own type of data structures to pass to functions calculating values and fluxes on boundary. For example BcFluxMap. That way this function is implemented here not in generic class MixTransportElement.
Returns
error code

Definition at line 138 of file h_adaptive_transport.cpp.

138  {
140  Range tets;
141  CHKERR mField.getInterface<BitRefManager>()->getEntitiesByTypeAndRefLevel(
142  ref_level, BitRefLevel().set(), MBTET, tets);
143  Skinner skin(&mField.get_moab());
144  Range skin_faces; // skin faces from 3d ents
145  CHKERR skin.find_skin(0, tets, false, skin_faces);
146  // note: what is essential (dirichlet) is natural (neumann) for mix-FE
147  // compared to classical FE
148  Range natural_bc;
150  mField, NODESET | TEMPERATURESET, it)) {
151  Range tris;
152  CHKERR it->getMeshsetIdEntitiesByDimension(mField.get_moab(), 2, tris,
153  true);
154  natural_bc.insert(tris.begin(), tris.end());
155  }
157  mField, SIDESET | HEATFLUXSET, it)) {
158  HeatFluxCubitBcData mydata;
159  CHKERR it->getBcDataStructure(mydata);
160  if (mydata.data.flag1 == 1) {
161  Range tris;
162  CHKERR it->getMeshsetIdEntitiesByDimension(mField.get_moab(), 2, tris,
163  true);
164  bcFluxMap[it->getMeshsetId()].eNts = tris;
165  bcFluxMap[it->getMeshsetId()].fLux = mydata.data.value1;
166  // cerr << bcFluxMap[it->getMeshsetId()].eNts << endl;
167  // cerr << bcFluxMap[it->getMeshsetId()].fLux << endl;
168  }
169  }
170  Range essential_bc = subtract(skin_faces, natural_bc);
171  Range bit_tris;
172  CHKERR mField.getInterface<BitRefManager>()->getEntitiesByTypeAndRefLevel(
173  ref_level, BitRefLevel().set(), MBTRI, bit_tris);
174  essential_bc = intersect(bit_tris, essential_bc);
175  natural_bc = intersect(bit_tris, natural_bc);
177  "MIX_BCFLUX");
179  "MIX_BCVALUE");
180  // CHKERR
181  // mField.add_ents_to_finite_element_by_type(skin_faces,MBTRI,"MIX_BCVALUE");
183  }
BcFluxMap & bcFluxMap
virtual MoFEMErrorCode add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string &name, const bool recursive=true)=0
add entities to finite element
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
MoFEMErrorCode getInterface(const MOFEMuuid &uuid, IFACE *&iface) const
Get interface by uuid and return reference to pointer of interface.
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
Managing BitRefLevels.
#define CHKERR
Inline error check.
Definition: definitions.h:595
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406
Definition of the heat flux bc data structure.
Definition: BCData.hpp:415

◆ getBcOnFluxes() [1/2]

MoFEMErrorCode MyTransport::getBcOnFluxes ( const EntityHandle  ent,
const double  x,
const double  y,
const double  z,
double flux 
)
virtual

essential (Neumann) boundary condition (set fluxes)

Parameters
enthandle to finite element entity
xcoord
ycoord
zcoord
fluxreference to flux which is set by function
Returns
[description]

Reimplemented from MixTransport::MixTransportElement.

Definition at line 55 of file mix_transport.cpp.

56  {
58  flux = 0;
60  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:500
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:507

◆ getBcOnFluxes() [2/2]

MoFEMErrorCode MyTransport::getBcOnFluxes ( const EntityHandle  ent,
const double  x,
const double  y,
const double  z,
double flux 
)
virtual

essential (Neumann) boundary condition (set fluxes)

Parameters
enthandle to finite element entity
xcoord
ycoord
zcoord
fluxreference to flux which is set by function
Returns
[description]

Reimplemented from MixTransport::MixTransportElement.

Definition at line 107 of file h_adaptive_transport.cpp.

108  {
110  if (lastEnt == ent) {
111  flux = lastFlux;
112  } else {
113  flux = 0;
114  for (BcFluxMap::iterator mit = bcFluxMap.begin(); mit != bcFluxMap.end();
115  mit++) {
116  Range &tris = mit->second.eNts;
117  if (tris.find(ent) != tris.end()) {
118  flux = mit->second.fLux;
119  }
120  }
121  lastEnt = ent;
122  lastFlux = flux;
123  }
125  }
BcFluxMap & bcFluxMap
EntityHandle lastEnt
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:500
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:507

◆ getBcOnValues() [1/2]

MoFEMErrorCode MyTransport::getBcOnValues ( const EntityHandle  ent,
const double  x,
const double  y,
const double  z,
double value 
)

Definition at line 48 of file mix_transport.cpp.

49  {
51  value = 1;
53  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:500
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:507

◆ getBcOnValues() [2/2]

MoFEMErrorCode MyTransport::getBcOnValues ( const EntityHandle  ent,
const double  x,
const double  y,
const double  z,
double value 
)

natural (Dirihlet) boundary conditions (set values)

Parameters
enthandle to finite element entity
xcoord
ycoord
zcoord
valuereference to value set by function
Returns
error code

Definition at line 91 of file h_adaptive_transport.cpp.

92  {
94  value = 0;
96  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:500
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:507

◆ getSource() [1/2]

MoFEMErrorCode MyTransport::getSource ( EntityHandle  ent,
const double  x,
const double  y,
const double  z,
double flux 
)
virtual

set source term

Parameters
enthandle to entity on which function is evaluated
xcoord
ycoord
zcoord
fluxreference to source term set by function
Returns
error code

Reimplemented from MixTransport::MixTransportElement.

Definition at line 40 of file mix_transport.cpp.

41  {
43  // double d = sqrt(x*x+y*y+z*z);
44  flux = 1; //-pow(d,5./4.);
46  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:500
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:507

◆ getSource() [2/2]

MoFEMErrorCode MyTransport::getSource ( EntityHandle  ent,
const double  x,
const double  y,
const double  z,
double flux 
)
virtual

set source term

Parameters
enthandle to entity on which function is evaluated
xcoord
ycoord
zcoord
fluxreference to source term set by function
Returns
error code

Reimplemented from MixTransport::MixTransportElement.

Definition at line 75 of file h_adaptive_transport.cpp.

76  {
78  flux = 0;
80  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:500
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:507

◆ refineMesh()

MoFEMErrorCode MyTransport::refineMesh ( MixTransportElement ufe,
const int  nb_levels,
const int  order 
)

Refine mesh.

Parameters
ufegeneral data structure
nb_levelsnumber of refinement levels
orderset order of approximation
Returns
errpr code

Refinement of could result in distorted mesh, for example, imagine when you have two levels of non-uniform refinement. Some tetrahedra on the mesh at first refinement instance are only refined by splitting subset of edges on it. Then refined child tetrahedra usually will have worse quality than quality of parent element. Refining such element in subsequent mesh refinement, potentially will deteriorate elements quality even worse. To prevent that adding new refinement level, recreate whole hierarchy of meshes.

Note on subsequent improvement could include refinement of tetrahedra from different levels, including initial mesh. So refinement two could split elements created during refinement one and also split elements from an initial mesh.

That adding the new refinement level creates refinement hierarchy of meshes from a scratch, not adding to existing one.

Entities from previous hierarchy are used in that process, but bit levels on those entities are squashed.

Definition at line 212 of file h_adaptive_transport.cpp.

213  {
214  MeshRefinement *refine_ptr;
216  // get refined edges having child vertex
217  const RefEntity_multiIndex *ref_ents_ptr;
218  CHKERR mField.get_ref_ents(&ref_ents_ptr);
219  typedef RefEntity_multiIndex::index<
220  Composite_EntType_and_ParentEntType_mi_tag>::type RefEntsByComposite;
221  const RefEntsByComposite &ref_ents =
222  ref_ents_ptr->get<Composite_EntType_and_ParentEntType_mi_tag>();
223  RefEntsByComposite::iterator rit, hi_rit;
224  rit = ref_ents.lower_bound(boost::make_tuple(MBVERTEX, MBEDGE));
225  hi_rit = ref_ents.upper_bound(boost::make_tuple(MBVERTEX, MBEDGE));
226  Range refined_edges;
227  // thist loop is over vertices which parent is edge
228  for (; rit != hi_rit; rit++) {
229  refined_edges.insert((*rit)->getParentEnt()); // get parent edge
230  }
231  // get tets which has large error
232  Range tets_to_refine;
233  const double max_error = ufe.errorMap.rbegin()->first;
234  // int size = ((double)5/6)*ufe.errorMap.size();
235  for (map<double, EntityHandle>::iterator mit = ufe.errorMap.begin();
236  mit != ufe.errorMap.end(); mit++) {
237  // cerr << mit->first << " " << mit->second << endl;
238  // if((size--)>0) continue;
239  if (mit->first < 0.25 * max_error)
240  continue;
241  tets_to_refine.insert(mit->second);
242  }
243  Range tets_to_refine_edges;
244  CHKERR mField.get_moab().get_adjacencies(
245  tets_to_refine, 1, false, tets_to_refine_edges, moab::Interface::UNION);
246  refined_edges.merge(tets_to_refine_edges);
247  CHKERR mField.getInterface(refine_ptr);
248  for (int ll = 0; ll != nb_levels; ll++) {
249  Range edges;
250  CHKERR mField.getInterface<BitRefManager>()->getEntitiesByTypeAndRefLevel(
251  BitRefLevel().set(ll), BitRefLevel().set(), MBEDGE, edges);
252  edges = intersect(edges, refined_edges);
253  // add edges to refine at current level edges (some of the where refined
254  // before)
256  edges, BitRefLevel().set(ll + 1));
257  // get tets at current level
258  Range tets;
259  CHKERR mField.getInterface<BitRefManager>()->getEntitiesByTypeAndRefLevel(
260  BitRefLevel().set(ll), BitRefLevel().set(), MBTET, tets);
261  CHKERR refine_ptr->refine_TET(tets, BitRefLevel().set(ll + 1));
263  }
264 
265  // update fields and elements
266  EntityHandle ref_meshset;
267  CHKERR mField.get_moab().create_meshset(MESHSET_SET, ref_meshset);
268  {
269  // cerr << BitRefLevel().set(nb_levels) << endl;
270  CHKERR mField.getInterface<BitRefManager>()->getEntitiesByTypeAndRefLevel(
271  BitRefLevel().set(nb_levels), BitRefLevel().set(), MBTET,
272  ref_meshset);
273 
274  Range ref_tets;
275  CHKERR mField.get_moab().get_entities_by_type(ref_meshset, MBTET,
276  ref_tets);
277 
278  // add entities to field
279  CHKERR mField.add_ents_to_field_by_type(ref_meshset, MBTET, "FLUXES");
280  CHKERR mField.add_ents_to_field_by_type(ref_meshset, MBTET, "VALUES");
281  CHKERR mField.set_field_order(0, MBTET, "FLUXES", order + 1);
282  CHKERR mField.set_field_order(0, MBTRI, "FLUXES", order + 1);
283  CHKERR mField.set_field_order(0, MBTET, "VALUES", order);
284 
285  // add entities to skeleton
286  Range ref_tris;
287  CHKERR mField.getInterface<BitRefManager>()->getEntitiesByTypeAndRefLevel(
288  BitRefLevel().set(nb_levels), BitRefLevel().set(), MBTRI, ref_tris);
290  "MIX_SKELETON");
291 
292  // add entities to finite elements
294  mField, BLOCKSET | MAT_THERMALSET, it)) {
295  Mat_Thermal temp_data;
296  CHKERR it->getAttributeDataStructure(temp_data);
297  setOfBlocks[it->getMeshsetId()].cOnductivity =
298  temp_data.data.Conductivity;
299  setOfBlocks[it->getMeshsetId()].cApacity = temp_data.data.HeatCapacity;
300  CHKERR mField.get_moab().get_entities_by_type(
301  it->meshset, MBTET, setOfBlocks[it->getMeshsetId()].tEts, true);
302  setOfBlocks[it->getMeshsetId()].tEts =
303  intersect(ref_tets, setOfBlocks[it->getMeshsetId()].tEts);
305  setOfBlocks[it->getMeshsetId()].tEts, MBTET, "MIX");
306  }
307  }
308  CHKERR mField.get_moab().delete_entities(&ref_meshset, 1);
310  }
virtual MoFEMErrorCode refine_TET(const EntityHandle meshset, const BitRefLevel &bit, const bool respect_interface=false, int verb=QUIET, Range *ref_edges=NULL)
refine TET in the meshset
virtual MoFEMErrorCode get_ref_ents(const RefEntity_multiIndex **refined_ents_ptr) const =0
Get ref entities multi-index from database.
virtual MoFEMErrorCode add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string &name, const bool recursive=true)=0
add entities to finite element
virtual moab::Interface & get_moab()=0
virtual MoFEMErrorCode add_vertices_in_the_middel_of_edges(const EntityHandle meshset, const BitRefLevel &bit, const bool recursive=false, int verb=QUIET, EntityHandle start_v=0)
make vertices in the middle of edges in meshset and add them to refinement levels defined by bit
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
virtual MoFEMErrorCode set_field_order(const EntityHandle meshset, const EntityType type, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)=0
Set order approximation of the entities in the field.
MoFEMErrorCode getInterface(const MOFEMuuid &uuid, IFACE *&iface) const
Get interface by uuid and return reference to pointer of interface.
Thermal material data structure.
MoFEMErrorCode updateMeshsetsFieldsAndElements(const int nb_levels)
update meshsets with new entities after mesh refinement
virtual MoFEMErrorCode add_ents_to_field_by_type(const Range &ents, const EntityType type, const std::string &name, int verb=DEFAULT_VERBOSITY)=0
Add entities to field meshset.
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
Managing BitRefLevels.
block name is "MAT_THERMAL"
Definition: definitions.h:223
Mesh refinement interface.
std::map< int, BlockData > setOfBlocks
maps block set id with appropriate BlockData
#define CHKERR
Inline error check.
Definition: definitions.h:595
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
multi_index_container< boost::shared_ptr< RefEntity >, indexed_by< ordered_unique< tag< Ent_mi_tag >, member< RefEntity::BasicEntity, EntityHandle, &RefEntity::ent > >, ordered_non_unique< tag< Ent_Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >, ordered_non_unique< tag< EntType_mi_tag >, const_mem_fun< RefEntity::BasicEntity, EntityType, &RefEntity::getEntType > >, ordered_non_unique< tag< ParentEntType_mi_tag >, const_mem_fun< RefEntity, EntityType, &RefEntity::getParentEntType > >, ordered_non_unique< tag< Composite_EntType_and_ParentEntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity::BasicEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityType, &RefEntity::getParentEntType > > >, ordered_non_unique< tag< Composite_ParentEnt_And_EntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity::BasicEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > > > > > RefEntity_multiIndex
map< double, EntityHandle > errorMap
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406
const int order
approximation order

◆ squashBits()

MoFEMErrorCode MyTransport::squashBits ( )

Squash bits of entities.

Information about hierarchy of meshsets is lost, but entities are not deleted from the mesh. After squash entities bits, new hierarchy can be created.

Returns
error code

Definition at line 320 of file h_adaptive_transport.cpp.

320  {
322  BitRefLevel all_but_0;
323  all_but_0.set(0);
324  all_but_0.flip();
325  BitRefLevel garbage_bit;
326  garbage_bit.set(BITREFLEVEL_SIZE - 1); // Garbage level
327  const RefEntity_multiIndex *refined_ents_ptr;
328  CHKERR mField.get_ref_ents(&refined_ents_ptr);
329  RefEntity_multiIndex::iterator mit = refined_ents_ptr->begin();
330  for (; mit != refined_ents_ptr->end(); mit++) {
331  if (mit->get()->getEntType() == MBENTITYSET)
332  continue;
333  BitRefLevel bit = mit->get()->getBitRefLevel();
334  if ((all_but_0 & bit) == bit) {
335  *(const_cast<RefEntity *>(mit->get())->getBitRefLevelPtr()) =
336  garbage_bit;
337  } else {
338  *(const_cast<RefEntity *>(mit->get())->getBitRefLevelPtr()) =
339  BitRefLevel().set(0);
340  }
341  }
343  }
virtual MoFEMErrorCode get_ref_ents(const RefEntity_multiIndex **refined_ents_ptr) const =0
Get ref entities multi-index from database.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
#define BITREFLEVEL_SIZE
max number of refinements
Definition: definitions.h:278
#define CHKERR
Inline error check.
Definition: definitions.h:595
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
multi_index_container< boost::shared_ptr< RefEntity >, indexed_by< ordered_unique< tag< Ent_mi_tag >, member< RefEntity::BasicEntity, EntityHandle, &RefEntity::ent > >, ordered_non_unique< tag< Ent_Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >, ordered_non_unique< tag< EntType_mi_tag >, const_mem_fun< RefEntity::BasicEntity, EntityType, &RefEntity::getEntType > >, ordered_non_unique< tag< ParentEntType_mi_tag >, const_mem_fun< RefEntity, EntityType, &RefEntity::getParentEntType > >, ordered_non_unique< tag< Composite_EntType_and_ParentEntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity::BasicEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityType, &RefEntity::getParentEntType > > >, ordered_non_unique< tag< Composite_ParentEnt_And_EntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity::BasicEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > > > > > RefEntity_multiIndex
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406

◆ updateMeshsetsFieldsAndElements()

MoFEMErrorCode MyTransport::updateMeshsetsFieldsAndElements ( const int  nb_levels)

update meshsets with new entities after mesh refinement

Parameters
nb_levelsnb_levels
orderappropriate order
Returns
error code

Definition at line 351 of file h_adaptive_transport.cpp.

351  {
352  BitRefLevel ref_level;
354  ref_level.set(nb_levels);
356  EntityHandle meshset = it->meshset;
358  ->updateMeshsetByEntitiesChildren(meshset, ref_level, meshset,
359  MBVERTEX, true);
361  ->updateMeshsetByEntitiesChildren(meshset, ref_level, meshset, MBEDGE,
362  true);
364  ->updateMeshsetByEntitiesChildren(meshset, ref_level, meshset, MBTRI,
365  true);
367  ->updateMeshsetByEntitiesChildren(meshset, ref_level, meshset, MBTET,
368  true);
369  }
371  }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
MoFEMErrorCode getInterface(const MOFEMuuid &uuid, IFACE *&iface) const
Get interface by uuid and return reference to pointer of interface.
Managing BitRefLevels.
#define CHKERR
Inline error check.
Definition: definitions.h:595
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT)
Iterator that loops over all the Cubit MeshSets in a moFEM field.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406

Member Data Documentation

◆ bcFluxMap

BcFluxMap& MyTransport::bcFluxMap

Definition at line 58 of file h_adaptive_transport.cpp.

◆ lastEnt

EntityHandle MyTransport::lastEnt

Definition at line 59 of file h_adaptive_transport.cpp.

◆ lastFlux

double MyTransport::lastFlux

Definition at line 60 of file h_adaptive_transport.cpp.


The documentation for this struct was generated from the following files: