/[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 2385 by gross, Wed Apr 15 03:52:38 2009 UTC revision 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*******************************************************
3  *  *
4  * Copyright (c) 2003-2008 by University of Queensland  * Copyright (c) 2003-2009 by University of Queensland
5  * Earth Systems Science Computational Center (ESSCC)  * Earth Systems Science Computational Center (ESSCC)
6  * http://www.uq.edu.au/esscc  * http://www.uq.edu.au/esscc
7  *  *
# Line 109  void MeshAdapter::write(const std::strin Line 109  void MeshAdapter::write(const std::strin
109     TMPMEMFREE(fName);     TMPMEMFREE(fName);
110  }  }
111    
112  void MeshAdapter::Print_Mesh_Info(const bool full=false) const  void MeshAdapter::Print_Mesh_Info(const bool full) const
113  {  {
114     Finley_PrintMesh_Info(m_finleyMesh.get(), full);     Finley_PrintMesh_Info(m_finleyMesh.get(), full);
115  }  }
# Line 1453  void MeshAdapter::setNewX(const escript: Line 1453  void MeshAdapter::setNewX(const escript:
1453     const MeshAdapter& newDomain=dynamic_cast<const MeshAdapter&>(*(new_x.getFunctionSpace().getDomain()));     const MeshAdapter& newDomain=dynamic_cast<const MeshAdapter&>(*(new_x.getFunctionSpace().getDomain()));
1454     if (newDomain!=*this)     if (newDomain!=*this)
1455        throw FinleyAdapterException("Error - Illegal domain of new point locations");        throw FinleyAdapterException("Error - Illegal domain of new point locations");
1456     tmp = new_x.getDataC();     if ( new_x.getFunctionSpace() == continuousFunction(asAbstractContinuousDomain()) ) {
1457     Finley_Mesh_setCoordinates(mesh,&tmp);         tmp = new_x.getDataC();
1458           Finley_Mesh_setCoordinates(mesh,&tmp);
1459       } else {
1460           escript::Data new_x_inter=escript::Data( new_x,  continuousFunction(asAbstractContinuousDomain()) );
1461           tmp = new_x_inter.getDataC();
1462           Finley_Mesh_setCoordinates(mesh,&tmp);
1463       }
1464     checkFinleyError();     checkFinleyError();
1465  }  }
1466    
# Line 1512  void MeshAdapter::saveDX(const std::stri Line 1518  void MeshAdapter::saveDX(const std::stri
1518  //  //
1519  // saves mesh and optionally data arrays in VTK format  // saves mesh and optionally data arrays in VTK format
1520  //  //
1521  void MeshAdapter::saveVTK(const std::string& filename,const boost::python::dict& arg) const  void MeshAdapter::saveVTK(const std::string& filename,const boost::python::dict& arg,  const std::string& metadata, const std::string& metadata_schema) const
1522  {  {
1523     int num_data;     int num_data;
1524     char **names;     char **names;
# Line 1520  void MeshAdapter::saveVTK(const std::str Line 1526  void MeshAdapter::saveVTK(const std::str
1526     escriptDataC **ptr_data;     escriptDataC **ptr_data;
1527    
1528     extractArgsFromDict(arg, num_data, names, data, ptr_data);     extractArgsFromDict(arg, num_data, names, data, ptr_data);
1529     Finley_Mesh_saveVTK(filename.c_str(), m_finleyMesh.get(), num_data, names, ptr_data);     Finley_Mesh_saveVTK(filename.c_str(), m_finleyMesh.get(), num_data, names, ptr_data, metadata.c_str(), metadata_schema.c_str());
1530     checkFinleyError();     checkFinleyError();
1531    
1532     /* win32 refactor */     /* win32 refactor */
# Line 1858  escript::Data MeshAdapter::getSize() con Line 1864  escript::Data MeshAdapter::getSize() con
1864     return escript::function(asAbstractContinuousDomain()).getSize();     return escript::function(asAbstractContinuousDomain()).getSize();
1865  }  }
1866    
1867  int* MeshAdapter::borrowSampleReferenceIDs(int functionSpaceType) const  const int* MeshAdapter::borrowSampleReferenceIDs(int functionSpaceType) const
1868  {  {
1869     int *out = NULL;     int *out = NULL;
1870     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
# Line 2095  int MeshAdapter::getNumberOfTagsInUse(in Line 2101  int MeshAdapter::getNumberOfTagsInUse(in
2101    }    }
2102    return numTags;    return numTags;
2103  }  }
2104  int* MeshAdapter::borrowListOfTagsInUse(int functionSpaceCode) const  
2105    const int* MeshAdapter::borrowListOfTagsInUse(int functionSpaceCode) const
2106  {  {
2107    Finley_Mesh* mesh=m_finleyMesh.get();    Finley_Mesh* mesh=m_finleyMesh.get();
2108    index_t* tags=NULL;    index_t* tags=NULL;
# Line 2161  bool MeshAdapter::canTag(int functionSpa Line 2168  bool MeshAdapter::canTag(int functionSpa
2168    }    }
2169  }  }
2170    
2171    AbstractDomain::StatusType MeshAdapter::getStatus() const
2172    {
2173      Finley_Mesh* mesh=m_finleyMesh.get();
2174      return Finley_Mesh_getStatus(mesh);
2175    }
2176    
2177    
2178    
2179  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.2385  
changed lines
  Added in v.2548

  ViewVC Help
Powered by ViewVC 1.1.26