/[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 2940 by caltinay, Fri Feb 19 00:38:45 2010 UTC revision 3269 by jfenwick, Wed Oct 13 03:21:50 2010 UTC
# Line 18  Line 18 
18  #ifdef USE_NETCDF  #ifdef USE_NETCDF
19  #include <netcdfcpp.h>  #include <netcdfcpp.h>
20  #endif  #endif
21  #ifdef PASO_MPI  #ifdef ESYS_MPI
22  #include <mpi.h>  #include <mpi.h>
23  #include "paso/Paso_MPI.h"  #include "esysUtils/Esys_MPI.h"
24  #endif  #endif
25  extern "C" {  extern "C" {
26  #include "esysUtils/blocktimer.h"  #include "esysUtils/blocktimer.h"
# Line 85  int MeshAdapter::getMPIRank() const Line 85  int MeshAdapter::getMPIRank() const
85  }  }
86  void MeshAdapter::MPIBarrier() const  void MeshAdapter::MPIBarrier() const
87  {  {
88  #ifdef PASO_MPI  #ifdef ESYS_MPI
89     MPI_Barrier(m_finleyMesh.get()->MPIInfo->comm);     MPI_Barrier(m_finleyMesh.get()->MPIInfo->comm);
90  #endif  #endif
91     return;     return;
# Line 96  bool MeshAdapter::onMasterProcessor() co Line 96  bool MeshAdapter::onMasterProcessor() co
96  }  }
97    
98    
99  #ifdef PASO_MPI  #ifdef ESYS_MPI
100    MPI_Comm    MPI_Comm
101  #else  #else
102    unsigned int    unsigned int
103  #endif  #endif
104  MeshAdapter::getMPIComm() const  MeshAdapter::getMPIComm() const
105  {  {
106  #ifdef PASO_MPI  #ifdef ESYS_MPI
107      return m_finleyMesh->MPIInfo->comm;      return m_finleyMesh->MPIInfo->comm;
108  #else  #else
109      return 0;      return 0;
# Line 149  void MeshAdapter::dump(const string& fil Line 149  void MeshAdapter::dump(const string& fil
149     int num_Elements_numNodes        = mesh->Elements->numNodes;     int num_Elements_numNodes        = mesh->Elements->numNodes;
150     int num_FaceElements_numNodes    = mesh->FaceElements->numNodes;     int num_FaceElements_numNodes    = mesh->FaceElements->numNodes;
151     int num_ContactElements_numNodes = mesh->ContactElements->numNodes;     int num_ContactElements_numNodes = mesh->ContactElements->numNodes;
152  #ifdef PASO_MPI  #ifdef ESYS_MPI
153     MPI_Status status;     MPI_Status status;
154  #endif  #endif
155    
156  /* Incoming token indicates it's my turn to write */  /* Incoming token indicates it's my turn to write */
157  #ifdef PASO_MPI  #ifdef ESYS_MPI
158     if (mpi_rank>0) MPI_Recv(&num_Tags, 0, MPI_INT, mpi_rank-1, 81800, mesh->MPIInfo->comm, &status);     if (mpi_rank>0) MPI_Recv(&num_Tags, 0, MPI_INT, mpi_rank-1, 81800, mesh->MPIInfo->comm, &status);
159  #endif  #endif
160    
161     char *newFileName = Paso_MPI_appendRankToFileName(fileName.c_str(),     char *newFileName = Esys_MPI_appendRankToFileName(fileName.c_str(),
162                                                       mpi_size, mpi_rank);                                                       mpi_size, mpi_rank);
163    
164     /* Figure out how much storage is required for tags */     /* Figure out how much storage is required for tags */
# Line 529  void MeshAdapter::dump(const string& fil Line 529  void MeshAdapter::dump(const string& fil
529     }     }
530    
531  /* Send token to next MPI process so he can take his turn */  /* Send token to next MPI process so he can take his turn */
532  #ifdef PASO_MPI  #ifdef ESYS_MPI
533     if (mpi_rank<mpi_size-1) MPI_Send(&num_Tags, 0, MPI_INT, mpi_rank+1, 81800, mesh->MPIInfo->comm);     if (mpi_rank<mpi_size-1) MPI_Send(&num_Tags, 0, MPI_INT, mpi_rank+1, 81800, mesh->MPIInfo->comm);
534  #endif  #endif
535    
# Line 770  pair<int,int> MeshAdapter::getDataShape( Line 770  pair<int,int> MeshAdapter::getDataShape(
770  // adds linear PDE of second order into a given stiffness matrix and right hand side:  // adds linear PDE of second order into a given stiffness matrix and right hand side:
771  //  //
772  void MeshAdapter::addPDEToSystem(  void MeshAdapter::addPDEToSystem(
773                                   SystemMatrixAdapter& mat, escript::Data& rhs,                                   AbstractSystemMatrix& mat, escript::Data& rhs,
774                                   const escript::Data& A, const escript::Data& B, const escript::Data& C,const  escript::Data& D,const  escript::Data& X,const  escript::Data& Y,                                   const escript::Data& A, const escript::Data& B, const escript::Data& C,const  escript::Data& D,const  escript::Data& X,const  escript::Data& Y,
775                                   const escript::Data& d, const escript::Data& y,                                   const escript::Data& d, const escript::Data& y,
776                                   const escript::Data& d_contact,const escript::Data& y_contact) const                                   const escript::Data& d_contact,const escript::Data& y_contact) const
777  {  {
778       SystemMatrixAdapter* smat=dynamic_cast<SystemMatrixAdapter*>(&mat);
779       if (smat==0)
780       {
781        throw FinleyAdapterException("finley only supports its own system matrices.");
782       }
783     escriptDataC _rhs=rhs.getDataC();     escriptDataC _rhs=rhs.getDataC();
784     escriptDataC _A  =A.getDataC();     escriptDataC _A  =A.getDataC();
785     escriptDataC _B=B.getDataC();     escriptDataC _B=B.getDataC();
# Line 789  void MeshAdapter::addPDEToSystem( Line 794  void MeshAdapter::addPDEToSystem(
794    
795     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
796    
797     Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,mat.getPaso_SystemMatrix(), &_rhs, &_A, &_B, &_C, &_D, &_X, &_Y );     Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,smat->getPaso_SystemMatrix(), &_rhs, &_A, &_B, &_C, &_D, &_X, &_Y );
798     checkFinleyError();     checkFinleyError();
799    
800     Finley_Assemble_PDE(mesh->Nodes,mesh->FaceElements, mat.getPaso_SystemMatrix(), &_rhs, 0, 0, 0, &_d, 0, &_y );     Finley_Assemble_PDE(mesh->Nodes,mesh->FaceElements, smat->getPaso_SystemMatrix(), &_rhs, 0, 0, 0, &_d, 0, &_y );
801     checkFinleyError();     checkFinleyError();
802    
803     Finley_Assemble_PDE(mesh->Nodes,mesh->ContactElements, mat.getPaso_SystemMatrix(), &_rhs , 0, 0, 0, &_d_contact, 0, &_y_contact );     Finley_Assemble_PDE(mesh->Nodes,mesh->ContactElements, smat->getPaso_SystemMatrix(), &_rhs , 0, 0, 0, &_d_contact, 0, &_y_contact );
804     checkFinleyError();     checkFinleyError();
805  }  }
806    
# Line 811  void  MeshAdapter::addPDEToLumpedSystem( Line 816  void  MeshAdapter::addPDEToLumpedSystem(
816     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
817    
818     Finley_Assemble_LumpedSystem(mesh->Nodes,mesh->Elements,&_mat, &_D);     Finley_Assemble_LumpedSystem(mesh->Nodes,mesh->Elements,&_mat, &_D);
819       checkFinleyError();
820      
821     Finley_Assemble_LumpedSystem(mesh->Nodes,mesh->FaceElements,&_mat, &_d);     Finley_Assemble_LumpedSystem(mesh->Nodes,mesh->FaceElements,&_mat, &_d);
   
822     checkFinleyError();     checkFinleyError();
823    
824  }  }
825    
826    
# Line 843  void MeshAdapter::addPDEToRHS( escript:: Line 850  void MeshAdapter::addPDEToRHS( escript::
850  // adds PDE of second order into a transport problem  // adds PDE of second order into a transport problem
851  //  //
852  void MeshAdapter::addPDEToTransportProblem(  void MeshAdapter::addPDEToTransportProblem(
853                                             TransportProblemAdapter& tp, escript::Data& source, const escript::Data& M,                                             AbstractTransportProblem& tp, escript::Data& source, const escript::Data& M,
854                                             const escript::Data& A, const escript::Data& B, const escript::Data& C,                                             const escript::Data& A, const escript::Data& B, const escript::Data& C,
855                                             const  escript::Data& D,const  escript::Data& X,const  escript::Data& Y,                                             const  escript::Data& D,const  escript::Data& X,const  escript::Data& Y,
856                                             const escript::Data& d, const escript::Data& y,                                             const escript::Data& d, const escript::Data& y,
857                                             const escript::Data& d_contact,const escript::Data& y_contact) const                                             const escript::Data& d_contact,const escript::Data& y_contact) const
858  {  {
859       TransportProblemAdapter* tpa=dynamic_cast<TransportProblemAdapter*>(&tp);
860       if (tpa==0)
861       {
862        throw FinleyAdapterException("finley only supports its own transport problems.");
863       }
864    
865    
866     DataTypes::ShapeType shape;     DataTypes::ShapeType shape;
867     source.expand();     source.expand();
868     escriptDataC _source=source.getDataC();     escriptDataC _source=source.getDataC();
# Line 865  void MeshAdapter::addPDEToTransportProbl Line 879  void MeshAdapter::addPDEToTransportProbl
879     escriptDataC _y_contact=y_contact.getDataC();     escriptDataC _y_contact=y_contact.getDataC();
880    
881     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
882     Paso_FCTransportProblem* _tp = tp.getPaso_FCTransportProblem();     Paso_TransportProblem* _tp = tpa->getPaso_TransportProblem();
883    
884     Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,_tp->mass_matrix, &_source, 0, 0, 0, &_M, 0, 0 );     Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,_tp->mass_matrix, &_source, 0, 0, 0, &_M, 0, 0 );
885     checkFinleyError();     checkFinleyError();
# Line 1042  void MeshAdapter::interpolateOnDomain(es Line 1056  void MeshAdapter::interpolateOnDomain(es
1056        case(Elements):        case(Elements):
1057        case(ReducedElements):        case(ReducedElements):
1058        if (getMPISize()>1) {        if (getMPISize()>1) {
1059           escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  continuousFunction(*this) );
1060           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1061           Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in2,&_target);           Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in2,&_target);
1062        } else {        } else {
# Line 1052  void MeshAdapter::interpolateOnDomain(es Line 1066  void MeshAdapter::interpolateOnDomain(es
1066        case(FaceElements):        case(FaceElements):
1067        case(ReducedFaceElements):        case(ReducedFaceElements):
1068        if (getMPISize()>1) {        if (getMPISize()>1) {
1069           escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  continuousFunction(*this) );
1070           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1071           Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in2,&_target);           Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in2,&_target);
1072        
# Line 1062  void MeshAdapter::interpolateOnDomain(es Line 1076  void MeshAdapter::interpolateOnDomain(es
1076        break;        break;
1077        case(Points):        case(Points):
1078        if (getMPISize()>1) {        if (getMPISize()>1) {
1079           escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  continuousFunction(*this) );
1080           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1081        } else {        } else {
1082           Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);           Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);
# Line 1073  void MeshAdapter::interpolateOnDomain(es Line 1087  void MeshAdapter::interpolateOnDomain(es
1087        case(ReducedContactElementsZero):        case(ReducedContactElementsZero):
1088        case(ReducedContactElementsOne):        case(ReducedContactElementsOne):
1089        if (getMPISize()>1) {        if (getMPISize()>1) {
1090           escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  continuousFunction(*this) );
1091           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1092           Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in2,&_target);           Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in2,&_target);
1093        } else {        } else {
# Line 1111  void MeshAdapter::interpolateOnDomain(es Line 1125  void MeshAdapter::interpolateOnDomain(es
1125        case(Elements):        case(Elements):
1126        case(ReducedElements):        case(ReducedElements):
1127        if (getMPISize()>1) {        if (getMPISize()>1) {
1128           escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  reducedContinuousFunction(*this) );
1129           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1130           Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in2,&_target);           Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in2,&_target);
1131        } else {        } else {
# Line 1121  void MeshAdapter::interpolateOnDomain(es Line 1135  void MeshAdapter::interpolateOnDomain(es
1135        case(FaceElements):        case(FaceElements):
1136        case(ReducedFaceElements):        case(ReducedFaceElements):
1137        if (getMPISize()>1) {        if (getMPISize()>1) {
1138           escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  reducedContinuousFunction(*this) );
1139           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1140           Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in2,&_target);           Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in2,&_target);
1141        } else {        } else {
# Line 1130  void MeshAdapter::interpolateOnDomain(es Line 1144  void MeshAdapter::interpolateOnDomain(es
1144        break;        break;
1145        case(Points):        case(Points):
1146        if (getMPISize()>1) {        if (getMPISize()>1) {
1147           escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  reducedContinuousFunction(*this) );
1148           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1149           Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in2,&_target);           Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in2,&_target);
1150        } else {        } else {
# Line 1142  void MeshAdapter::interpolateOnDomain(es Line 1156  void MeshAdapter::interpolateOnDomain(es
1156        case(ReducedContactElementsZero):        case(ReducedContactElementsZero):
1157        case(ReducedContactElementsOne):        case(ReducedContactElementsOne):
1158        if (getMPISize()>1) {        if (getMPISize()>1) {
1159           escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  reducedContinuousFunction(*this) );
1160           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1161           Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in2,&_target);           Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in2,&_target);
1162        } else {        } else {
# Line 1179  void MeshAdapter::setToX(escript::Data& Line 1193  void MeshAdapter::setToX(escript::Data&
1193        escriptDataC _arg=arg.getDataC();        escriptDataC _arg=arg.getDataC();
1194        Finley_Assemble_NodeCoordinates(mesh->Nodes,&_arg);        Finley_Assemble_NodeCoordinates(mesh->Nodes,&_arg);
1195     } else {     } else {
1196        escript::Data tmp_data=Vector(0.0,continuousFunction(asAbstractContinuousDomain()),true);        escript::Data tmp_data=Vector(0.0,continuousFunction(*this),true);
1197        escriptDataC _tmp_data=tmp_data.getDataC();        escriptDataC _tmp_data=tmp_data.getDataC();
1198        Finley_Assemble_NodeCoordinates(mesh->Nodes,&_tmp_data);        Finley_Assemble_NodeCoordinates(mesh->Nodes,&_tmp_data);
1199        // this is then interpolated onto arg:        // this is then interpolated onto arg:
# Line 1273  void MeshAdapter::setToIntegrals(vector< Line 1287  void MeshAdapter::setToIntegrals(vector<
1287     escriptDataC _arg=arg.getDataC();     escriptDataC _arg=arg.getDataC();
1288     switch(arg.getFunctionSpace().getTypeCode()) {     switch(arg.getFunctionSpace().getTypeCode()) {
1289     case(Nodes):     case(Nodes):
1290     temp=escript::Data( arg, escript::function(asAbstractContinuousDomain()) );     temp=escript::Data( arg, escript::function(*this) );
1291     _temp=temp.getDataC();     _temp=temp.getDataC();
1292     Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);     Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);
1293     break;     break;
1294     case(ReducedNodes):     case(ReducedNodes):
1295     temp=escript::Data( arg, escript::function(asAbstractContinuousDomain()) );     temp=escript::Data( arg, escript::function(*this) );
1296     _temp=temp.getDataC();     _temp=temp.getDataC();
1297     Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);     Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);
1298     break;     break;
# Line 1310  void MeshAdapter::setToIntegrals(vector< Line 1324  void MeshAdapter::setToIntegrals(vector<
1324     Finley_Assemble_integrate(mesh->Nodes,mesh->ContactElements,&_arg,&integrals[0]);     Finley_Assemble_integrate(mesh->Nodes,mesh->ContactElements,&_arg,&integrals[0]);
1325     break;     break;
1326     case(DegreesOfFreedom):     case(DegreesOfFreedom):
1327     temp=escript::Data( arg, escript::function(asAbstractContinuousDomain()) );     temp=escript::Data( arg, escript::function(*this) );
1328     _temp=temp.getDataC();     _temp=temp.getDataC();
1329     Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);     Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);
1330     break;     break;
1331     case(ReducedDegreesOfFreedom):     case(ReducedDegreesOfFreedom):
1332     temp=escript::Data( arg, escript::function(asAbstractContinuousDomain()) );     temp=escript::Data( arg, escript::function(*this) );
1333     _temp=temp.getDataC();     _temp=temp.getDataC();
1334     Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);     Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);
1335     break;     break;
# Line 1347  void MeshAdapter::setToGradient(escript: Line 1361  void MeshAdapter::setToGradient(escript:
1361     escript::Data temp;     escript::Data temp;
1362     if (getMPISize()>1) {     if (getMPISize()>1) {
1363        if( arg.getFunctionSpace().getTypeCode() == DegreesOfFreedom ) {        if( arg.getFunctionSpace().getTypeCode() == DegreesOfFreedom ) {
1364           temp=escript::Data( arg,  continuousFunction(asAbstractContinuousDomain()) );           temp=escript::Data( arg,  continuousFunction(*this) );
1365           nodeDataC = temp.getDataC();           nodeDataC = temp.getDataC();
1366        } else if( arg.getFunctionSpace().getTypeCode() == ReducedDegreesOfFreedom ) {        } else if( arg.getFunctionSpace().getTypeCode() == ReducedDegreesOfFreedom ) {
1367           temp=escript::Data( arg,  reducedContinuousFunction(asAbstractContinuousDomain()) );           temp=escript::Data( arg,  reducedContinuousFunction(*this) );
1368           nodeDataC = temp.getDataC();           nodeDataC = temp.getDataC();
1369        } else {        } else {
1370           nodeDataC = arg.getDataC();           nodeDataC = arg.getDataC();
# Line 1469  void MeshAdapter::setNewX(const escript: Line 1483  void MeshAdapter::setNewX(const escript:
1483     const MeshAdapter& newDomain=dynamic_cast<const MeshAdapter&>(*(new_x.getFunctionSpace().getDomain()));     const MeshAdapter& newDomain=dynamic_cast<const MeshAdapter&>(*(new_x.getFunctionSpace().getDomain()));
1484     if (newDomain!=*this)     if (newDomain!=*this)
1485        throw FinleyAdapterException("Error - Illegal domain of new point locations");        throw FinleyAdapterException("Error - Illegal domain of new point locations");
1486     if ( new_x.getFunctionSpace() == continuousFunction(asAbstractContinuousDomain()) ) {     if ( new_x.getFunctionSpace() == continuousFunction(*this) ) {
1487         tmp = new_x.getDataC();         tmp = new_x.getDataC();
1488         Finley_Mesh_setCoordinates(mesh,&tmp);         Finley_Mesh_setCoordinates(mesh,&tmp);
1489     } else {     } else {
1490         escript::Data new_x_inter=escript::Data( new_x,  continuousFunction(asAbstractContinuousDomain()) );         escript::Data new_x_inter=escript::Data( new_x,  continuousFunction(*this) );
1491         tmp = new_x_inter.getDataC();         tmp = new_x_inter.getDataC();
1492         Finley_Mesh_setCoordinates(mesh,&tmp);         Finley_Mesh_setCoordinates(mesh,&tmp);
1493     }     }
# Line 1557  void MeshAdapter::saveVTK(const string& Line 1571  void MeshAdapter::saveVTK(const string&
1571    
1572  bool MeshAdapter::ownSample(int fs_code, index_t id) const  bool MeshAdapter::ownSample(int fs_code, index_t id) const
1573  {  {
1574  #ifdef PASO_MPI  #ifdef ESYS_MPI
1575      index_t myFirstNode=0, myLastNode=0, k=0;      index_t myFirstNode=0, myLastNode=0, k=0;
1576      index_t* globalNodeIndex=0;      index_t* globalNodeIndex=0;
1577      Finley_Mesh* mesh_p=m_finleyMesh.get();      Finley_Mesh* mesh_p=m_finleyMesh.get();
# Line 1584  bool MeshAdapter::ownSample(int fs_code, Line 1598  bool MeshAdapter::ownSample(int fs_code,
1598  //  //
1599  // creates a SystemMatrixAdapter stiffness matrix an initializes it with zeros  // creates a SystemMatrixAdapter stiffness matrix an initializes it with zeros
1600  //  //
1601  SystemMatrixAdapter MeshAdapter::newSystemMatrix(  ASM_ptr MeshAdapter::newSystemMatrix(
1602                                                   const int row_blocksize,                                                   const int row_blocksize,
1603                                                   const escript::FunctionSpace& row_functionspace,                                                   const escript::FunctionSpace& row_functionspace,
1604                                                   const int column_blocksize,                                                   const int column_blocksize,
# Line 1631  SystemMatrixAdapter MeshAdapter::newSyst Line 1645  SystemMatrixAdapter MeshAdapter::newSyst
1645     }     }
1646     checkPasoError();     checkPasoError();
1647     Paso_SystemMatrixPattern_free(fsystemMatrixPattern);     Paso_SystemMatrixPattern_free(fsystemMatrixPattern);
1648     return SystemMatrixAdapter(fsystemMatrix,row_blocksize,row_functionspace,column_blocksize,column_functionspace);     SystemMatrixAdapter* sma=new SystemMatrixAdapter(fsystemMatrix, row_blocksize, row_functionspace, column_blocksize, column_functionspace);
1649       return ASM_ptr(sma);
1650    //   return SystemMatrixAdapter(fsystemMatrix,row_blocksize,row_functionspace,column_blocksize,column_functionspace);
1651  }  }
1652    
1653  //  //
1654  // creates a TransportProblemAdapter  // creates a TransportProblemAdapter
1655  //  //
1656  TransportProblemAdapter MeshAdapter::newTransportProblem(  ATP_ptr MeshAdapter::newTransportProblem(
1657                                                           const double theta,                                                           const bool useBackwardEuler,
1658                                                           const int blocksize,                                                           const int blocksize,
1659                                                           const escript::FunctionSpace& functionspace,                                                           const escript::FunctionSpace& functionspace,
1660                                                           const int type) const                                                           const int type) const
# Line 1660  TransportProblemAdapter MeshAdapter::new Line 1676  TransportProblemAdapter MeshAdapter::new
1676    
1677     Paso_SystemMatrixPattern* fsystemMatrixPattern=Finley_getPattern(getFinley_Mesh(),reduceOrder,reduceOrder);     Paso_SystemMatrixPattern* fsystemMatrixPattern=Finley_getPattern(getFinley_Mesh(),reduceOrder,reduceOrder);
1678     checkFinleyError();     checkFinleyError();
1679     Paso_FCTransportProblem* transportProblem;     Paso_TransportProblem* transportProblem;
1680     transportProblem=Paso_FCTransportProblem_alloc(theta,fsystemMatrixPattern,blocksize);     transportProblem=Paso_TransportProblem_alloc(useBackwardEuler,fsystemMatrixPattern,blocksize);
1681     checkPasoError();     checkPasoError();
1682     Paso_SystemMatrixPattern_free(fsystemMatrixPattern);     Paso_SystemMatrixPattern_free(fsystemMatrixPattern);
1683     return TransportProblemAdapter(transportProblem,theta,blocksize,functionspace);     TransportProblemAdapter* tpa=new TransportProblemAdapter(transportProblem,useBackwardEuler,blocksize,functionspace);
1684       return ATP_ptr(tpa);
1685    //   return TransportProblemAdapter(transportProblem,useBackwardEuler,blocksize,functionspace);
1686  }  }
1687    
1688  //  //
# Line 2030  int MeshAdapter::getSystemMatrixTypeId(c Line 2048  int MeshAdapter::getSystemMatrixTypeId(c
2048  int MeshAdapter::getTransportTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const  int MeshAdapter::getTransportTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const
2049  {  {
2050     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
2051     int out=Paso_FCTransportProblem_getTypeId(SystemMatrixAdapter::mapOptionToPaso(solver),SystemMatrixAdapter::mapOptionToPaso(preconditioner), SystemMatrixAdapter::mapOptionToPaso(package),symmetry?1:0, mesh->MPIInfo);     int out=Paso_TransportProblem_getTypeId(SystemMatrixAdapter::mapOptionToPaso(solver),SystemMatrixAdapter::mapOptionToPaso(preconditioner), SystemMatrixAdapter::mapOptionToPaso(package),symmetry?1:0, mesh->MPIInfo);
2052     checkPasoError();     checkPasoError();
2053     return out;     return out;
2054  }  }
2055    
2056  escript::Data MeshAdapter::getX() const  escript::Data MeshAdapter::getX() const
2057  {  {
2058     return continuousFunction(asAbstractContinuousDomain()).getX();     return continuousFunction(*this).getX();
2059  }  }
2060    
2061  escript::Data MeshAdapter::getNormal() const  escript::Data MeshAdapter::getNormal() const
2062  {  {
2063     return functionOnBoundary(asAbstractContinuousDomain()).getNormal();     return functionOnBoundary(*this).getNormal();
2064  }  }
2065    
2066  escript::Data MeshAdapter::getSize() const  escript::Data MeshAdapter::getSize() const
2067  {  {
2068     return escript::function(asAbstractContinuousDomain()).getSize();     return escript::function(*this).getSize();
2069  }  }
2070    
2071  const int* MeshAdapter::borrowSampleReferenceIDs(int functionSpaceType) const  const int* MeshAdapter::borrowSampleReferenceIDs(int functionSpaceType) const
# Line 2395  int MeshAdapter::getApproximationOrder(c Line 2413  int MeshAdapter::getApproximationOrder(c
2413    return order;    return order;
2414  }  }
2415    
2416  ReferenceElementSetWrapper::ReferenceElementSetWrapper(ElementTypeId id, index_t order, index_t reducedOrder)  bool MeshAdapter::supportsContactElements() const
2417    {
2418      return true;
2419    }
2420    
2421    ReferenceElementSetWrapper::ReferenceElementSetWrapper(Finley_ElementTypeId id, index_t order, index_t reducedOrder)
2422  {  {
2423    m_refSet = Finley_ReferenceElementSet_alloc(id, order, reducedOrder);    m_refSet = Finley_ReferenceElementSet_alloc(id, order, reducedOrder);
2424  }  }

Legend:
Removed from v.2940  
changed lines
  Added in v.3269

  ViewVC Help
Powered by ViewVC 1.1.26