https://mooseframework.inl.gov
Classes | Namespaces | Functions
MeshInfo.h File Reference

Go to the source code of this file.

Classes

class  MeshInfo
 Report mesh information, such as the number of elements, nodes, and degrees of freedom. More...
 
struct  MeshInfo::SidesetInfo
 Helper struct for defining information about a single sideset. More...
 
struct  MeshInfo::SubdomainInfo
 Helper struct for defining information about a single subdomain. More...
 

Namespaces

 libMesh
 The following methods are specializations for using the libMesh::Parallel::packed_range_* routines for std::strings.
 

Functions

void to_json (nlohmann::json &json, const std::map< BoundaryID, MeshInfo::SidesetInfo > &sidesets)
 
void dataStore (std::ostream &stream, MeshInfo::SidesetInfo &sideset_info, void *context)
 
void dataLoad (std::istream &stream, MeshInfo::SidesetInfo &sideset_info, void *context)
 
void to_json (nlohmann::json &json, const std::map< BoundaryID, MeshInfo::SubdomainInfo > &sidesets)
 
void dataStore (std::ostream &stream, MeshInfo::SubdomainInfo &sideset_info, void *context)
 
void dataLoad (std::istream &stream, MeshInfo::SubdomainInfo &sideset_info, void *context)
 

Function Documentation

◆ dataLoad() [1/2]

void dataLoad ( std::istream &  stream,
MeshInfo::SidesetInfo sideset_info,
void context 
)

Definition at line 250 of file MeshInfo.C.

251 {
252  loadHelper(stream, sideset_info.id, context);
253  loadHelper(stream, sideset_info.name, context);
254  loadHelper(stream, sideset_info.sides, context);
255 }
std::string name
Definition: MeshInfo.h:39
std::vector< std::pair< dof_id_type, unsigned int > > sides
Definition: MeshInfo.h:40
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:985

◆ dataLoad() [2/2]

void dataLoad ( std::istream &  stream,
MeshInfo::SubdomainInfo sideset_info,
void context 
)

Definition at line 396 of file MeshInfo.C.

397 {
398  loadHelper(stream, subdomain_info.id, context);
399  loadHelper(stream, subdomain_info.name, context);
400  loadHelper(stream, subdomain_info.elems, context);
401 }
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:985

◆ dataStore() [1/2]

void dataStore ( std::ostream &  stream,
MeshInfo::SidesetInfo sideset_info,
void context 
)

Definition at line 242 of file MeshInfo.C.

243 {
244  storeHelper(stream, sideset_info.id, context);
245  storeHelper(stream, sideset_info.name, context);
246  storeHelper(stream, sideset_info.sides, context);
247 }
std::string name
Definition: MeshInfo.h:39
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:893
std::vector< std::pair< dof_id_type, unsigned int > > sides
Definition: MeshInfo.h:40

◆ dataStore() [2/2]

void dataStore ( std::ostream &  stream,
MeshInfo::SubdomainInfo sideset_info,
void context 
)

Definition at line 388 of file MeshInfo.C.

389 {
390  storeHelper(stream, subdomain_info.id, context);
391  storeHelper(stream, subdomain_info.name, context);
392  storeHelper(stream, subdomain_info.elems, context);
393 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:893

◆ to_json() [1/2]

void to_json ( nlohmann::json &  json,
const std::map< BoundaryID, MeshInfo::SidesetInfo > &  sidesets 
)

Definition at line 214 of file MeshInfo.C.

215 {
216  for (const auto & pair : sidesets)
217  {
218  const MeshInfo::SidesetInfo & sideset_info = pair.second;
219 
220  nlohmann::json sideset_json;
221  sideset_json["id"] = sideset_info.id;
222  if (sideset_info.name.size())
223  sideset_json["name"] = sideset_info.name;
224  if (sideset_info.sides.size())
225  {
226  auto & sides_json = sideset_json["sides"];
227 
228  for (const std::pair<dof_id_type, unsigned int> & pair : sideset_info.sides)
229  {
230  nlohmann::json side_json;
231  side_json["elem_id"] = pair.first;
232  side_json["side"] = pair.second;
233  sides_json.push_back(side_json);
234  }
235  }
236 
237  json.push_back(sideset_json);
238  }
239 }
Helper struct for defining information about a single sideset.
Definition: MeshInfo.h:36
std::string name
Definition: MeshInfo.h:39
std::vector< std::pair< dof_id_type, unsigned int > > sides
Definition: MeshInfo.h:40
if(!dmm->_nl) SETERRQ(PETSC_COMM_WORLD

◆ to_json() [2/2]

void to_json ( nlohmann::json &  json,
const std::map< BoundaryID, MeshInfo::SubdomainInfo > &  sidesets 
)