/[escript]/branches/diaplayground/finley/src/CPPAdapter/MeshAdapter.cpp
ViewVC logotype

Diff of /branches/diaplayground/finley/src/CPPAdapter/MeshAdapter.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1632 by trankine, Sat Jul 12 07:17:50 2008 UTC revision 1754 by ksteube, Sun Sep 7 22:07:26 2008 UTC
# Line 124  void MeshAdapter::dump(const std::string Line 124  void MeshAdapter::dump(const std::string
124     int num_FaceElements_numNodes    = mesh->FaceElements->numNodes;     int num_FaceElements_numNodes    = mesh->FaceElements->numNodes;
125     int num_ContactElements_numNodes = mesh->ContactElements->numNodes;     int num_ContactElements_numNodes = mesh->ContactElements->numNodes;
126    
    // I don't think the strdup is needed since Paso_MPI_appendRankToFileName  
    // does it's own allocation.  
    // char *newFileName = Paso_MPI_appendRankToFileName(strdup(fileName.c_str()), mpi_size, mpi_rank);  
   
127     char *newFileName = Paso_MPI_appendRankToFileName(fileName.c_str(),     char *newFileName = Paso_MPI_appendRankToFileName(fileName.c_str(),
128                                                       mpi_size, mpi_rank);                                                       mpi_size, mpi_rank);
129    
# Line 652  int MeshAdapter::getDim() const Line 648  int MeshAdapter::getDim() const
648  }  }
649    
650  //  //
651    // Return the number of data points summed across all MPI processes
652    //
653    int MeshAdapter::getNumDataPointsGlobal() const
654    {
655       return Finley_NodeFile_getGlobalNumNodes(m_finleyMesh.get()->Nodes);
656    }
657    
658    //
659  // return the number of data points per sample and the number of samples  // return the number of data points per sample and the number of samples
660  // needed to represent data on a parts of the mesh.  // needed to represent data on a parts of the mesh.
661  //  //
# Line 2047  std::string MeshAdapter::showTagNames() Line 2051  std::string MeshAdapter::showTagNames()
2051     return temp.str();     return temp.str();
2052  }  }
2053    
2054    int MeshAdapter::getNumberOfTagsInUse(int functionSpaceCode) const
2055    {
2056      Finley_Mesh* mesh=m_finleyMesh.get();
2057      dim_t numTags=0;
2058      switch(functionSpaceCode) {
2059       case(Nodes):
2060              numTags=mesh->Nodes->numTagsInUse;
2061              break;
2062       case(ReducedNodes):
2063              throw FinleyAdapterException("Error - ReducedNodes does not support tags");
2064              break;
2065       case(DegreesOfFreedom):
2066              throw FinleyAdapterException("Error - DegreesOfFreedom does not support tags");
2067              break;
2068       case(ReducedDegreesOfFreedom):
2069              throw FinleyAdapterException("Error - ReducedDegreesOfFreedom does not support tags");
2070              break;
2071       case(Elements):
2072       case(ReducedElements):
2073              numTags=mesh->Elements->numTagsInUse;
2074              break;
2075       case(FaceElements):
2076       case(ReducedFaceElements):
2077              numTags=mesh->FaceElements->numTagsInUse;
2078              break;
2079       case(Points):
2080              numTags=mesh->Points->numTagsInUse;
2081              break;
2082       case(ContactElementsZero):
2083       case(ReducedContactElementsZero):
2084       case(ContactElementsOne):
2085       case(ReducedContactElementsOne):
2086              numTags=mesh->ContactElements->numTagsInUse;
2087              break;
2088       default:
2089          stringstream temp;
2090          temp << "Error - Finley does not know anything about function space type " << functionSpaceCode;
2091          throw FinleyAdapterException(temp.str());
2092      }
2093      return numTags;
2094    }
2095    int* MeshAdapter::borrowListOfTagsInUse(int functionSpaceCode) const
2096    {
2097      Finley_Mesh* mesh=m_finleyMesh.get();
2098      index_t* tags=NULL;
2099      switch(functionSpaceCode) {
2100       case(Nodes):
2101              tags=mesh->Nodes->tagsInUse;
2102              break;
2103       case(ReducedNodes):
2104              throw FinleyAdapterException("Error - ReducedNodes does not support tags");
2105              break;
2106       case(DegreesOfFreedom):
2107              throw FinleyAdapterException("Error - DegreesOfFreedom does not support tags");
2108              break;
2109       case(ReducedDegreesOfFreedom):
2110              throw FinleyAdapterException("Error - ReducedDegreesOfFreedom does not support tags");
2111              break;
2112       case(Elements):
2113       case(ReducedElements):
2114              tags=mesh->Elements->tagsInUse;
2115              break;
2116       case(FaceElements):
2117       case(ReducedFaceElements):
2118              tags=mesh->FaceElements->tagsInUse;
2119              break;
2120       case(Points):
2121              tags=mesh->Points->tagsInUse;
2122              break;
2123       case(ContactElementsZero):
2124       case(ReducedContactElementsZero):
2125       case(ContactElementsOne):
2126       case(ReducedContactElementsOne):
2127              tags=mesh->ContactElements->tagsInUse;
2128              break;
2129       default:
2130          stringstream temp;
2131          temp << "Error - Finley does not know anything about function space type " << functionSpaceCode;
2132          throw FinleyAdapterException(temp.str());
2133      }
2134      return tags;
2135    }
2136    
2137    
2138  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.1632  
changed lines
  Added in v.1754

  ViewVC Help
Powered by ViewVC 1.1.26