https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Classes | Namespaces
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::DomainElemQuality
 Key for a libMesh::ElemQuality quality type with a bound (min or max) to be used over an entire domain (sideset or subdomain). More...
 
struct  MeshInfo::InfoBase< IDType >
 Base struct for information for a single entry (elem, sideset, subdomain). More...
 
struct  MeshInfo::ElemContainingInfo< IDType >
 Struct for element-containing entries (elem, sideset, subdomain). More...
 
struct  MeshInfo::DomainInfo< IDType, ElemsType >
 Structure for a single domain entry (sideset or subdomain). More...
 
struct  MeshInfo::ElemInfo
 Structure for a single elem entry. More...
 
struct  MeshInfo::ElemContainingInfoItems
 Base struct for defining which items are to be output for a domain that contains elements (elems, sidesets, subdomains). More...
 
struct  MeshInfo::DomainInfoItems
 Defines which items are to be output for a domain (sideset or subdomain). More...
 
struct  MeshInfo::ElemInfoItems
 
struct  MeshInfo::InfoMap< InfoType, ItemsType >
 Struct that defines a domain (sideset or subdomain) map (id -> entities) and the items that should be output about that domain. More...
 
struct  MeshInfo::CombinedInfos< InfoMapType, ItemsType >
 Struct that contains all of the reporter data for a domain type (sideset or subdomain) and the items that should be output for that domain. More...
 

Namespaces

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

Functions

void to_json (nlohmann::json &, const MeshInfo::ElemInfoMap &)
 JSON serialization for info maps.
 
void to_json (nlohmann::json &, const MeshInfo::SidesetInfoMap &)
 
void to_json (nlohmann::json &, const MeshInfo::SubdomainInfoMap &)
 
void dataStore (std::ostream &, MeshInfo::DomainElemQuality &, void *)
 Data store and load for DomainElemQuality.
 
void dataLoad (std::istream &, MeshInfo::DomainElemQuality &, void *)
 
void dataStore (std::ostream &, MeshInfo::ElemInfo &, void *)
 Data store and load for node, elem, sideset, subdomain info entries.
 
void dataStore (std::ostream &, MeshInfo::SidesetInfo &, void *)
 
void dataStore (std::ostream &, MeshInfo::SubdomainInfo &, void *)
 
void dataLoad (std::istream &, MeshInfo::ElemInfo &, void *)
 
void dataLoad (std::istream &, MeshInfo::SidesetInfo &, void *)
 
void dataLoad (std::istream &, MeshInfo::SubdomainInfo &, void *)
 
void dataStore (std::ostream &, MeshInfo::ElemInfoMap &, void *)
 Data store and load for info maps.
 
void dataStore (std::ostream &, MeshInfo::SidesetInfoMap &, void *)
 
void dataStore (std::ostream &, MeshInfo::SubdomainInfoMap &, void *)
 
void dataLoad (std::istream &, MeshInfo::ElemInfoMap &, void *)
 
void dataLoad (std::istream &, MeshInfo::SidesetInfoMap &, void *)
 
void dataLoad (std::istream &, MeshInfo::SubdomainInfoMap &, void *)
 

Function Documentation

◆ dataLoad() [1/7]

void dataLoad ( std::istream &  stream,
MeshInfo::DomainElemQuality beq,
void *   
)

Definition at line 872 of file MeshInfo.C.

873{
874 int value;
875
876 dataLoad(stream, value, nullptr);
877 beq.elemQuality() = static_cast<libMesh::ElemQuality>(value);
878
879 dataLoad(stream, value, nullptr);
880 beq.boundType() = static_cast<MeshInfo::BoundType>(value);
881}
void dataLoad(std::istream &stream, MeshInfo::DomainElemQuality &beq, void *)
Definition MeshInfo.C:872
BoundType
Type of a bound for DomainElemQuality (min or max).
Definition MeshInfo.h:38
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
libMesh::ElemQuality & elemQuality()
Get the libMesh::ElemQuality entry.
Definition MeshInfo.h:54
BoundType & boundType()
Get the type of the bound (min or max)
Definition MeshInfo.h:60

Referenced by dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoad(), dataLoadDomainInfo(), dataLoadElemContainingInfo(), and dataLoadInfoBase().

◆ dataLoad() [2/7]

void dataLoad ( std::istream &  stream,
MeshInfo::ElemInfo info,
void *   
)

Definition at line 955 of file MeshInfo.C.

956{
957 dataLoadElemContainingInfo(stream, info);
958 dataLoad(stream, info.elem_qualities, nullptr);
959 dataLoad(stream, info.dim, nullptr);
960 dataLoad(stream, info.elem_mapping_type, nullptr);
961 dataLoad(stream, info.elem_type, nullptr);
962 dataLoad(stream, info.hmax, nullptr);
963 dataLoad(stream, info.hmin, nullptr);
964 dataLoad(stream, info.neighbor_ids, nullptr);
965 dataLoad(stream, info.node_ids, nullptr);
966 dataLoad(stream, info.num_sides, nullptr);
967 dataLoad(stream, info.points, nullptr);
968 dataLoad(stream, info.processor_id, nullptr);
969 dataLoad(stream, info.subdomain_id, nullptr);
970 dataLoad(stream, info.unique_id, nullptr);
971}
void dataLoadElemContainingInfo(std::istream &stream, T &info)
Definition MeshInfo.C:948
MPI_Info info

◆ dataLoad() [3/7]

void dataLoad ( std::istream &  stream,
MeshInfo::ElemInfoMap info_map,
void *   
)

Definition at line 1014 of file MeshInfo.C.

1015{
1016 dataLoad(stream, info_map.map, nullptr);
1017}
map_type map
The underlying data.
Definition MeshInfo.h:262

◆ dataLoad() [4/7]

void dataLoad ( std::istream &  stream,
MeshInfo::SidesetInfo info,
void *   
)

Definition at line 987 of file MeshInfo.C.

988{
989 dataLoadDomainInfo(stream, info);
990}
void dataLoadDomainInfo(std::istream &stream, T &info)
Definition MeshInfo.C:974

◆ dataLoad() [5/7]

void dataLoad ( std::istream &  stream,
MeshInfo::SidesetInfoMap info_map,
void *   
)

Definition at line 1019 of file MeshInfo.C.

1020{
1021 dataLoad(stream, info_map.map, nullptr);
1022}

◆ dataLoad() [6/7]

void dataLoad ( std::istream &  stream,
MeshInfo::SubdomainInfo info,
void *   
)

Definition at line 992 of file MeshInfo.C.

993{
994 dataLoadDomainInfo(stream, info);
995}

◆ dataLoad() [7/7]

void dataLoad ( std::istream &  stream,
MeshInfo::SubdomainInfoMap info_map,
void *   
)

Definition at line 1024 of file MeshInfo.C.

1025{
1026 dataLoad(stream, info_map.map, nullptr);
1027}

◆ dataStore() [1/7]

void dataStore ( std::ostream &  stream,
MeshInfo::DomainElemQuality beq,
void *   
)

Data store and load for DomainElemQuality.

Definition at line 861 of file MeshInfo.C.

862{
863 int value;
864
865 value = static_cast<int>(beq.elemQuality());
866 dataStore(stream, value, nullptr);
867
868 value = static_cast<int>(beq.boundType());
869 dataStore(stream, value, nullptr);
870}
void dataStore(std::ostream &stream, MeshInfo::DomainElemQuality &beq, void *)
Data store and load for DomainElemQuality.
Definition MeshInfo.C:861

Referenced by dataStore(), dataStore(), dataStore(), dataStore(), dataStore(), dataStoreDomainInfo(), dataStoreElemContainingInfo(), and dataStoreInfoBase().

◆ dataStore() [2/7]

void dataStore ( std::ostream &  stream,
MeshInfo::ElemInfo info,
void *   
)

Data store and load for node, elem, sideset, subdomain info entries.

Definition at line 899 of file MeshInfo.C.

900{
901 dataStoreElemContainingInfo(stream, info);
902 dataStore(stream, info.elem_qualities, nullptr);
903 dataStore(stream, info.dim, nullptr);
904 dataStore(stream, info.elem_mapping_type, nullptr);
905 dataStore(stream, info.elem_type, nullptr);
906 dataStore(stream, info.hmax, nullptr);
907 dataStore(stream, info.hmin, nullptr);
908 dataStore(stream, info.neighbor_ids, nullptr);
909 dataStore(stream, info.node_ids, nullptr);
910 dataStore(stream, info.num_sides, nullptr);
911 dataStore(stream, info.points, nullptr);
912 dataStore(stream, info.processor_id, nullptr);
913 dataStore(stream, info.subdomain_id, nullptr);
914 dataStore(stream, info.unique_id, nullptr);
915}
void dataStoreElemContainingInfo(std::ostream &stream, T &info)
Definition MeshInfo.C:892

◆ dataStore() [3/7]

void dataStore ( std::ostream &  stream,
MeshInfo::ElemInfoMap info_map,
void *   
)

Data store and load for info maps.

Definition at line 999 of file MeshInfo.C.

1000{
1001 dataStore(stream, info_map.map, nullptr);
1002}

◆ dataStore() [4/7]

void dataStore ( std::ostream &  stream,
MeshInfo::SidesetInfo info,
void *   
)

Definition at line 931 of file MeshInfo.C.

932{
933 dataStoreDomainInfo(stream, info);
934}
void dataStoreDomainInfo(std::ostream &stream, T &info)
Definition MeshInfo.C:918

◆ dataStore() [5/7]

void dataStore ( std::ostream &  stream,
MeshInfo::SidesetInfoMap info_map,
void *   
)

Definition at line 1004 of file MeshInfo.C.

1005{
1006 dataStore(stream, info_map.map, nullptr);
1007}

◆ dataStore() [6/7]

void dataStore ( std::ostream &  stream,
MeshInfo::SubdomainInfo info,
void *   
)

Definition at line 936 of file MeshInfo.C.

937{
938 dataStoreDomainInfo(stream, info);
939}

◆ dataStore() [7/7]

void dataStore ( std::ostream &  stream,
MeshInfo::SubdomainInfoMap info_map,
void *   
)

Definition at line 1009 of file MeshInfo.C.

1010{
1011 dataStore(stream, info_map.map, nullptr);
1012}

◆ to_json() [1/3]

void to_json ( nlohmann::json &  json,
const MeshInfo::ElemInfoMap info_map 
)

JSON serialization for info maps.

Definition at line 747 of file MeshInfo.C.

748{
749 const auto & items = info_map.items;
750 for (const auto & [id, info] : info_map.map)
751 {
752 mooseAssert(id == info.id, "Inconsistent id");
753
754 nlohmann::json info_json;
755 toJSONElemContainingInfo(info_json, info, items);
756 info_json["subdomain_id"] = info.subdomain_id;
757
758 // elem_qualities
759 if (info.elem_qualities.size())
760 for (const auto & [quality, value] : info.elem_qualities)
761 info_json["elem_qualities"][elemQualityToString(quality)] = value;
762 // dim
763 info_json_simple(dim);
764 // elem_mapping_type
765 info_json_enum(elem_mapping_type);
766 // elem_type
767 info_json_enum(elem_type);
768 // hmax
769 info_json_simple(hmax);
770 // hmin
771 info_json_simple(hmin);
772 // neighbor_ids
773 info_json_ids(neighbor_ids, libMesh::DofObject::invalid_id);
774 // node_ids
775 info_json_ids(node_ids, libMesh::DofObject::invalid_id);
776 // num_sides
777 info_json_simple(num_sides);
778 // points
779 info_json_simple(points);
780 // processor_id
781 info_json_simple(processor_id);
782 // unique_id
783 info_json_id(unique_id, libMesh::DofObject::invalid_unique_id);
784
785 json.push_back(std::move(info_json));
786 }
787}
void toJSONElemContainingInfo(nlohmann::json &info_json, const InfoType &info, const InfoItemsType &items)
Definition MeshInfo.C:738
std::string elemQualityToString(const libMesh::ElemQuality eq)
Definition MeshInfo.C:34
static constexpr dof_id_type invalid_id
static constexpr unique_id_type invalid_unique_id
ItemsType items
Which items are to be output.
Definition MeshInfo.h:264

◆ to_json() [2/3]

void to_json ( nlohmann::json &  json,
const MeshInfo::SidesetInfoMap info_map 
)

Definition at line 849 of file MeshInfo.C.

850{
851 toJSONDomainInfoMap(json, info_map);
852}
void toJSONDomainInfoMap(nlohmann::json &json, const DomainInfoMapType &info_map)
Definition MeshInfo.C:790

◆ to_json() [3/3]

void to_json ( nlohmann::json &  json,
const MeshInfo::SubdomainInfoMap info_map 
)

Definition at line 854 of file MeshInfo.C.

855{
856 toJSONDomainInfoMap(json, info_map);
857}