コード例 #1
0
ファイル: Ioss_EntityBlock.C プロジェクト: agrippa/Trilinos
Ioss::EntityBlock::EntityBlock(Ioss::DatabaseIO *io_database, const std::string &my_name,
                               const std::string &entity_type, size_t entity_count)
    : Ioss::GroupingEntity(io_database, my_name, entity_count), idOffset(0)

{
  // The 'true' means it is ok for the factory to return
  // nullptr.  This is done here just so we can output a better
  // error message.
  topology_ = ElementTopology::factory(entity_type, true);
  if (topology_ == nullptr) {
    std::ostringstream errmsg;
    errmsg << "ERROR: The topology type '" << entity_type << "' is not supported"
           << " on " << name() << " in file " << io_database->get_filename();
    IOSS_ERROR(errmsg);
  }

  if (topology()->master_element_name() != entity_type && topology()->name() != entity_type) {
    // Maintain original element type on output database if possible.
    properties.add(Ioss::Property("original_topology_type", entity_type));
  }

  properties.add(Ioss::Property(this, "topology_node_count", Ioss::Property::INTEGER));
  properties.add(Ioss::Property(this, "topology_type", Ioss::Property::STRING));
  fields.add(Ioss::Field("connectivity", field_int_type(), topology_->name(), Ioss::Field::MESH,
                         entity_count));

  // Returns connectivity in local id space
  fields.add(Ioss::Field("connectivity_raw", field_int_type(), topology()->name(),
                         Ioss::Field::MESH, entity_count));
}
コード例 #2
0
ファイル: Ioss_SideBlock.C プロジェクト: crtrott/Trilinos
Ioss::SideBlock::SideBlock(Ioss::DatabaseIO *io_database,
			   const std::string& my_name,
			   const std::string& side_type,
			   const std::string& element_type,
			   size_t side_count)
  : Ioss::EntityBlock(io_database, my_name, side_type, side_count), owner_(nullptr),
    parentTopology_(nullptr), parentElementBlock_(nullptr), consistentSideNumber(-1)
{
  parentTopology_ = ElementTopology::factory(element_type);
  assert(parentTopology_ != nullptr);

  properties.add(Ioss::Property(this, "parent_topology_type",
			       Ioss::Property::STRING));

  properties.add(Ioss::Property(this, "distribution_factor_count",
				Ioss::Property::INTEGER));
  
  fields.add(Ioss::Field("element_side",
			 field_int_type(), "pair",
			 Ioss::Field::MESH, side_count));

  // Same as element_side except that the element id are the local
  // element position (1-based) and not the global element id.
  fields.add(Ioss::Field("element_side_raw",
			 field_int_type(), "pair",
			 Ioss::Field::MESH, side_count));
  
  // Distribution factors are optional...
}
コード例 #3
0
ファイル: Ioss_ElementBlock.C プロジェクト: agrippa/Trilinos
 ElementBlock::ElementBlock(DatabaseIO *io_database, const std::string &my_name,
                            const std::string &element_type, int64_t number_elements)
     : EntityBlock(io_database, my_name, element_type, number_elements)
 {
   // The 1..global_element_count id.  In a parallel-decomposed run,
   // if maps the element back to its implicit position in the serial
   // undecomposed mesh file.  This is ONLY provided for backward-
   // compatibility and should not be used unless absolutely required.
   fields.add(Ioss::Field("implicit_ids", field_int_type(), "scalar", Ioss::Field::MESH,
                          number_elements));
 }
コード例 #4
0
Ioss::CommSet::CommSet(Ioss::DatabaseIO *io_database, const std::string &my_name,
                       const std::string &entity_type, size_t entity_count)
    : Ioss::GroupingEntity(io_database, my_name, entity_count)
{
    assert(entity_type == "node" || entity_type == "side");
    properties.add(Ioss::Property("entity_type", entity_type));

    if (entity_type == "node") {
        // Field contains a pair of type [entity_id, shared_cpu]
        fields.add(Ioss::Field("entity_processor", field_int_type(), "pair", Ioss::Field::COMMUNICATION,
                               entity_count));
        fields.add(Ioss::Field("entity_processor_raw", field_int_type(), "pair",
                               Ioss::Field::COMMUNICATION, entity_count));
    }
    else {
        // Field contains a triplet of type [entity_id, local_side, shared_cpu]
        fields.add(Ioss::Field("entity_processor", field_int_type(), "Real[3]",
                               Ioss::Field::COMMUNICATION, entity_count));
        fields.add(Ioss::Field("entity_processor_raw", field_int_type(), "Real[3]",
                               Ioss::Field::COMMUNICATION, entity_count));
    }
}
コード例 #5
0
ファイル: Ioss_EntitySet.C プロジェクト: 00liujj/trilinos
Ioss::EntitySet::EntitySet(Ioss::DatabaseIO *io_database,
			   const std::string& my_name,
			   size_t entity_count)
  : Ioss::GroupingEntity(io_database, my_name, entity_count)
{
  properties.add(Ioss::Property("distribution_factor_count",
				static_cast<int>(entity_count)));

  // Add the standard fields...
  fields.add(Ioss::Field("distribution_factors",
			 Ioss::Field::REAL, "scalar",
			 Ioss::Field::MESH, entity_count));
  fields.add(Ioss::Field("ids_raw",
			 field_int_type(), "scalar",
			 Ioss::Field::MESH, entity_count));
}