14 #include <stk_linsys/ImplDetails.hpp> 24 FieldIdMap::iterator iter = field_id_map.find(&field);
26 if (iter == field_id_map.end()) {
27 iter = field_id_map.insert(iter, std::make_pair(&field,field_id_map.size()));
37 FieldIdMap::const_iterator iter = field_id_map.find(&field);
39 if (iter == field_id_map.end()) {
40 std::ostringstream msg;
41 msg <<
"stk_classic::linsys::query_field_to_int_mapping ERROR: " 42 <<
" field with name '"<<field.name()<<
"' not found in field-to-int map.";
43 std::string str = msg.str();
44 throw std::runtime_error(str);
54 FieldIdMap::const_iterator
55 iter = field_id_map.begin(), iter_end = field_id_map.end();
57 while(iter!=iter_end && iter->second != field_id) ++iter;
59 if (iter == iter_end) {
60 std::ostringstream msg;
61 msg <<
"stk_classic::linsys::get_dof ERROR: " 62 <<
"field_id ("<<field_id<<
") returned from fei query is not mapped to a stk_classic::mesh::Field.";
63 std::string str = msg.str();
64 throw std::runtime_error(str);
81 int int_id =
static_cast<int>(id);
int entitytype_to_int(stk_classic::mesh::EntityRank entity_rank)
const stk_classic::mesh::FieldBase * get_field(const FieldIdMap &field_id_map, int field_id)
Field base class with an anonymous data type and anonymous multi-dimension.
std::map< const stk_classic::mesh::FieldBase *, int > FieldIdMap
int entityid_to_int(stk_classic::mesh::EntityId id)
int map_field_to_int(FieldIdMap &field_id_map, const stk_classic::mesh::FieldBase &field)
int query_field_to_int_mapping(const FieldIdMap &field_id_map, const stk_classic::mesh::FieldBase &field)
EntityRank entity_rank(const EntityKey &key)
Given an entity key, return an entity type (rank).
void verify_convertible_to_int(T id, const char *caller)