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 246 of file MeshInfo.C.

247 {
248  loadHelper(stream, sideset_info.id, context);
249  loadHelper(stream, sideset_info.name, context);
250  loadHelper(stream, sideset_info.sides, context);
251 }
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 388 of file MeshInfo.C.

389 {
390  loadHelper(stream, subdomain_info.id, context);
391  loadHelper(stream, subdomain_info.name, context);
392  loadHelper(stream, subdomain_info.elems, context);
393 }
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 238 of file MeshInfo.C.

239 {
240  storeHelper(stream, sideset_info.id, context);
241  storeHelper(stream, sideset_info.name, context);
242  storeHelper(stream, sideset_info.sides, context);
243 }
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 380 of file MeshInfo.C.

381 {
382  storeHelper(stream, subdomain_info.id, context);
383  storeHelper(stream, subdomain_info.name, context);
384  storeHelper(stream, subdomain_info.elems, context);
385 }
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 210 of file MeshInfo.C.

211 {
212  for (const auto & pair : sidesets)
213  {
214  const MeshInfo::SidesetInfo & sideset_info = pair.second;
215 
216  nlohmann::json sideset_json;
217  sideset_json["id"] = sideset_info.id;
218  if (sideset_info.name.size())
219  sideset_json["name"] = sideset_info.name;
220  if (sideset_info.sides.size())
221  {
222  auto & sides_json = sideset_json["sides"];
223 
224  for (const std::pair<dof_id_type, unsigned int> & pair : sideset_info.sides)
225  {
226  nlohmann::json side_json;
227  side_json["elem_id"] = pair.first;
228  side_json["side"] = pair.second;
229  sides_json.push_back(side_json);
230  }
231  }
232 
233  json.push_back(sideset_json);
234  }
235 }
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 
)