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

Diff of /trunk/finley/src/CPPAdapter/MeshAdapter.cpp

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

revision 757 by woo409, Mon Jun 26 13:12:56 2006 UTC revision 793 by dhawcroft, Sat Jul 29 19:40:22 2006 UTC
# Line 716  void MeshAdapter::saveDX(const std::stri Line 716  void MeshAdapter::saveDX(const std::stri
716      for (int i=0;i<num_data;++i) {      for (int i=0;i<num_data;++i) {
717           escript::Data& d=boost::python::extract<escript::Data&>(arg[keys[i]]);           escript::Data& d=boost::python::extract<escript::Data&>(arg[keys[i]]);
718           if (dynamic_cast<const MeshAdapter&>(d.getFunctionSpace().getDomain()) !=*this)           if (dynamic_cast<const MeshAdapter&>(d.getFunctionSpace().getDomain()) !=*this)
719               throw FinleyAdapterException("Error  in saveVTK: Data must be defined on same Domain");               throw FinleyAdapterException("Error  in saveDX: Data must be defined on same Domain");
720           data[i]=d.getDataC();           data[i]=d.getDataC();
721           ptr_data[i]=&(data[i]);           ptr_data[i]=&(data[i]);
722           std::string n=boost::python::extract<std::string>(keys[i]);           std::string n=boost::python::extract<std::string>(keys[i]);
# Line 776  void MeshAdapter::saveVTK(const std::str Line 776  void MeshAdapter::saveVTK(const std::str
776              strcpy(c_names[i],n.c_str());              strcpy(c_names[i],n.c_str());
777           }           }
778      }      }
779    #ifndef PASO_MPI    
780      Finley_Mesh_saveVTK(filename.c_str(),m_finleyMesh.get(),num_data,c_names,ptr_data);      Finley_Mesh_saveVTK(filename.c_str(),m_finleyMesh.get(),num_data,c_names,ptr_data);
781      checkFinleyError();  #else
782        Finley_Mesh_saveVTK_MPIO(filename.c_str(),m_finleyMesh.get(),num_data,c_names,ptr_data);
783    #endif
784    
785    checkFinleyError();
786    /* win32 refactor */    /* win32 refactor */
787    TMPMEMFREE(c_names);    TMPMEMFREE(c_names);
788    TMPMEMFREE(data);    TMPMEMFREE(data);
# Line 1083  int MeshAdapter::getReferenceNoFromSampl Line 1088  int MeshAdapter::getReferenceNoFromSampl
1088    return out;    return out;
1089  }  }
1090    
1091    void MeshAdapter::setTags(const int functionSpaceType, const int newTag, const escript::Data& mask) const
1092    {
1093      Finley_Mesh* mesh=m_finleyMesh.get();
1094      escriptDataC tmp=mask.getDataC();
1095      switch(functionSpaceType) {
1096           case(Nodes):
1097              Finley_NodeFile_setTags(mesh->Nodes,newTag,&tmp);
1098              break;
1099           case(DegreesOfFreedom):
1100              throw FinleyAdapterException("Error - DegreesOfFreedom does not support tags");
1101              break;
1102           case(ReducedDegreesOfFreedom):
1103              throw FinleyAdapterException("Error - ReducedDegreesOfFreedom does not support tags");
1104              break;
1105           case(Elements):
1106              Finley_ElementFile_setTags(mesh->Elements,newTag,&tmp);
1107              break;
1108           case(FaceElements):
1109              Finley_ElementFile_setTags(mesh->FaceElements,newTag,&tmp);
1110              break;
1111           case(Points):
1112              Finley_ElementFile_setTags(mesh->Points,newTag,&tmp);
1113              break;
1114           case(ContactElementsZero):
1115              Finley_ElementFile_setTags(mesh->ContactElements,newTag,&tmp);
1116              break;
1117           case(ContactElementsOne):
1118              Finley_ElementFile_setTags(mesh->ContactElements,newTag,&tmp);
1119              break;
1120           default:
1121              stringstream temp;
1122              temp << "Error - Finley does not know anything about function space type " << functionSpaceType;
1123              throw FinleyAdapterException(temp.str());
1124      }
1125      checkFinleyError();
1126      return;
1127    }
1128    
1129    
1130  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.757  
changed lines
  Added in v.793

  ViewVC Help
Powered by ViewVC 1.1.26