43 #ifndef __Panzer_STK_Interface_hpp__
44 #define __Panzer_STK_Interface_hpp__
49 #include <stk_mesh/base/Types.hpp>
50 #include <stk_mesh/base/MetaData.hpp>
51 #include <stk_mesh/base/BulkData.hpp>
52 #include <stk_mesh/base/Field.hpp>
53 #include <stk_mesh/base/FieldBase.hpp>
54 #include <stk_mesh/base/MetaData.hpp>
55 #include <stk_mesh/base/CoordinateSystems.hpp>
57 #include "Kokkos_Core.hpp"
59 #include <Shards_CellTopology.hpp>
60 #include <Shards_CellTopologyData.h>
62 #include <PanzerAdaptersSTK_config.hpp>
63 #include <Kokkos_ViewFactory.hpp>
65 #include <unordered_map>
67 #ifdef PANZER_HAVE_IOSS
68 #include <stk_io/StkMeshIoBroker.hpp>
71 #ifdef PANZER_HAVE_PERCEPT
74 class URP_Heterogeneous_3D;
78 namespace panzer_stk {
80 class PeriodicBC_MatcherBase;
87 ElementDescriptor(stk::mesh::EntityId gid,
const std::vector<stk::mesh::EntityId> & nodes);
94 std::vector<stk::mesh::EntityId>
nodes_;
131 void addElementBlock(
const std::string & name,
const CellTopologyData * ctData);
135 void addSideset(
const std::string & name,
const CellTopologyData * ctData);
143 void addSolutionField(
const std::string & fieldName,
const std::string & blockId);
147 void addCellField(
const std::string & fieldName,
const std::string & blockId);
158 const std::vector<std::string> & coordField,
159 const std::string & dispPrefix);
174 void initialize(stk::ParallelMachine parallelMach,
bool setupIO=
true,
175 const bool buildRefinementSupport =
false);
200 void addNode(stk::mesh::EntityId gid,
const std::vector<double> & coord);
243 std::vector<stk::mesh::EntityId> & subcellIds)
const;
247 void getMyElements(std::vector<stk::mesh::Entity> & elements)
const;
251 void getMyElements(
const std::string & blockID,std::vector<stk::mesh::Entity> & elements)
const;
260 void getNeighborElements(
const std::string & blockID,std::vector<stk::mesh::Entity> & elements)
const;
269 void getMySides(
const std::string & sideName,std::vector<stk::mesh::Entity> & sides)
const;
279 void getMySides(
const std::string & sideName,
const std::string & blockName,std::vector<stk::mesh::Entity> & sides)
const;
288 void getAllSides(
const std::string & sideName,std::vector<stk::mesh::Entity> & sides)
const;
299 void getAllSides(
const std::string & sideName,
const std::string & blockName,std::vector<stk::mesh::Entity> & sides)
const;
310 void getMyNodes(
const std::string & sideName,
const std::string & blockName,std::vector<stk::mesh::Entity> & nodes)
const;
320 stk::mesh::Entity
findConnectivityById(stk::mesh::Entity src, stk::mesh::EntityRank tgt_rank,
unsigned rel_id)
const;
334 const std::string& filename);
352 const std::string& filename);
391 const std::string& key,
415 const std::string& key,
416 const double& value);
439 const std::string& key,
440 const std::vector<int>& value);
463 const std::string& key,
464 const std::vector<double>& value);
478 {
if(
bulkData_==Teuchos::null)
return false;
479 return bulkData_->in_modifiable_state(); }
523 std::map<std::string, stk::mesh::Part*>::const_iterator itr =
elementBlocks_.find(name);
555 void getNodeIdsForElement(stk::mesh::Entity element,std::vector<stk::mesh::EntityId> & nodeIds)
const;
560 std::vector<int> & relIds)
const;
565 std::vector<int> & relIds,
unsigned int matchType)
const;
569 void getElementsSharingNodes(
const std::vector<stk::mesh::EntityId> nodeId,std::vector<stk::mesh::Entity> & elements)
const;
595 {
return bulkData_->parallel_owner_rank(entity); }
599 inline bool isValid(stk::mesh::Entity entity)
const
611 const std::string & blockId)
const;
617 stk::mesh::Field<double> *
getCellField(
const std::string & fieldName,
618 const std::string & blockId)
const;
644 template <
typename ArrayT>
646 const std::vector<std::size_t> & localElementIds,
const ArrayT & solutionValues,
double scaleValue=1.0);
662 template <
typename ArrayT>
664 const std::vector<std::size_t> & localElementIds,ArrayT & solutionValues)
const;
680 template <
typename ArrayT>
681 void setCellFieldData(
const std::string & fieldName,
const std::string & blockId,
682 const std::vector<std::size_t> & localElementIds,
const ArrayT & solutionValues,
double scaleValue=1.0);
692 template <
typename ArrayT>
693 void getElementVertices(
const std::vector<std::size_t> & localIds, ArrayT & vertices)
const;
703 template <
typename ArrayT>
704 void getElementVertices(
const std::vector<stk::mesh::Entity> & elements, ArrayT & vertices)
const;
715 template <
typename ArrayT>
716 void getElementVertices(
const std::vector<std::size_t> & localIds,
const std::string & eBlock, ArrayT & vertices)
const;
727 template <
typename ArrayT>
728 void getElementVertices(
const std::vector<stk::mesh::Entity> & elements,
const std::string & eBlock, ArrayT & vertices)
const;
738 template <
typename ArrayT>
749 template <
typename ArrayT>
761 template <
typename ArrayT>
762 void getElementVerticesNoResize(
const std::vector<std::size_t> & localIds,
const std::string & eBlock, ArrayT & vertices)
const;
773 template <
typename ArrayT>
774 void getElementVerticesNoResize(
const std::vector<stk::mesh::Entity> & elements,
const std::string & eBlock, ArrayT & vertices)
const;
779 stk::mesh::EntityRank
getElementRank()
const {
return stk::topology::ELEMENT_RANK; }
781 stk::mesh::EntityRank
getFaceRank()
const {
return stk::topology::FACE_RANK; }
782 stk::mesh::EntityRank
getEdgeRank()
const {
return stk::topology::EDGE_RANK; }
783 stk::mesh::EntityRank
getNodeRank()
const {
return stk::topology::NODE_RANK; }
795 const std::vector<Teuchos::RCP<const PeriodicBC_MatcherBase> > &
801 std::vector<Teuchos::RCP<const PeriodicBC_MatcherBase> > &
830 void print(std::ostream & os)
const;
900 template <
typename ArrayT>
903 template <
typename ArrayT>
905 const std::string & eBlock, ArrayT & vertices)
const;
916 template <
typename ArrayT>
919 template <
typename ArrayT>
927 void refineMesh(
const int numberOfLevels,
const bool deleteParentElements);
967 bool isMeshCoordField(
const std::string & eBlock,
const std::string & fieldName,
int & axis)
const;
984 template <
typename ArrayT>
985 void setDispFieldData(
const std::string & fieldName,
const std::string & blockId,
int axis,
986 const std::vector<std::size_t> & localElementIds,
const ArrayT & solutionValues);
992 #ifdef PANZER_HAVE_PERCEPT
1038 #ifdef PANZER_HAVE_IOSS
1047 enum class GlobalVariable
1071 const GlobalVariable& flag);
1112 template <
typename ArrayT>
1114 const std::vector<std::size_t> & localElementIds,
const ArrayT & solutionValues,
double scaleValue)
1118 int field_axis = -1;
1120 setDispFieldData(fieldName,blockId,field_axis,localElementIds,solutionValues);
1126 for(std::size_t cell=0;cell<localElementIds.size();cell++) {
1127 std::size_t localId = localElementIds[cell];
1128 stk::mesh::Entity element = elements[localId];
1131 const size_t num_nodes =
bulkData_->num_nodes(element);
1132 stk::mesh::Entity
const* nodes =
bulkData_->begin_nodes(element);
1133 for(std::size_t i=0; i<num_nodes; ++i) {
1134 stk::mesh::Entity node = nodes[i];
1136 double * solnData = stk::mesh::field_data(*field,node);
1138 solnData[0] = scaleValue*solutionValues(cell,i);
1143 template <
typename ArrayT>
1145 const std::vector<std::size_t> & localElementIds,
const ArrayT & dispValues)
1154 for(std::size_t cell=0;cell<localElementIds.size();cell++) {
1155 std::size_t localId = localElementIds[cell];
1156 stk::mesh::Entity element = elements[localId];
1159 const size_t num_nodes =
bulkData_->num_nodes(element);
1160 stk::mesh::Entity
const* nodes =
bulkData_->begin_nodes(element);
1161 for(std::size_t i=0; i<num_nodes; ++i) {
1162 stk::mesh::Entity node = nodes[i];
1164 double * solnData = stk::mesh::field_data(*field,node);
1165 double * coordData = stk::mesh::field_data(coord_field,node);
1167 solnData[0] = dispValues(cell,i)-coordData[axis];
1172 template <
typename ArrayT>
1174 const std::vector<std::size_t> & localElementIds,ArrayT & solutionValues)
const
1180 localElementIds.size(),
1181 bulkData_->num_nodes(elements[localElementIds[0]]));
1185 for(std::size_t cell=0;cell<localElementIds.size();cell++) {
1186 std::size_t localId = localElementIds[cell];
1187 stk::mesh::Entity element = elements[localId];
1190 const size_t num_nodes =
bulkData_->num_nodes(element);
1191 stk::mesh::Entity
const* nodes =
bulkData_->begin_nodes(element);
1192 for(std::size_t i=0; i<num_nodes; ++i) {
1193 stk::mesh::Entity node = nodes[i];
1195 double * solnData = stk::mesh::field_data(*field,node);
1197 solutionValues(cell,i) = solnData[0];
1202 template <
typename ArrayT>
1204 const std::vector<std::size_t> & localElementIds,
const ArrayT & solutionValues,
double scaleValue)
1210 for(std::size_t cell=0;cell<localElementIds.size();cell++) {
1211 std::size_t localId = localElementIds[cell];
1212 stk::mesh::Entity element = elements[localId];
1214 double * solnData = stk::mesh::field_data(*field,element);
1216 solnData[0] = scaleValue*solutionValues(cell,0);
1220 template <
typename ArrayT>
1231 std::vector<stk::mesh::Entity> selected_elements;
1232 for(std::size_t cell=0;cell<localElementIds.size();cell++)
1233 selected_elements.push_back(elements[localElementIds[cell]]);
1239 "STK_Interface::getElementVertices: Cannot call this method when field coordinates are used "
1240 "without specifying an element block.");
1244 template <
typename ArrayT>
1252 "STK_Interface::getElementVertices: Cannot call this method when field coordinates are used "
1253 "without specifying an element block.");
1257 template <
typename ArrayT>
1268 template <
typename ArrayT>
1274 std::vector<stk::mesh::Entity> selected_elements;
1275 for(std::size_t cell=0;cell<localElementIds.size();cell++)
1276 selected_elements.push_back(elements[localElementIds[cell]]);
1286 template <
typename ArrayT>
1297 std::vector<stk::mesh::Entity> selected_elements;
1298 for(std::size_t cell=0;cell<localElementIds.size();cell++)
1299 selected_elements.push_back(elements[localElementIds[cell]]);
1305 "STK_Interface::getElementVerticesNoResize: Cannot call this method when field coordinates are used "
1306 "without specifying an element block.");
1310 template <
typename ArrayT>
1318 "STK_Interface::getElementVerticesNoResize: Cannot call this method when field coordinates are used "
1319 "without specifying an element block.");
1323 template <
typename ArrayT>
1334 template <
typename ArrayT>
1340 std::vector<stk::mesh::Entity> selected_elements;
1341 for(std::size_t cell=0;cell<localElementIds.size();cell++)
1342 selected_elements.push_back(elements[localElementIds[cell]]);
1352 template <
typename ArrayT>
1356 if(elements.size()==0) {
1366 unsigned masterVertexCount
1367 = stk::mesh::get_cell_topology(
bulkData_->bucket(elements[0]).topology()).getCellTopologyData()->vertex_count;
1374 for(std::size_t cell=0;cell<elements.size();cell++) {
1375 stk::mesh::Entity element = elements[cell];
1378 unsigned vertexCount
1379 = stk::mesh::get_cell_topology(
bulkData_->bucket(element).topology()).getCellTopologyData()->vertex_count;
1381 "In call to STK_Interface::getElementVertices all elements "
1382 "must have the same vertex count!");
1385 const size_t num_nodes =
bulkData_->num_nodes(element);
1386 stk::mesh::Entity
const* nodes =
bulkData_->begin_nodes(element);
1388 "In call to STK_Interface::getElementVertices cardinality of "
1389 "element node relations must be the vertex count!");
1390 for(std::size_t node=0; node<num_nodes; ++node) {
1394 for(
unsigned d=0;d<dim;d++)
1395 vertices(cell,node,d) = coord[d];
1400 template <
typename ArrayT>
1404 if(elements.size()==0) {
1413 unsigned masterVertexCount
1414 = stk::mesh::get_cell_topology(
bulkData_->bucket(elements[0]).topology()).getCellTopologyData()->vertex_count;
1418 for(std::size_t cell=0;cell<elements.size();cell++) {
1419 stk::mesh::Entity element = elements[cell];
1422 unsigned vertexCount
1423 = stk::mesh::get_cell_topology(
bulkData_->bucket(element).topology()).getCellTopologyData()->vertex_count;
1425 "In call to STK_Interface::getElementVertices all elements "
1426 "must have the same vertex count!");
1429 const size_t num_nodes =
bulkData_->num_nodes(element);
1430 stk::mesh::Entity
const* nodes =
bulkData_->begin_nodes(element);
1432 "In call to STK_Interface::getElementVertices cardinality of "
1433 "element node relations must be the vertex count!");
1434 for(std::size_t node=0; node<num_nodes; ++node) {
1438 for(
unsigned d=0;d<dim;d++)
1439 vertices(cell,node,d) = coord[d];
1444 template <
typename ArrayT>
1450 if(elements.size()==0) {
1456 unsigned masterVertexCount
1457 = stk::mesh::get_cell_topology(
bulkData_->bucket(elements[0]).topology()).getCellTopologyData()->vertex_count;
1462 std::map<std::string,std::vector<std::string> >::const_iterator itr =
meshCoordFields_.find(eBlock);
1468 const std::vector<std::string> & coordField = itr->second;
1469 std::vector<SolutionFieldType*> fields(
getDimension());
1470 for(std::size_t d=0;d<fields.size();d++) {
1474 for(std::size_t cell=0;cell<elements.size();cell++) {
1475 stk::mesh::Entity element = elements[cell];
1478 const size_t num_nodes =
bulkData_->num_nodes(element);
1479 stk::mesh::Entity
const* nodes =
bulkData_->begin_nodes(element);
1480 for(std::size_t i=0; i<num_nodes; ++i) {
1481 stk::mesh::Entity node = nodes[i];
1486 double * solnData = stk::mesh::field_data(*fields[d],node);
1490 vertices(cell,i,d) = solnData[0]+coord[d];
1496 template <
typename ArrayT>
1498 const std::string & eBlock, ArrayT & vertices)
const
1503 if(elements.size()==0) {
1507 std::map<std::string,std::vector<std::string> >::const_iterator itr =
meshCoordFields_.find(eBlock);
1513 const std::vector<std::string> & coordField = itr->second;
1514 std::vector<SolutionFieldType*> fields(
getDimension());
1515 for(std::size_t d=0;d<fields.size();d++) {
1519 for(std::size_t cell=0;cell<elements.size();cell++) {
1520 stk::mesh::Entity element = elements[cell];
1523 const size_t num_nodes =
bulkData_->num_nodes(element);
1524 stk::mesh::Entity
const* nodes =
bulkData_->begin_nodes(element);
1525 for(std::size_t i=0; i<num_nodes; ++i) {
1526 stk::mesh::Entity node = nodes[i];
1531 double * solnData = stk::mesh::field_data(*fields[d],node);
1535 vertices(cell,i,d) = solnData[0]+coord[d];
void initializeFromMetaData()
Teuchos::RCP< ElementDescriptor > buildElementDescriptor(stk::mesh::EntityId elmtId, std::vector< stk::mesh::EntityId > &nodes)
Teuchos::RCP< Teuchos::MpiComm< int > > getSafeCommunicator(stk::ParallelMachine parallelMach) const
void getSidesetNames(std::vector< std::string > &name) const
std::pair< Teuchos::RCP< std::vector< std::pair< std::size_t, std::size_t > > >, Teuchos::RCP< std::vector< unsigned int > > > getPeriodicNodePairing() const
Kokkos::DynRankView< typename InputArray::value_type, PHX::Device > createDynRankView(const InputArray &a, const std::string &name, const DimensionPack...dims)
Wrapper to simplify Panzer use of Sacado ViewFactory.
ElementBlockException(const std::string &what)
void addNodeset(const std::string &name)
Teuchos::RCP< stk::mesh::BulkData > bulkData_
void print(std::ostream &os) const
unsigned entityOwnerRank(stk::mesh::Entity entity) const
Teuchos::RCP< const std::vector< stk::mesh::Entity > > getElementsOrderedByLID() const
void setSolutionFieldData(const std::string &fieldName, const std::string &blockId, const std::vector< std::size_t > &localElementIds, const ArrayT &solutionValues, double scaleValue=1.0)
std::vector< stk::mesh::Part * > facesPartVec_
std::vector< stk::mesh::EntityId > nodes_
std::map< std::pair< std::string, std::string >, SolutionFieldType * > fieldNameToSolution_
void getElementVerticesNoResize(const std::vector< std::size_t > &localIds, ArrayT &vertices) const
void addEntityToNodeset(stk::mesh::Entity entity, stk::mesh::Part *nodeset)
void addGlobalToExodus(const std::string &key, const int &value)
Add an int global variable to the information to be written to the Exodus output file.
void setDispFieldData(const std::string &fieldName, const std::string &blockId, int axis, const std::vector< std::size_t > &localElementIds, const ArrayT &solutionValues)
void getElementBlockNames(std::vector< std::string > &names) const
void addPeriodicBC(const Teuchos::RCP< const PeriodicBC_MatcherBase > &bc)
void getSubcellIndices(unsigned entityRank, stk::mesh::EntityId elementId, std::vector< stk::mesh::EntityId > &subcellIds) const
std::vector< Teuchos::RCP< const PeriodicBC_MatcherBase > > & getPeriodicBCVector()
void getElementsSharingNodes(const std::vector< stk::mesh::EntityId > nodeId, std::vector< stk::mesh::Entity > &elements) const
get a set of elements sharing multiple nodes
stk::mesh::Field< double > SolutionFieldType
stk::mesh::Part * getElementBlockPart(const std::string &name) const
get the block count
std::vector< stk::mesh::Part * > edgesPartVec_
std::map< std::string, double > blockWeights_
VectorFieldType * coordinatesField_
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
std::size_t getEntityCounts(unsigned entityRank) const
get the global counts for the entity of specified rank
void printMetaData(std::ostream &os) const
void getElementVertices(const std::vector< std::size_t > &localIds, ArrayT &vertices) const
void addEntityToSideset(stk::mesh::Entity entity, stk::mesh::Part *sideset)
stk::mesh::Part * nodesPart_
void getElementVertices_FromCoords(const std::vector< stk::mesh::Entity > &elements, ArrayT &vertices) const
void addSolutionField(const std::string &fieldName, const std::string &blockId)
std::map< std::string, Teuchos::RCP< shards::CellTopology > > elementBlockCT_
stk::mesh::EntityId getMaxEntityId(unsigned entityRank) const
get max entity ID of type entityRank
std::size_t currentLocalId_
std::map< std::string, stk::mesh::Part * > sidesets_
std::vector< std::size_t > entityCounts_
bool validBlockId(const std::string &blockId) const
stk::mesh::Part * getNodeset(const std::string &name) const
stk::mesh::Field< double > * getSolutionField(const std::string &fieldName, const std::string &blockId) const
SolutionFieldType * loadBalField_
const double * getNodeCoordinates(stk::mesh::EntityId nodeId) const
stk::mesh::Part * getSideset(const std::string &name) const
static const std::string nodesString
void instantiateBulkData(stk::ParallelMachine parallelMach)
void getElementVertices_FromFieldNoResize(const std::vector< stk::mesh::Entity > &elements, const std::string &eBlock, ArrayT &vertices) const
void getMySides(const std::string &sideName, std::vector< stk::mesh::Entity > &sides) const
std::size_t getNumSidesets() const
get the side set count
stk::mesh::EntityId elementGlobalId(stk::mesh::Entity elmt) const
std::size_t elementLocalId(stk::mesh::Entity elmt) const
bool useFieldCoordinates_
void getElementVertices_FromCoordsNoResize(const std::vector< stk::mesh::Entity > &elements, ArrayT &vertices) const
unsigned getDimension() const
get the dimension
void addElement(const Teuchos::RCP< ElementDescriptor > &ed, stk::mesh::Part *block)
std::map< std::string, std::vector< std::string > > meshDispFields_
VectorFieldType * edgesField_
void setUseFieldCoordinates(bool useFieldCoordinates)
stk::mesh::EntityRank getSideRank() const
void initialize(stk::ParallelMachine parallelMach, bool setupIO=true, const bool buildRefinementSupport=false)
static const std::string coordsString
stk::mesh::Field< double, stk::mesh::Cartesian > VectorFieldType
std::size_t getNumElementBlocks() const
get the block count
Teuchos::RCP< stk::mesh::BulkData > getBulkData() const
void getElementVertices_FromField(const std::vector< stk::mesh::Entity > &elements, const std::string &eBlock, ArrayT &vertices) const
void writeToExodus(const std::string &filename)
Write this mesh and associated fields to the given output file.
bool getUseFieldCoordinates() const
stk::mesh::EntityId elementGlobalId(std::size_t lid) const
std::map< std::string, stk::mesh::Part * > elementBlocks_
std::vector< stk::mesh::Part * > nodesPartVec_
static const std::string edgesString
SidesetException(const std::string &what)
std::string containingBlockId(stk::mesh::Entity elmt) const
stk::mesh::EntityRank getFaceRank() const
const STK_Interface * mesh_
std::vector< Teuchos::RCP< const PeriodicBC_MatcherBase > > periodicBCs_
void getOwnedElementsSharingNode(stk::mesh::Entity node, std::vector< stk::mesh::Entity > &elements, std::vector< int > &relIds) const
void addNode(stk::mesh::EntityId gid, const std::vector< double > &coord)
void setBlockWeight(const std::string &blockId, double weight)
void buildSubcells()
force the mesh to build subcells: edges and faces
Teuchos::RCP< Teuchos::MpiComm< int > > mpiComm_
LocalIdCompare(const STK_Interface *mesh)
void setInitialStateTime(double value)
Teuchos::RCP< stk::mesh::MetaData > metaData_
Teuchos::RCP< stk::mesh::MetaData > getMetaData() const
virtual ~ElementDescriptor()
Teuchos::RCP< std::vector< stk::mesh::Entity > > orderedElementVector_
std::size_t getNumNodesets() const
get the side set count
double getInitialStateTime() const
bool isInitialized() const
Has initialize been called on this mesh object?
void getMyNodes(const std::string &sideName, const std::string &blockName, std::vector< stk::mesh::Entity > &nodes) const
void getSolutionFieldData(const std::string &fieldName, const std::string &blockId, const std::vector< std::size_t > &localElementIds, ArrayT &solutionValues) const
void addMeshCoordFields(const std::string &blockId, const std::vector< std::string > &coordField, const std::string &dispPrefix)
void applyElementLoadBalanceWeights()
stk::mesh::Entity findConnectivityById(stk::mesh::Entity src, stk::mesh::EntityRank tgt_rank, unsigned rel_id) const
void setUseLowerCaseForIO(bool useLowerCase)
bool isMeshCoordField(const std::string &eBlock, const std::string &fieldName, int &axis) const
void getAllSides(const std::string &sideName, std::vector< stk::mesh::Entity > &sides) const
void addSideset(const std::string &name, const CellTopologyData *ctData)
void setCellFieldData(const std::string &fieldName, const std::string &blockId, const std::vector< std::size_t > &localElementIds, const ArrayT &solutionValues, double scaleValue=1.0)
const VectorFieldType & getEdgesField() const
ProcIdFieldType * getProcessorIdField()
PHX::MDField< ScalarT, panzer::Cell, panzer::BASIS > field
A field to which we'll contribute, or in which we'll store, the result of computing this integral...
void rebalance(const Teuchos::ParameterList ¶ms)
std::map< std::string, std::vector< std::string > > meshCoordFields_
stk::mesh::EntityRank getEdgeRank() const
static const std::string facesString
void initializeFieldsInSTK(const std::map< std::pair< std::string, std::string >, SolutionFieldType * > &nameToField, bool setupIO)
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
get the comm associated with this mesh
const std::vector< Teuchos::RCP< const PeriodicBC_MatcherBase > > & getPeriodicBCVector() const
const VectorFieldType & getFacesField() const
void refineMesh(const int numberOfLevels, const bool deleteParentElements)
void buildLocalElementIDs()
bool isModifiable() const
void setupExodusFile(const std::string &filename)
Set up an output Exodus file for writing results.
std::unordered_map< stk::mesh::EntityId, std::size_t > localIDHash_
bool isValid(stk::mesh::Entity entity) const
std::vector< stk::mesh::EntityId > maxEntityId_
stk::mesh::Field< ProcIdData > ProcIdFieldType
void addPeriodicBCs(const std::vector< Teuchos::RCP< const PeriodicBC_MatcherBase > > &bc_vec)
void getElementsSharingNode(stk::mesh::EntityId nodeId, std::vector< stk::mesh::Entity > &elements) const
get a set of elements sharing a single node
#define TEUCHOS_ASSERT(assertion_test)
void getMyElements(std::vector< stk::mesh::Entity > &elements) const
stk::mesh::EntityRank getNodeRank() const
void addCellField(const std::string &fieldName, const std::string &blockId)
void getNodeIdsForElement(stk::mesh::Entity element, std::vector< stk::mesh::EntityId > &nodeIds) const
get a list of node ids for nodes connected to an element
stk::mesh::Part * edgesPart_
bool operator()(stk::mesh::Entity a, stk::mesh::Entity b)
stk::mesh::EntityRank getElementRank() const
stk::mesh::Part * facesPart_
ProcIdFieldType * processorIdField_
void addElementBlock(const std::string &name, const CellTopologyData *ctData)
const std::vector< stk::mesh::EntityId > & getNodes() const
stk::mesh::Field< double > * getCellField(const std::string &fieldName, const std::string &blockId) const
const VectorFieldType & getCoordinatesField() const
stk::mesh::Part * getOwnedPart() const
Get a pointer to the locally owned part.
stk::mesh::EntityId getGID() const
bool getUseLowerCaseForIO() const
double getCurrentStateTime() const
void getNeighborElements(std::vector< stk::mesh::Entity > &elements) const
void getNodesetNames(std::vector< std::string > &name) const
Teuchos::RCP< const shards::CellTopology > getCellTopology(const std::string &eBlock) const
std::map< std::pair< std::string, std::string >, SolutionFieldType * > fieldNameToCellField_
std::map< std::string, stk::mesh::Part * > nodesets_
VectorFieldType * facesField_