/[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 3793 by gross, Wed Feb 1 07:39:43 2012 UTC revision 3998 by caltinay, Thu Sep 27 01:17:28 2012 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*****************************************************************************
3  *  *
4  * Copyright (c) 2003-2010 by University of Queensland  * Copyright (c) 2003-2012 by University of Queensland
5  * Earth Systems Science Computational Center (ESSCC)  * http://www.uq.edu.au
 * http://www.uq.edu.au/esscc  
6  *  *
7  * Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
8  * Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
9  * http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
10  *  *
11  *******************************************************/  * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12    * Development since 2012 by School of Earth Sciences
13    *
14    *****************************************************************************/
15    
16  #include <pasowrap/PasoException.h>  #include <pasowrap/PasoException.h>
17  #include <pasowrap/TransportProblemAdapter.h>  #include <pasowrap/TransportProblemAdapter.h>
# Line 1512  void MeshAdapter::setNewX(const escript: Line 1514  void MeshAdapter::setNewX(const escript:
1514         tmp = new_x.getDataC();         tmp = new_x.getDataC();
1515         Finley_Mesh_setCoordinates(mesh,&tmp);         Finley_Mesh_setCoordinates(mesh,&tmp);
1516     } else {     } else {
1517         escript::Data new_x_inter=escript::Data( new_x,  continuousFunction(*this) );         throw FinleyAdapterException("As of version escript3.3 - SetNewX only accepts ContinuousFunction arguments please interpolate.");    
1518    /*       escript::Data new_x_inter=escript::Data( new_x,  continuousFunction(*this) );
1519         tmp = new_x_inter.getDataC();         tmp = new_x_inter.getDataC();
1520         Finley_Mesh_setCoordinates(mesh,&tmp);         Finley_Mesh_setCoordinates(mesh,&tmp);*/
1521     }     }
1522     checkFinleyError();     checkFinleyError();
1523  }  }
# Line 1566  void MeshAdapter::saveDX(const string& f Line 1569  void MeshAdapter::saveDX(const string& f
1569        TMPMEMFREE(names[i]);        TMPMEMFREE(names[i]);
1570     }     }
1571     TMPMEMFREE(names);     TMPMEMFREE(names);
   
    return;  
1572  }  }
1573    
1574  //  //
# Line 1582  void MeshAdapter::saveVTK(const string& Line 1583  void MeshAdapter::saveVTK(const string&
1583    
1584  bool MeshAdapter::ownSample(int fs_code, index_t id) const  bool MeshAdapter::ownSample(int fs_code, index_t id) const
1585  {  {
1586        if (getMPISize() > 1) {
1587  #ifdef ESYS_MPI  #ifdef ESYS_MPI
1588      index_t myFirstNode=0, myLastNode=0, k=0;          index_t myFirstNode=0, myLastNode=0, k=0;
1589      index_t* globalNodeIndex=0;          index_t* globalNodeIndex=0;
1590      Finley_Mesh* mesh_p=m_finleyMesh.get();          Finley_Mesh* mesh_p=m_finleyMesh.get();
1591      if (fs_code == FINLEY_REDUCED_NODES)          /*
1592      {           * this method is only used by saveDataCSV which would use the returned
1593      myFirstNode = Finley_NodeFile_getFirstReducedNode(mesh_p->Nodes);           * values for reduced nodes wrongly so this case is disabled for now
1594      myLastNode = Finley_NodeFile_getLastReducedNode(mesh_p->Nodes);          if (fs_code == FINLEY_REDUCED_NODES)
1595      globalNodeIndex = Finley_NodeFile_borrowGlobalReducedNodesIndex(mesh_p->Nodes);          {
1596      }              myFirstNode = Finley_NodeFile_getFirstReducedNode(mesh_p->Nodes);
1597      else              myLastNode = Finley_NodeFile_getLastReducedNode(mesh_p->Nodes);
1598      {              globalNodeIndex = Finley_NodeFile_borrowGlobalReducedNodesIndex(mesh_p->Nodes);
1599      myFirstNode = Finley_NodeFile_getFirstNode(mesh_p->Nodes);          }
1600      myLastNode = Finley_NodeFile_getLastNode(mesh_p->Nodes);          else
1601      globalNodeIndex = Finley_NodeFile_borrowGlobalNodesIndex(mesh_p->Nodes);          */
1602      }          if (fs_code == FINLEY_NODES)
1603      k=globalNodeIndex[id];          {
1604      return static_cast<bool>( (myFirstNode <= k) && (k < myLastNode) );              myFirstNode = Finley_NodeFile_getFirstNode(mesh_p->Nodes);
1605                myLastNode = Finley_NodeFile_getLastNode(mesh_p->Nodes);
1606                globalNodeIndex = Finley_NodeFile_borrowGlobalNodesIndex(mesh_p->Nodes);
1607            }
1608            else
1609            {
1610                throw FinleyAdapterException("Unsupported function space type for ownSample()");
1611            }
1612    
1613            k=globalNodeIndex[id];
1614            return static_cast<bool>( (myFirstNode <= k) && (k < myLastNode) );
1615  #endif  #endif
1616        }
1617      return true;      return true;
1618  }  }
1619    
1620    
   
1621  //  //
1622  // creates a SystemMatrixAdapter stiffness matrix an initializes it with zeros  // creates a SystemMatrixAdapter stiffness matrix an initializes it with zeros
1623  //  //

Legend:
Removed from v.3793  
changed lines
  Added in v.3998

  ViewVC Help
Powered by ViewVC 1.1.26