/[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 1748 by ksteube, Wed Sep 3 06:10:39 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 2047  std::string MeshAdapter::showTagNames() Line 2043  std::string MeshAdapter::showTagNames()
2043     return temp.str();     return temp.str();
2044  }  }
2045    
2046    int MeshAdapter::getNumberOfTagsInUse(int functionSpaceCode) const
2047    {
2048      Finley_Mesh* mesh=m_finleyMesh.get();
2049      dim_t numTags=0;
2050      switch(functionSpaceCode) {
2051       case(Nodes):
2052              numTags=mesh->Nodes->numTagsInUse;
2053              break;
2054       case(ReducedNodes):
2055              throw FinleyAdapterException("Error - ReducedNodes does not support tags");
2056              break;
2057       case(DegreesOfFreedom):
2058              throw FinleyAdapterException("Error - DegreesOfFreedom does not support tags");
2059              break;
2060       case(ReducedDegreesOfFreedom):
2061              throw FinleyAdapterException("Error - ReducedDegreesOfFreedom does not support tags");
2062              break;
2063       case(Elements):
2064       case(ReducedElements):
2065              numTags=mesh->Elements->numTagsInUse;
2066              break;
2067       case(FaceElements):
2068       case(ReducedFaceElements):
2069              numTags=mesh->FaceElements->numTagsInUse;
2070              break;
2071       case(Points):
2072              numTags=mesh->Points->numTagsInUse;
2073              break;
2074       case(ContactElementsZero):
2075       case(ReducedContactElementsZero):
2076       case(ContactElementsOne):
2077       case(ReducedContactElementsOne):
2078              numTags=mesh->ContactElements->numTagsInUse;
2079              break;
2080       default:
2081          stringstream temp;
2082          temp << "Error - Finley does not know anything about function space type " << functionSpaceCode;
2083          throw FinleyAdapterException(temp.str());
2084      }
2085      return numTags;
2086    }
2087    int* MeshAdapter::borrowListOfTagsInUse(int functionSpaceCode) const
2088    {
2089      Finley_Mesh* mesh=m_finleyMesh.get();
2090      index_t* tags=NULL;
2091      switch(functionSpaceCode) {
2092       case(Nodes):
2093              tags=mesh->Nodes->tagsInUse;
2094              break;
2095       case(ReducedNodes):
2096              throw FinleyAdapterException("Error - ReducedNodes does not support tags");
2097              break;
2098       case(DegreesOfFreedom):
2099              throw FinleyAdapterException("Error - DegreesOfFreedom does not support tags");
2100              break;
2101       case(ReducedDegreesOfFreedom):
2102              throw FinleyAdapterException("Error - ReducedDegreesOfFreedom does not support tags");
2103              break;
2104       case(Elements):
2105       case(ReducedElements):
2106              tags=mesh->Elements->tagsInUse;
2107              break;
2108       case(FaceElements):
2109       case(ReducedFaceElements):
2110              tags=mesh->FaceElements->tagsInUse;
2111              break;
2112       case(Points):
2113              tags=mesh->Points->tagsInUse;
2114              break;
2115       case(ContactElementsZero):
2116       case(ReducedContactElementsZero):
2117       case(ContactElementsOne):
2118       case(ReducedContactElementsOne):
2119              tags=mesh->ContactElements->tagsInUse;
2120              break;
2121       default:
2122          stringstream temp;
2123          temp << "Error - Finley does not know anything about function space type " << functionSpaceCode;
2124          throw FinleyAdapterException(temp.str());
2125      }
2126      return tags;
2127    }
2128    
2129    
2130  }  // end of namespace  }  // end of namespace

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

  ViewVC Help
Powered by ViewVC 1.1.26