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

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

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

revision 6143 by caltinay, Tue Apr 5 07:05:01 2016 UTC revision 6144 by caltinay, Wed Apr 6 05:25:13 2016 UTC
# Line 26  Line 26 
26  #include <paso/SystemMatrix.h>  #include <paso/SystemMatrix.h>
27  #include <paso/Transport.h>  #include <paso/Transport.h>
28    
29  #ifdef USE_NETCDF  #ifdef ESYS_HAVE_NETCDF
30  #include <netcdfcpp.h>  #include <netcdfcpp.h>
31  #endif  #endif
32    
33  #ifdef USE_TRILINOS  #ifdef ESYS_HAVE_TRILINOS
34  #include <trilinoswrap/TrilinosMatrixAdapter.h>  #include <trilinoswrap/TrilinosMatrixAdapter.h>
35    
36  using esys_trilinos::TrilinosMatrixAdapter;  using esys_trilinos::TrilinosMatrixAdapter;
# Line 120  void MeshAdapter::Print_Mesh_Info(bool f Line 120  void MeshAdapter::Print_Mesh_Info(bool f
120    
121  void MeshAdapter::dump(const string& fileName) const  void MeshAdapter::dump(const string& fileName) const
122  {  {
123  #ifdef USE_NETCDF  #ifdef ESYS_HAVE_NETCDF
124     const NcDim* ncdims[12] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};     const NcDim* ncdims[12] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
125     NcVar* ids;     NcVar* ids;
126     index_t* index_ptr;     index_t* index_ptr;
# Line 415  void MeshAdapter::dump(const string& fil Line 415  void MeshAdapter::dump(const string& fil
415    
416      // NetCDF file is closed by destructor of NcFile object      // NetCDF file is closed by destructor of NcFile object
417    
418  #else // USE_NETCDF  #else
419      throw DudleyException("MeshAdapter::dump: not configured with netCDF. "      throw DudleyException("MeshAdapter::dump: not configured with netCDF. "
420                            "Please contact your installation manager.");                            "Please contact your installation manager.");
421  #endif // USE_NETCDF  #endif // ESYS_HAVE_NETCDF
422  }  }
423    
424  string MeshAdapter::getDescription() const  string MeshAdapter::getDescription() const
# Line 614  void MeshAdapter::addPDEToSystem( Line 614  void MeshAdapter::addPDEToSystem(
614      if (!d_contact.isEmpty() || !y_contact.isEmpty())      if (!d_contact.isEmpty() || !y_contact.isEmpty())
615          throw DudleyException("Dudley does not support contact elements");          throw DudleyException("Dudley does not support contact elements");
616    
617  #ifdef USE_TRILINOS  #ifdef ESYS_HAVE_TRILINOS
618      TrilinosMatrixAdapter* tm = dynamic_cast<TrilinosMatrixAdapter*>(&mat);      TrilinosMatrixAdapter* tm = dynamic_cast<TrilinosMatrixAdapter*>(&mat);
619      if (tm) {      if (tm) {
620          tm->resumeFill();          tm->resumeFill();
# Line 631  void MeshAdapter::addPDEToSystem( Line 631  void MeshAdapter::addPDEToSystem(
631                   escript::Data(), escript::Data(), d_dirac,                   escript::Data(), escript::Data(), d_dirac,
632                   escript::Data(), y_dirac);                   escript::Data(), y_dirac);
633    
634  #ifdef USE_TRILINOS  #ifdef ESYS_HAVE_TRILINOS
635      if (tm) {      if (tm) {
636          tm->fillComplete(true);          tm->fillComplete(true);
637      }      }
# Line 1060  bool MeshAdapter::ownSample(int fs_code, Line 1060  bool MeshAdapter::ownSample(int fs_code,
1060      return true;      return true;
1061  }  }
1062    
1063  #ifdef USE_TRILINOS  #ifdef ESYS_HAVE_TRILINOS
1064  const_TrilinosGraph_ptr MeshAdapter::getTrilinosGraph() const  const_TrilinosGraph_ptr MeshAdapter::getTrilinosGraph() const
1065  {  {
1066      if (m_graph.is_null()) {      if (m_graph.is_null()) {
# Line 1095  escript::ASM_ptr MeshAdapter::newSystemM Line 1095  escript::ASM_ptr MeshAdapter::newSystemM
1095    
1096      // generate matrix      // generate matrix
1097      if (type & (int)SMT_TRILINOS) {      if (type & (int)SMT_TRILINOS) {
1098  #ifdef USE_TRILINOS  #ifdef ESYS_HAVE_TRILINOS
1099          const_TrilinosGraph_ptr graph(getTrilinosGraph());          const_TrilinosGraph_ptr graph(getTrilinosGraph());
1100          escript::ASM_ptr sm(new TrilinosMatrixAdapter(m_dudleyMesh->MPIInfo,          escript::ASM_ptr sm(new TrilinosMatrixAdapter(m_dudleyMesh->MPIInfo,
1101                      row_blocksize, row_functionspace, graph));                      row_blocksize, row_functionspace, graph));
# Line 1345  int MeshAdapter::getSystemMatrixTypeId(c Line 1345  int MeshAdapter::getSystemMatrixTypeId(c
1345    
1346      int package = sb.getPackage();      int package = sb.getPackage();
1347      if (package == escript::SO_PACKAGE_TRILINOS) {      if (package == escript::SO_PACKAGE_TRILINOS) {
1348  #ifdef USE_TRILINOS  #ifdef ESYS_HAVE_TRILINOS
1349          return (int)SMT_TRILINOS;          return (int)SMT_TRILINOS;
1350  #else  #else
1351          throw DudleyException("Trilinos requested but not built with Trilinos.");                throw DudleyException("Trilinos requested but not built with Trilinos.");      

Legend:
Removed from v.6143  
changed lines
  Added in v.6144

  ViewVC Help
Powered by ViewVC 1.1.26