Ejemplo n.º 1
0
static void loadSets(
    const Teuchos::RCP<Teuchos::ParameterList>& params,
    apf::StkModels& sets,
    const char* param_name,
    int geom_dim,
    int mesh_dim)
{
  // User has specified associations in the input file
  if(params->isParameter(param_name)) {
    // Get element block associations from input file
    Teuchos::TwoDArray< std::string > pairs;
    pairs = params->get<Teuchos::TwoDArray<std::string> >(param_name);
    int npairs = pairs.getNumCols();
    size_t start = sets[mesh_dim].getSize();
    sets[mesh_dim].setSize(start + npairs);
    for(int i = 0; i < npairs; ++i) {
      apf::StkModel& set = sets[mesh_dim][start + i];
      set.dim = geom_dim;
      set.apfTag = atoi(pairs(0, i).c_str());
      set.stkName = pairs(1, i);
    }
  }
}
Ejemplo n.º 2
0
static void loadSets(
    apf::Mesh* m,
    const Teuchos::RCP<Teuchos::ParameterList>& params,
    apf::StkModels& sets,
    const char* param_name,
    int geom_dim,
    int mesh_dim)
{
  // User has specified associations in the input file
  if(params->isParameter(param_name)) {
    // Get element block associations from input file
    Teuchos::TwoDArray< std::string > pairs;
    pairs = params->get<Teuchos::TwoDArray<std::string> >(param_name);
    int npairs = pairs.getNumCols();
    for(int i = 0; i < npairs; ++i) {
      apf::StkModel* set = new apf::StkModel();
      int geom_tag = atoi(pairs(0, i).c_str());
      set->ents.push_back(m->findModelEntity(geom_dim, geom_tag));
      set->stkName = pairs(1, i);
      sets.models[mesh_dim].push_back(set);
    }
  }
}