コード例 #1
0
 apf::MeshTag* setWeights(bool vtx, bool edge, bool elm) {
   apf::MeshTag* tag = m->createDoubleTag("parma_weight",1);
   if (vtx)
     setEntWeights(0,tag);
   if (edge)
     setEntWeights(1,tag);
   if (elm) {
     setEntWeights(m->getDimension(),tag);
   }
   return tag;
 }
コード例 #2
0
 //Helper function to set the weights of each dimension needed by the specific parma algorithm
 apf::MeshTag* setWeights(bool vtx, bool edge, bool elm) {
   int num_ws=1;
   if (vtx)
     num_ws = std::max(num_ws,adapter->getNumWeightsPerOf(MESH_VERTEX));
   if (edge)
     num_ws = std::max(num_ws,adapter->getNumWeightsPerOf(MESH_EDGE));
   if (elm) 
     num_ws = std::max(num_ws,adapter->getNumWeightsPerOf(entityAPFtoZ2(m->getDimension())));
   apf::MeshTag* tag = m->createDoubleTag("parma_weight",num_ws);
   if (vtx)
     setEntWeights(0,tag);
   if (edge)
     setEntWeights(1,tag);
   if (elm) {
     setEntWeights(m->getDimension(),tag);
   }
   return tag;
 }