/[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 964 by gross, Tue Feb 13 05:10:26 2007 UTC revision 1059 by gross, Fri Mar 23 11:01:53 2007 UTC
# Line 33  const int MeshAdapter::DegreesOfFreedom= Line 33  const int MeshAdapter::DegreesOfFreedom=
33  const int MeshAdapter::ReducedDegreesOfFreedom=FINLEY_REDUCED_DEGREES_OF_FREEDOM;  const int MeshAdapter::ReducedDegreesOfFreedom=FINLEY_REDUCED_DEGREES_OF_FREEDOM;
34  const int MeshAdapter::Nodes=FINLEY_NODES;  const int MeshAdapter::Nodes=FINLEY_NODES;
35  const int MeshAdapter::Elements=FINLEY_ELEMENTS;  const int MeshAdapter::Elements=FINLEY_ELEMENTS;
36    const int MeshAdapter::ReducedElements=FINLEY_REDUCED_ELEMENTS;
37  const int MeshAdapter::FaceElements=FINLEY_FACE_ELEMENTS;  const int MeshAdapter::FaceElements=FINLEY_FACE_ELEMENTS;
38    const int MeshAdapter::ReducedFaceElements=FINLEY_REDUCED_FACE_ELEMENTS;
39  const int MeshAdapter::Points=FINLEY_POINTS;  const int MeshAdapter::Points=FINLEY_POINTS;
40  const int MeshAdapter::ContactElementsZero=FINLEY_CONTACT_ELEMENTS_1;  const int MeshAdapter::ContactElementsZero=FINLEY_CONTACT_ELEMENTS_1;
41    const int MeshAdapter::ReducedContactElementsZero=FINLEY_REDUCED_CONTACT_ELEMENTS_1;
42  const int MeshAdapter::ContactElementsOne=FINLEY_CONTACT_ELEMENTS_2;  const int MeshAdapter::ContactElementsOne=FINLEY_CONTACT_ELEMENTS_2;
43    const int MeshAdapter::ReducedContactElementsOne=FINLEY_REDUCED_CONTACT_ELEMENTS_2;
44    
45  MeshAdapter::MeshAdapter(Finley_Mesh* finleyMesh)  MeshAdapter::MeshAdapter(Finley_Mesh* finleyMesh)
46  {  {
# Line 114  void MeshAdapter::setFunctionSpaceTypeNa Line 118  void MeshAdapter::setFunctionSpaceTypeNa
118    m_functionSpaceTypeNames.insert    m_functionSpaceTypeNames.insert
119      (FunctionSpaceNamesMapType::value_type(Elements,"Finley_Elements"));      (FunctionSpaceNamesMapType::value_type(Elements,"Finley_Elements"));
120    m_functionSpaceTypeNames.insert    m_functionSpaceTypeNames.insert
121        (FunctionSpaceNamesMapType::value_type(ReducedElements,"Finley_Reduced_Elements"));
122      m_functionSpaceTypeNames.insert
123      (FunctionSpaceNamesMapType::value_type(FaceElements,"Finley_Face_Elements"));      (FunctionSpaceNamesMapType::value_type(FaceElements,"Finley_Face_Elements"));
124    m_functionSpaceTypeNames.insert    m_functionSpaceTypeNames.insert
125        (FunctionSpaceNamesMapType::value_type(ReducedFaceElements,"Finley_Reduced_Face_Elements"));
126      m_functionSpaceTypeNames.insert
127      (FunctionSpaceNamesMapType::value_type(Points,"Finley_Points"));      (FunctionSpaceNamesMapType::value_type(Points,"Finley_Points"));
128    m_functionSpaceTypeNames.insert    m_functionSpaceTypeNames.insert
129      (FunctionSpaceNamesMapType::value_type(ContactElementsZero,"Finley_Contact_Elements_0"));      (FunctionSpaceNamesMapType::value_type(ContactElementsZero,"Finley_Contact_Elements_0"));
130    m_functionSpaceTypeNames.insert    m_functionSpaceTypeNames.insert
131        (FunctionSpaceNamesMapType::value_type(ReducedContactElementsZero,"Finley_Reduced_Contact_Elements_0"));
132      m_functionSpaceTypeNames.insert
133      (FunctionSpaceNamesMapType::value_type(ContactElementsOne,"Finley_Contact_Elements_1"));      (FunctionSpaceNamesMapType::value_type(ContactElementsOne,"Finley_Contact_Elements_1"));
134      m_functionSpaceTypeNames.insert
135        (FunctionSpaceNamesMapType::value_type(ReducedContactElementsOne,"Finley_Reduced_Contact_Elements_1"));
136  }  }
137    
138  int MeshAdapter::getContinuousFunctionCode() const  int MeshAdapter::getContinuousFunctionCode() const
# Line 132  int MeshAdapter::getFunctionCode() const Line 144  int MeshAdapter::getFunctionCode() const
144  {  {
145    return Elements;    return Elements;
146  }  }
147    int MeshAdapter::getReducedFunctionCode() const
148    {
149      return ReducedElements;
150    }
151    
152  int MeshAdapter::getFunctionOnBoundaryCode() const  int MeshAdapter::getFunctionOnBoundaryCode() const
153  {  {
154    return FaceElements;    return FaceElements;
155  }  }
156    int MeshAdapter::getReducedFunctionOnBoundaryCode() const
157    {
158      return ReducedFaceElements;
159    }
160    
161  int MeshAdapter::getFunctionOnContactZeroCode() const  int MeshAdapter::getFunctionOnContactZeroCode() const
162  {  {
163    return ContactElementsZero;    return ContactElementsZero;
164  }  }
165    int MeshAdapter::getReducedFunctionOnContactZeroCode() const
166    {
167      return ReducedContactElementsZero;
168    }
169    
170  int MeshAdapter::getFunctionOnContactOneCode() const  int MeshAdapter::getFunctionOnContactOneCode() const
171  {  {
172    return ContactElementsOne;    return ContactElementsOne;
173  }  }
174    int MeshAdapter::getReducedFunctionOnContactOneCode() const
175    {
176      return ReducedContactElementsOne;
177    }
178    
179  int MeshAdapter::getSolutionCode() const  int MeshAdapter::getSolutionCode() const
180  {  {
# Line 1071  int* MeshAdapter::borrowSampleReferenceI Line 1099  int* MeshAdapter::borrowSampleReferenceI
1099      break;      break;
1100    case(DegreesOfFreedom):    case(DegreesOfFreedom):
1101      out=mesh->Nodes->degreeOfFreedomId;      out=mesh->Nodes->degreeOfFreedomId;
 /*  
     for (i=0;i<mesh->Nodes->numNodes; ++i) {  
        if (mesh->Nodes->degreeOfFreedom[i]==sampleNo) {  
           out=mesh->Nodes->degreeOfFreedomIds[i];  
           break;  
        }  
     }  
 */  
1102      break;      break;
1103    case(ReducedDegreesOfFreedom):    case(ReducedDegreesOfFreedom):
1104      out=mesh->Nodes->reducedDegreeOfFreedomId;      out=mesh->Nodes->reducedDegreeOfFreedomId;
 /*  
     for (i=0;i<mesh->Nodes->numNodes; ++i) {  
        if (mesh->Nodes->reducedDegreeOfFreedom[i]==sampleNo) {  
           out=mesh->Nodes->Id[i];  
           break;  
        }  
     }  
 */  
1105      break;      break;
1106    default:    default:
1107      stringstream temp;      stringstream temp;
# Line 1138  void MeshAdapter::setTags(const int func Line 1150  void MeshAdapter::setTags(const int func
1150    return;    return;
1151  }  }
1152    
1153    void MeshAdapter::setTagMap(const std::string& name,  int tag)
1154    {
1155      Finley_Mesh* mesh=m_finleyMesh.get();
1156      Finley_Mesh_addTagMap(mesh, name.c_str(),tag);
1157      checkPasoError();
1158      // throwStandardException("MeshAdapter::set TagMap is not implemented.");
1159    }
1160    
1161    int MeshAdapter::getTag(const std::string& name) const
1162    {
1163      Finley_Mesh* mesh=m_finleyMesh.get();
1164      int tag=0;
1165      tag=Finley_Mesh_getTag(mesh, name.c_str());
1166      checkPasoError();
1167      // throwStandardException("MeshAdapter::getTag is not implemented.");
1168      return tag;
1169    }
1170    
1171    bool MeshAdapter::isValidTagName(const std::string& name) const
1172    {
1173      Finley_Mesh* mesh=m_finleyMesh.get();
1174      return Finley_Mesh_isValidTagName(mesh,name.c_str());
1175    }
1176    
1177    std::string MeshAdapter::showTagNames() const
1178    {
1179      stringstream temp;
1180      Finley_Mesh* mesh=m_finleyMesh.get();
1181      Finley_TagMap* tag_map=mesh->TagMap;
1182      while (tag_map) {
1183         temp << tag_map->name;
1184         tag_map=tag_map->next;
1185         if (tag_map) temp << ", ";
1186      }
1187      return temp.str();
1188    }
1189    
1190  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.964  
changed lines
  Added in v.1059

  ViewVC Help
Powered by ViewVC 1.1.26