Exemple #1
0
Block::Block(const Ioss::ElementBlock &other)
{
  id                  = other.get_property("id").get_int();
  elementCount        = other.get_property("entity_count").get_int();
  nodesPerElement     = other.get_property("topology_node_count").get_int();
  attributeCount      = other.get_property("attribute_count").get_int();
  offset_             = other.get_offset();
  std::string el_type = other.get_property("topology_type").get_string();
  if (other.property_exists("original_topology_type")) {
    el_type = other.get_property("original_topology_type").get_string();
  }

  std::strncpy(elType, el_type.c_str(), MAX_STR_LENGTH);
  elType[MAX_STR_LENGTH] = 0;

  // Fixup an exodusII kludge.  For triangular elements, the same
  // name is used for 2D elements and 3D shell elements.  Convert
  // to unambiguous names for the IO Subsystem.  The 2D name
  // stays the same, the 3D name becomes 'trishell#'
  // Here, we need to map back to the 'triangle' name...
  if (std::strncmp(elType, "trishell", 8) == 0)
    std::strncpy(elType, "triangle", 8);

  std::string io_name = other.name();
  std::strncpy(name, io_name.c_str(), MAX_STR_LENGTH);
  name[MAX_STR_LENGTH] = 0;
}