20 #include "SheafSystem/dof_tuple_type.h" 22 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/error_message.h" 40 static const string names[NOT_A_DOF_TUPLE_TYPE+1] =
42 "NAMESPACE_POSET_DOF_TUPLE_ID",
43 "PRIMITIVES_POSET_DOF_TUPLE_ID",
44 "ARRAY_POSET_DOF_TUPLE_ID",
45 "ARRAY_SECTION_DOF_TUPLE_ID",
46 "SPARSE_SECTOPM_DOF_TUPLE_ID",
47 "NOT_A_DOF_TUPLE_TYPE" 50 const string& result = names[xdt];
54 ensure(!result.empty());
78 if(xname ==
"NAMESPACE_POSET_DOF_TUPLE_ID")
80 result = NAMESPACE_POSET_DOF_TUPLE_ID;
82 else if(xname ==
"PRIMITIVES_POSET_DOF_TUPLE_ID")
84 result = PRIMITIVES_POSET_DOF_TUPLE_ID;
86 else if( xname ==
"ARRAY_POSET_DOF_TUPLE_ID")
88 result = ARRAY_POSET_DOF_TUPLE_ID;
90 else if( xname ==
"ARRAY_SECTION_DOF_TUPLE_ID")
92 result = ARRAY_SECTION_DOF_TUPLE_ID;
94 else if( xname ==
"SPARSE_SECTION_DOF_TUPLE_ID")
96 result = SPARSE_SECTION_DOF_TUPLE_ID;
100 result = NOT_A_DOF_TUPLE_TYPE;
124 NAMESPACE_POSET_DOF_TUPLE_ID,
125 PRIMITIVES_POSET_DOF_TUPLE_ID,
126 ARRAY_POSET_DOF_TUPLE_ID,
127 ARRAY_SECTION_DOF_TUPLE_ID,
128 SPARSE_SECTION_DOF_TUPLE_ID,
133 if((0 <= xi) && (xi < NOT_A_DOF_TUPLE_TYPE))
135 result = ltype_ids[xi];
139 result = NOT_A_DOF_TUPLE_TYPE;
SHEAF_DLL_SPEC dof_tuple_type dof_tuple_type_from_name(const std::string &xname)
The enumerator with name xname.
SHEAF_DLL_SPEC const std::string & dof_tuple_type_to_name(dof_tuple_type xdt)
The name of the enumerator xdt.
dof_tuple_type
Identifiers for dof tuple types.
SHEAF_DLL_SPEC dof_tuple_type dof_tuple_type_id(int xi)
The dof tuple type associated with int xi; converts int to dof tuple type.
SHEAF_DLL_SPEC std::istream & operator>>(std::istream &is, dof_tuple_type &xdt)
Extract dof_tuple_type xdt from istream& is.
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.