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

Diff of /branches/domexper/dudley/src/CPPAdapter/MeshAdapter.cpp

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

revision 3082 by jfenwick, Tue Aug 3 06:04:05 2010 UTC revision 3086 by jfenwick, Thu Aug 5 05:07:58 2010 UTC
# Line 34  namespace dudley { Line 34  namespace dudley {
34  //  //
35  // define the static constants  // define the static constants
36  MeshAdapter::FunctionSpaceNamesMapType MeshAdapter::m_functionSpaceTypeNames;  MeshAdapter::FunctionSpaceNamesMapType MeshAdapter::m_functionSpaceTypeNames;
37  const int MeshAdapter::DegreesOfFreedom=FINLEY_DEGREES_OF_FREEDOM;  const int MeshAdapter::DegreesOfFreedom=DUDLEY_DEGREES_OF_FREEDOM;
38  const int MeshAdapter::ReducedDegreesOfFreedom=FINLEY_REDUCED_DEGREES_OF_FREEDOM;  const int MeshAdapter::ReducedDegreesOfFreedom=DUDLEY_REDUCED_DEGREES_OF_FREEDOM;
39  const int MeshAdapter::Nodes=FINLEY_NODES;  const int MeshAdapter::Nodes=DUDLEY_NODES;
40  const int MeshAdapter::ReducedNodes=FINLEY_REDUCED_NODES;  const int MeshAdapter::ReducedNodes=DUDLEY_REDUCED_NODES;
41  const int MeshAdapter::Elements=FINLEY_ELEMENTS;  const int MeshAdapter::Elements=DUDLEY_ELEMENTS;
42  const int MeshAdapter::ReducedElements=FINLEY_REDUCED_ELEMENTS;  const int MeshAdapter::ReducedElements=DUDLEY_REDUCED_ELEMENTS;
43  const int MeshAdapter::FaceElements=FINLEY_FACE_ELEMENTS;  const int MeshAdapter::FaceElements=DUDLEY_FACE_ELEMENTS;
44  const int MeshAdapter::ReducedFaceElements=FINLEY_REDUCED_FACE_ELEMENTS;  const int MeshAdapter::ReducedFaceElements=DUDLEY_REDUCED_FACE_ELEMENTS;
45  const int MeshAdapter::Points=FINLEY_POINTS;  const int MeshAdapter::Points=DUDLEY_POINTS;
46  const int MeshAdapter::ContactElementsZero=FINLEY_CONTACT_ELEMENTS_1;  const int MeshAdapter::ContactElementsZero=DUDLEY_CONTACT_ELEMENTS_1;
47  const int MeshAdapter::ReducedContactElementsZero=FINLEY_REDUCED_CONTACT_ELEMENTS_1;  const int MeshAdapter::ReducedContactElementsZero=DUDLEY_REDUCED_CONTACT_ELEMENTS_1;
48  const int MeshAdapter::ContactElementsOne=FINLEY_CONTACT_ELEMENTS_2;  const int MeshAdapter::ContactElementsOne=DUDLEY_CONTACT_ELEMENTS_2;
49  const int MeshAdapter::ReducedContactElementsOne=FINLEY_REDUCED_CONTACT_ELEMENTS_2;  const int MeshAdapter::ReducedContactElementsOne=DUDLEY_REDUCED_CONTACT_ELEMENTS_2;
50    
51  MeshAdapter::MeshAdapter(Finley_Mesh* finleyMesh)  MeshAdapter::MeshAdapter(Dudley_Mesh* dudleyMesh)
52  {  {
53     setFunctionSpaceTypeNames();     setFunctionSpaceTypeNames();
54     //     //
55     // need to use a null_deleter as Finley_Mesh_free deletes the pointer     // need to use a null_deleter as Dudley_Mesh_free deletes the pointer
56     // for us.     // for us.
57     m_finleyMesh.reset(finleyMesh,null_deleter());     m_dudleyMesh.reset(dudleyMesh,null_deleter());
58  }  }
59    
60  //  //
61  // The copy constructor should just increment the use count  // The copy constructor should just increment the use count
62  MeshAdapter::MeshAdapter(const MeshAdapter& in):  MeshAdapter::MeshAdapter(const MeshAdapter& in):
63  m_finleyMesh(in.m_finleyMesh)  m_dudleyMesh(in.m_dudleyMesh)
64  {  {
65     setFunctionSpaceTypeNames();     setFunctionSpaceTypeNames();
66  }  }
# Line 70  MeshAdapter::~MeshAdapter() Line 70  MeshAdapter::~MeshAdapter()
70     //     //
71     // I hope the case for the pointer being zero has been taken care of.     // I hope the case for the pointer being zero has been taken care of.
72     //  cout << "In MeshAdapter destructor." << endl;     //  cout << "In MeshAdapter destructor." << endl;
73     if (m_finleyMesh.unique()) {     if (m_dudleyMesh.unique()) {
74        Finley_Mesh_free(m_finleyMesh.get());        Dudley_Mesh_free(m_dudleyMesh.get());
75     }     }
76  }  }
77    
78  int MeshAdapter::getMPISize() const  int MeshAdapter::getMPISize() const
79  {  {
80     return m_finleyMesh.get()->MPIInfo->size;     return m_dudleyMesh.get()->MPIInfo->size;
81  }  }
82  int MeshAdapter::getMPIRank() const  int MeshAdapter::getMPIRank() const
83  {  {
84     return m_finleyMesh.get()->MPIInfo->rank;     return m_dudleyMesh.get()->MPIInfo->rank;
85  }  }
86  void MeshAdapter::MPIBarrier() const  void MeshAdapter::MPIBarrier() const
87  {  {
88  #ifdef PASO_MPI  #ifdef PASO_MPI
89     MPI_Barrier(m_finleyMesh.get()->MPIInfo->comm);     MPI_Barrier(m_dudleyMesh.get()->MPIInfo->comm);
90  #endif  #endif
91     return;     return;
92  }  }
93  bool MeshAdapter::onMasterProcessor() const  bool MeshAdapter::onMasterProcessor() const
94  {  {
95     return m_finleyMesh.get()->MPIInfo->rank == 0;     return m_dudleyMesh.get()->MPIInfo->rank == 0;
96  }  }
97    
98    
# Line 104  bool MeshAdapter::onMasterProcessor() co Line 104  bool MeshAdapter::onMasterProcessor() co
104  MeshAdapter::getMPIComm() const  MeshAdapter::getMPIComm() const
105  {  {
106  #ifdef PASO_MPI  #ifdef PASO_MPI
107      return m_finleyMesh->MPIInfo->comm;      return m_dudleyMesh->MPIInfo->comm;
108  #else  #else
109      return 0;      return 0;
110  #endif  #endif
111  }  }
112    
113    
114  Finley_Mesh* MeshAdapter::getFinley_Mesh() const {  Dudley_Mesh* MeshAdapter::getDudley_Mesh() const {
115     return m_finleyMesh.get();     return m_dudleyMesh.get();
116  }  }
117    
118  void MeshAdapter::write(const string& fileName) const  void MeshAdapter::write(const string& fileName) const
119  {  {
120     char *fName = (fileName.size()+1>0) ? TMPMEMALLOC(fileName.size()+1,char) : (char*)NULL;     char *fName = (fileName.size()+1>0) ? TMPMEMALLOC(fileName.size()+1,char) : (char*)NULL;
121     strcpy(fName,fileName.c_str());     strcpy(fName,fileName.c_str());
122     Finley_Mesh_write(m_finleyMesh.get(),fName);     Dudley_Mesh_write(m_dudleyMesh.get(),fName);
123     checkFinleyError();     checkDudleyError();
124     TMPMEMFREE(fName);     TMPMEMFREE(fName);
125  }  }
126    
127  void MeshAdapter::Print_Mesh_Info(const bool full) const  void MeshAdapter::Print_Mesh_Info(const bool full) const
128  {  {
129     Finley_PrintMesh_Info(m_finleyMesh.get(), full);     Dudley_PrintMesh_Info(m_dudleyMesh.get(), full);
130  }  }
131    
132  void MeshAdapter::dump(const string& fileName) const  void MeshAdapter::dump(const string& fileName) const
# Line 135  void MeshAdapter::dump(const string& fil Line 135  void MeshAdapter::dump(const string& fil
135     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};
136     NcVar *ids;     NcVar *ids;
137     int *int_ptr;     int *int_ptr;
138     Finley_Mesh *mesh = m_finleyMesh.get();     Dudley_Mesh *mesh = m_dudleyMesh.get();
139     Finley_TagMap* tag_map;     Dudley_TagMap* tag_map;
140     int num_Tags = 0;     int num_Tags = 0;
141     int mpi_size             = mesh->MPIInfo->size;     int mpi_size             = mesh->MPIInfo->size;
142     int mpi_rank             = mesh->MPIInfo->rank;     int mpi_rank             = mesh->MPIInfo->rank;
# Line 536  void MeshAdapter::dump(const string& fil Line 536  void MeshAdapter::dump(const string& fil
536     // NetCDF file is closed by destructor of NcFile object     // NetCDF file is closed by destructor of NcFile object
537    
538  #else  #else
539     Finley_setError(IO_ERROR, "MeshAdapter::dump: not configured with NetCDF. Please contact your installation manager.");     Dudley_setError(IO_ERROR, "MeshAdapter::dump: not configured with NetCDF. Please contact your installation manager.");
540  #endif  /* USE_NETCDF */  #endif  /* USE_NETCDF */
541     checkFinleyError();     checkDudleyError();
542  }  }
543    
544  string MeshAdapter::getDescription() const  string MeshAdapter::getDescription() const
545  {  {
546     return "FinleyMesh";     return "DudleyMesh";
547  }  }
548    
549  string MeshAdapter::functionSpaceTypeAsString(int functionSpaceType) const  string MeshAdapter::functionSpaceTypeAsString(int functionSpaceType) const
# Line 567  bool MeshAdapter::isValidFunctionSpaceTy Line 567  bool MeshAdapter::isValidFunctionSpaceTy
567  void MeshAdapter::setFunctionSpaceTypeNames()  void MeshAdapter::setFunctionSpaceTypeNames()
568  {  {
569     m_functionSpaceTypeNames.insert     m_functionSpaceTypeNames.insert
570     (FunctionSpaceNamesMapType::value_type(DegreesOfFreedom,"Finley_DegreesOfFreedom"));     (FunctionSpaceNamesMapType::value_type(DegreesOfFreedom,"Dudley_DegreesOfFreedom"));
571     m_functionSpaceTypeNames.insert     m_functionSpaceTypeNames.insert
572     (FunctionSpaceNamesMapType::value_type(ReducedDegreesOfFreedom,"Finley_ReducedDegreesOfFreedom"));     (FunctionSpaceNamesMapType::value_type(ReducedDegreesOfFreedom,"Dudley_ReducedDegreesOfFreedom"));
573     m_functionSpaceTypeNames.insert     m_functionSpaceTypeNames.insert
574     (FunctionSpaceNamesMapType::value_type(Nodes,"Finley_Nodes"));     (FunctionSpaceNamesMapType::value_type(Nodes,"Dudley_Nodes"));
575     m_functionSpaceTypeNames.insert     m_functionSpaceTypeNames.insert
576     (FunctionSpaceNamesMapType::value_type(ReducedNodes,"Finley_Reduced_Nodes"));     (FunctionSpaceNamesMapType::value_type(ReducedNodes,"Dudley_Reduced_Nodes"));
577     m_functionSpaceTypeNames.insert     m_functionSpaceTypeNames.insert
578     (FunctionSpaceNamesMapType::value_type(Elements,"Finley_Elements"));     (FunctionSpaceNamesMapType::value_type(Elements,"Dudley_Elements"));
579     m_functionSpaceTypeNames.insert     m_functionSpaceTypeNames.insert
580     (FunctionSpaceNamesMapType::value_type(ReducedElements,"Finley_Reduced_Elements"));     (FunctionSpaceNamesMapType::value_type(ReducedElements,"Dudley_Reduced_Elements"));
581     m_functionSpaceTypeNames.insert     m_functionSpaceTypeNames.insert
582     (FunctionSpaceNamesMapType::value_type(FaceElements,"Finley_Face_Elements"));     (FunctionSpaceNamesMapType::value_type(FaceElements,"Dudley_Face_Elements"));
583     m_functionSpaceTypeNames.insert     m_functionSpaceTypeNames.insert
584     (FunctionSpaceNamesMapType::value_type(ReducedFaceElements,"Finley_Reduced_Face_Elements"));     (FunctionSpaceNamesMapType::value_type(ReducedFaceElements,"Dudley_Reduced_Face_Elements"));
585     m_functionSpaceTypeNames.insert     m_functionSpaceTypeNames.insert
586     (FunctionSpaceNamesMapType::value_type(Points,"Finley_Points"));     (FunctionSpaceNamesMapType::value_type(Points,"Dudley_Points"));
587     m_functionSpaceTypeNames.insert     m_functionSpaceTypeNames.insert
588     (FunctionSpaceNamesMapType::value_type(ContactElementsZero,"Finley_Contact_Elements_0"));     (FunctionSpaceNamesMapType::value_type(ContactElementsZero,"Dudley_Contact_Elements_0"));
589     m_functionSpaceTypeNames.insert     m_functionSpaceTypeNames.insert
590     (FunctionSpaceNamesMapType::value_type(ReducedContactElementsZero,"Finley_Reduced_Contact_Elements_0"));     (FunctionSpaceNamesMapType::value_type(ReducedContactElementsZero,"Dudley_Reduced_Contact_Elements_0"));
591     m_functionSpaceTypeNames.insert     m_functionSpaceTypeNames.insert
592     (FunctionSpaceNamesMapType::value_type(ContactElementsOne,"Finley_Contact_Elements_1"));     (FunctionSpaceNamesMapType::value_type(ContactElementsOne,"Dudley_Contact_Elements_1"));
593     m_functionSpaceTypeNames.insert     m_functionSpaceTypeNames.insert
594     (FunctionSpaceNamesMapType::value_type(ReducedContactElementsOne,"Finley_Reduced_Contact_Elements_1"));     (FunctionSpaceNamesMapType::value_type(ReducedContactElementsOne,"Dudley_Reduced_Contact_Elements_1"));
595  }  }
596    
597  int MeshAdapter::getContinuousFunctionCode() const  int MeshAdapter::getContinuousFunctionCode() const
# Line 659  int MeshAdapter::getDiracDeltaFunctionCo Line 659  int MeshAdapter::getDiracDeltaFunctionCo
659  //  //
660  int MeshAdapter::getDim() const  int MeshAdapter::getDim() const
661  {  {
662     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
663     int numDim=Finley_Mesh_getDim(mesh);     int numDim=Dudley_Mesh_getDim(mesh);
664     checkFinleyError();     checkDudleyError();
665     return numDim;     return numDim;
666  }  }
667    
# Line 670  int MeshAdapter::getDim() const Line 670  int MeshAdapter::getDim() const
670  //  //
671  int MeshAdapter::getNumDataPointsGlobal() const  int MeshAdapter::getNumDataPointsGlobal() const
672  {  {
673     return Finley_NodeFile_getGlobalNumNodes(m_finleyMesh.get()->Nodes);     return Dudley_NodeFile_getGlobalNumNodes(m_dudleyMesh.get()->Nodes);
674  }  }
675    
676  //  //
# Line 681  pair<int,int> MeshAdapter::getDataShape( Line 681  pair<int,int> MeshAdapter::getDataShape(
681  {  {
682     int numDataPointsPerSample=0;     int numDataPointsPerSample=0;
683     int numSamples=0;     int numSamples=0;
684     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
685     switch (functionSpaceCode) {     switch (functionSpaceCode) {
686     case(Nodes):     case(Nodes):
687     numDataPointsPerSample=1;     numDataPointsPerSample=1;
688     numSamples=Finley_NodeFile_getNumNodes(mesh->Nodes);     numSamples=Dudley_NodeFile_getNumNodes(mesh->Nodes);
689     break;     break;
690     case(ReducedNodes):     case(ReducedNodes):
691     numDataPointsPerSample=1;     numDataPointsPerSample=1;
692     numSamples=Finley_NodeFile_getNumReducedNodes(mesh->Nodes);     numSamples=Dudley_NodeFile_getNumReducedNodes(mesh->Nodes);
693     break;     break;
694     case(Elements):     case(Elements):
695     if (mesh->Elements!=NULL) {     if (mesh->Elements!=NULL) {
# Line 748  pair<int,int> MeshAdapter::getDataShape( Line 748  pair<int,int> MeshAdapter::getDataShape(
748     case(DegreesOfFreedom):     case(DegreesOfFreedom):
749     if (mesh->Nodes!=NULL) {     if (mesh->Nodes!=NULL) {
750        numDataPointsPerSample=1;        numDataPointsPerSample=1;
751        numSamples=Finley_NodeFile_getNumDegreesOfFreedom(mesh->Nodes);        numSamples=Dudley_NodeFile_getNumDegreesOfFreedom(mesh->Nodes);
752     }     }
753     break;     break;
754     case(ReducedDegreesOfFreedom):     case(ReducedDegreesOfFreedom):
755     if (mesh->Nodes!=NULL) {     if (mesh->Nodes!=NULL) {
756        numDataPointsPerSample=1;        numDataPointsPerSample=1;
757        numSamples=Finley_NodeFile_getNumReducedDegreesOfFreedom(mesh->Nodes);        numSamples=Dudley_NodeFile_getNumReducedDegreesOfFreedom(mesh->Nodes);
758     }     }
759     break;     break;
760     default:     default:
761        stringstream temp;        stringstream temp;
762        temp << "Error - Invalid function space type: " << functionSpaceCode << " for domain: " << getDescription();        temp << "Error - Invalid function space type: " << functionSpaceCode << " for domain: " << getDescription();
763        throw FinleyAdapterException(temp.str());        throw DudleyAdapterException(temp.str());
764        break;        break;
765     }     }
766     return pair<int,int>(numDataPointsPerSample,numSamples);     return pair<int,int>(numDataPointsPerSample,numSamples);
# Line 787  void MeshAdapter::addPDEToSystem( Line 787  void MeshAdapter::addPDEToSystem(
787     escriptDataC _d_contact=d_contact.getDataC();     escriptDataC _d_contact=d_contact.getDataC();
788     escriptDataC _y_contact=y_contact.getDataC();     escriptDataC _y_contact=y_contact.getDataC();
789    
790     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
791    
792     Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,mat.getPaso_SystemMatrix(), &_rhs, &_A, &_B, &_C, &_D, &_X, &_Y );     Dudley_Assemble_PDE(mesh->Nodes,mesh->Elements,mat.getPaso_SystemMatrix(), &_rhs, &_A, &_B, &_C, &_D, &_X, &_Y );
793     checkFinleyError();     checkDudleyError();
794    
795     Finley_Assemble_PDE(mesh->Nodes,mesh->FaceElements, mat.getPaso_SystemMatrix(), &_rhs, 0, 0, 0, &_d, 0, &_y );     Dudley_Assemble_PDE(mesh->Nodes,mesh->FaceElements, mat.getPaso_SystemMatrix(), &_rhs, 0, 0, 0, &_d, 0, &_y );
796     checkFinleyError();     checkDudleyError();
797    
798     Finley_Assemble_PDE(mesh->Nodes,mesh->ContactElements, mat.getPaso_SystemMatrix(), &_rhs , 0, 0, 0, &_d_contact, 0, &_y_contact );     Dudley_Assemble_PDE(mesh->Nodes,mesh->ContactElements, mat.getPaso_SystemMatrix(), &_rhs , 0, 0, 0, &_d_contact, 0, &_y_contact );
799     checkFinleyError();     checkDudleyError();
800  }  }
801    
802  void  MeshAdapter::addPDEToLumpedSystem(  void  MeshAdapter::addPDEToLumpedSystem(
# Line 808  void  MeshAdapter::addPDEToLumpedSystem( Line 808  void  MeshAdapter::addPDEToLumpedSystem(
808     escriptDataC _D=D.getDataC();     escriptDataC _D=D.getDataC();
809     escriptDataC _d=d.getDataC();     escriptDataC _d=d.getDataC();
810    
811     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
812    
813     Finley_Assemble_LumpedSystem(mesh->Nodes,mesh->Elements,&_mat, &_D);     Dudley_Assemble_LumpedSystem(mesh->Nodes,mesh->Elements,&_mat, &_D);
814     checkFinleyError();     checkDudleyError();
815        
816     Finley_Assemble_LumpedSystem(mesh->Nodes,mesh->FaceElements,&_mat, &_d);     Dudley_Assemble_LumpedSystem(mesh->Nodes,mesh->FaceElements,&_mat, &_d);
817     checkFinleyError();     checkDudleyError();
818    
819  }  }
820    
# Line 824  void  MeshAdapter::addPDEToLumpedSystem( Line 824  void  MeshAdapter::addPDEToLumpedSystem(
824  //  //
825  void MeshAdapter::addPDEToRHS( escript::Data& rhs, const  escript::Data& X,const  escript::Data& Y, const escript::Data& y, const escript::Data& y_contact) const  void MeshAdapter::addPDEToRHS( escript::Data& rhs, const  escript::Data& X,const  escript::Data& Y, const escript::Data& y, const escript::Data& y_contact) const
826  {  {
827     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
828    
829     escriptDataC _rhs=rhs.getDataC();     escriptDataC _rhs=rhs.getDataC();
830     escriptDataC _X=X.getDataC();     escriptDataC _X=X.getDataC();
# Line 832  void MeshAdapter::addPDEToRHS( escript:: Line 832  void MeshAdapter::addPDEToRHS( escript::
832     escriptDataC _y=y.getDataC();     escriptDataC _y=y.getDataC();
833     escriptDataC _y_contact=y_contact.getDataC();     escriptDataC _y_contact=y_contact.getDataC();
834    
835     Finley_Assemble_PDE(mesh->Nodes,mesh->Elements, 0, &_rhs, 0, 0, 0, 0, &_X, &_Y );     Dudley_Assemble_PDE(mesh->Nodes,mesh->Elements, 0, &_rhs, 0, 0, 0, 0, &_X, &_Y );
836     checkFinleyError();     checkDudleyError();
837    
838     Finley_Assemble_PDE(mesh->Nodes,mesh->FaceElements, 0, &_rhs, 0, 0, 0, 0, 0, &_y );     Dudley_Assemble_PDE(mesh->Nodes,mesh->FaceElements, 0, &_rhs, 0, 0, 0, 0, 0, &_y );
839     checkFinleyError();     checkDudleyError();
840    
841     Finley_Assemble_PDE(mesh->Nodes,mesh->ContactElements, 0, &_rhs , 0, 0, 0, 0, 0, &_y_contact );     Dudley_Assemble_PDE(mesh->Nodes,mesh->ContactElements, 0, &_rhs , 0, 0, 0, 0, 0, &_y_contact );
842     checkFinleyError();     checkDudleyError();
843  }  }
844  //  //
845  // adds PDE of second order into a transport problem  // adds PDE of second order into a transport problem
# Line 866  void MeshAdapter::addPDEToTransportProbl Line 866  void MeshAdapter::addPDEToTransportProbl
866     escriptDataC _d_contact=d_contact.getDataC();     escriptDataC _d_contact=d_contact.getDataC();
867     escriptDataC _y_contact=y_contact.getDataC();     escriptDataC _y_contact=y_contact.getDataC();
868    
869     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
870     Paso_TransportProblem* _tp = tp.getPaso_TransportProblem();     Paso_TransportProblem* _tp = tp.getPaso_TransportProblem();
871    
872     Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,_tp->mass_matrix, &_source, 0, 0, 0, &_M, 0, 0 );     Dudley_Assemble_PDE(mesh->Nodes,mesh->Elements,_tp->mass_matrix, &_source, 0, 0, 0, &_M, 0, 0 );
873     checkFinleyError();     checkDudleyError();
874    
875     Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,_tp->transport_matrix, &_source, &_A, &_B, &_C, &_D, &_X, &_Y );     Dudley_Assemble_PDE(mesh->Nodes,mesh->Elements,_tp->transport_matrix, &_source, &_A, &_B, &_C, &_D, &_X, &_Y );
876     checkFinleyError();     checkDudleyError();
877    
878     Finley_Assemble_PDE(mesh->Nodes,mesh->FaceElements, _tp->transport_matrix, &_source, 0, 0, 0, &_d, 0, &_y );     Dudley_Assemble_PDE(mesh->Nodes,mesh->FaceElements, _tp->transport_matrix, &_source, 0, 0, 0, &_d, 0, &_y );
879     checkFinleyError();     checkDudleyError();
880    
881     Finley_Assemble_PDE(mesh->Nodes,mesh->ContactElements, _tp->transport_matrix, &_source , 0, 0, 0, &_d_contact, 0, &_y_contact );     Dudley_Assemble_PDE(mesh->Nodes,mesh->ContactElements, _tp->transport_matrix, &_source , 0, 0, 0, &_d_contact, 0, &_y_contact );
882     checkFinleyError();     checkDudleyError();
883  }  }
884    
885  //  //
# Line 890  void MeshAdapter::interpolateOnDomain(es Line 890  void MeshAdapter::interpolateOnDomain(es
890     const MeshAdapter& inDomain=dynamic_cast<const MeshAdapter&>(*(in.getFunctionSpace().getDomain()));     const MeshAdapter& inDomain=dynamic_cast<const MeshAdapter&>(*(in.getFunctionSpace().getDomain()));
891     const MeshAdapter& targetDomain=dynamic_cast<const MeshAdapter&>(*(target.getFunctionSpace().getDomain()));     const MeshAdapter& targetDomain=dynamic_cast<const MeshAdapter&>(*(target.getFunctionSpace().getDomain()));
892     if (inDomain!=*this)       if (inDomain!=*this)  
893        throw FinleyAdapterException("Error - Illegal domain of interpolant.");        throw DudleyAdapterException("Error - Illegal domain of interpolant.");
894     if (targetDomain!=*this)     if (targetDomain!=*this)
895        throw FinleyAdapterException("Error - Illegal domain of interpolation target.");        throw DudleyAdapterException("Error - Illegal domain of interpolation target.");
896    
897     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
898     escriptDataC _target=target.getDataC();     escriptDataC _target=target.getDataC();
899     escriptDataC _in=in.getDataC();     escriptDataC _in=in.getDataC();
900     switch(in.getFunctionSpace().getTypeCode()) {     switch(in.getFunctionSpace().getTypeCode()) {
# Line 904  void MeshAdapter::interpolateOnDomain(es Line 904  void MeshAdapter::interpolateOnDomain(es
904        case(ReducedNodes):        case(ReducedNodes):
905        case(DegreesOfFreedom):        case(DegreesOfFreedom):
906        case(ReducedDegreesOfFreedom):        case(ReducedDegreesOfFreedom):
907        Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);        Dudley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);
908        break;        break;
909        case(Elements):        case(Elements):
910        case(ReducedElements):        case(ReducedElements):
911        Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);        Dudley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);
912        break;        break;
913        case(FaceElements):        case(FaceElements):
914        case(ReducedFaceElements):        case(ReducedFaceElements):
915        Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);        Dudley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);
916        break;        break;
917        case(Points):        case(Points):
918        Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);        Dudley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);
919        break;        break;
920        case(ContactElementsZero):        case(ContactElementsZero):
921        case(ReducedContactElementsZero):        case(ReducedContactElementsZero):
922        Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);        Dudley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);
923        break;        break;
924        case(ContactElementsOne):        case(ContactElementsOne):
925        case(ReducedContactElementsOne):        case(ReducedContactElementsOne):
926        Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);        Dudley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);
927        break;        break;
928        default:        default:
929           stringstream temp;           stringstream temp;
930           temp << "Error - Interpolation on Domain: Finley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();           temp << "Error - Interpolation on Domain: Dudley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();
931           throw FinleyAdapterException(temp.str());           throw DudleyAdapterException(temp.str());
932           break;           break;
933        }        }
934        break;        break;
# Line 938  void MeshAdapter::interpolateOnDomain(es Line 938  void MeshAdapter::interpolateOnDomain(es
938        case(ReducedNodes):        case(ReducedNodes):
939        case(DegreesOfFreedom):        case(DegreesOfFreedom):
940        case(ReducedDegreesOfFreedom):        case(ReducedDegreesOfFreedom):
941        Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);        Dudley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);
942        break;        break;
943        case(Elements):        case(Elements):
944        case(ReducedElements):        case(ReducedElements):
945        Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);        Dudley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);
946        break;        break;
947        case(FaceElements):        case(FaceElements):
948        case(ReducedFaceElements):        case(ReducedFaceElements):
949        Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);        Dudley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);
950        break;        break;
951        case(Points):        case(Points):
952        Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);        Dudley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);
953        break;        break;
954        case(ContactElementsZero):        case(ContactElementsZero):
955        case(ReducedContactElementsZero):        case(ReducedContactElementsZero):
956        Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);        Dudley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);
957        break;        break;
958        case(ContactElementsOne):        case(ContactElementsOne):
959        case(ReducedContactElementsOne):        case(ReducedContactElementsOne):
960        Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);        Dudley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);
961        break;        break;
962        default:        default:
963           stringstream temp;           stringstream temp;
964           temp << "Error - Interpolation on Domain: Finley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();           temp << "Error - Interpolation on Domain: Dudley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();
965           throw FinleyAdapterException(temp.str());           throw DudleyAdapterException(temp.str());
966           break;           break;
967        }        }
968        break;        break;
969     case(Elements):     case(Elements):
970        if (target.getFunctionSpace().getTypeCode()==Elements) {        if (target.getFunctionSpace().getTypeCode()==Elements) {
971           Finley_Assemble_CopyElementData(mesh->Elements,&_target,&_in);           Dudley_Assemble_CopyElementData(mesh->Elements,&_target,&_in);
972        } else if (target.getFunctionSpace().getTypeCode()==ReducedElements) {        } else if (target.getFunctionSpace().getTypeCode()==ReducedElements) {
973           Finley_Assemble_AverageElementData(mesh->Elements,&_target,&_in);           Dudley_Assemble_AverageElementData(mesh->Elements,&_target,&_in);
974        } else {        } else {
975           throw FinleyAdapterException("Error - No interpolation with data on elements possible.");           throw DudleyAdapterException("Error - No interpolation with data on elements possible.");
976        }        }
977        break;        break;
978     case(ReducedElements):     case(ReducedElements):
979        if (target.getFunctionSpace().getTypeCode()==ReducedElements) {        if (target.getFunctionSpace().getTypeCode()==ReducedElements) {
980           Finley_Assemble_CopyElementData(mesh->Elements,&_target,&_in);           Dudley_Assemble_CopyElementData(mesh->Elements,&_target,&_in);
981        } else {        } else {
982           throw FinleyAdapterException("Error - No interpolation with data on elements with reduced integration order possible.");           throw DudleyAdapterException("Error - No interpolation with data on elements with reduced integration order possible.");
983        }        }
984        break;        break;
985     case(FaceElements):     case(FaceElements):
986        if (target.getFunctionSpace().getTypeCode()==FaceElements) {        if (target.getFunctionSpace().getTypeCode()==FaceElements) {
987           Finley_Assemble_CopyElementData(mesh->FaceElements,&_target,&_in);           Dudley_Assemble_CopyElementData(mesh->FaceElements,&_target,&_in);
988        } else if (target.getFunctionSpace().getTypeCode()==ReducedFaceElements) {        } else if (target.getFunctionSpace().getTypeCode()==ReducedFaceElements) {
989           Finley_Assemble_AverageElementData(mesh->FaceElements,&_target,&_in);           Dudley_Assemble_AverageElementData(mesh->FaceElements,&_target,&_in);
990        } else {        } else {
991           throw FinleyAdapterException("Error - No interpolation with data on face elements possible.");           throw DudleyAdapterException("Error - No interpolation with data on face elements possible.");
992        }        }
993        break;        break;
994     case(ReducedFaceElements):     case(ReducedFaceElements):
995        if (target.getFunctionSpace().getTypeCode()==ReducedFaceElements) {        if (target.getFunctionSpace().getTypeCode()==ReducedFaceElements) {
996           Finley_Assemble_CopyElementData(mesh->FaceElements,&_target,&_in);           Dudley_Assemble_CopyElementData(mesh->FaceElements,&_target,&_in);
997        } else {        } else {
998           throw FinleyAdapterException("Error - No interpolation with data on face elements with reduced integration order possible.");           throw DudleyAdapterException("Error - No interpolation with data on face elements with reduced integration order possible.");
999        }        }
1000        break;        break;
1001     case(Points):     case(Points):
1002        if (target.getFunctionSpace().getTypeCode()==Points) {        if (target.getFunctionSpace().getTypeCode()==Points) {
1003           Finley_Assemble_CopyElementData(mesh->Points,&_target,&_in);           Dudley_Assemble_CopyElementData(mesh->Points,&_target,&_in);
1004        } else {        } else {
1005           throw FinleyAdapterException("Error - No interpolation with data on points possible.");           throw DudleyAdapterException("Error - No interpolation with data on points possible.");
1006        }        }
1007        break;        break;
1008     case(ContactElementsZero):     case(ContactElementsZero):
1009     case(ContactElementsOne):     case(ContactElementsOne):
1010        if (target.getFunctionSpace().getTypeCode()==ContactElementsZero || target.getFunctionSpace().getTypeCode()==ContactElementsOne) {        if (target.getFunctionSpace().getTypeCode()==ContactElementsZero || target.getFunctionSpace().getTypeCode()==ContactElementsOne) {
1011           Finley_Assemble_CopyElementData(mesh->ContactElements,&_target,&_in);           Dudley_Assemble_CopyElementData(mesh->ContactElements,&_target,&_in);
1012        } else if (target.getFunctionSpace().getTypeCode()==ReducedContactElementsZero || target.getFunctionSpace().getTypeCode()==ReducedContactElementsOne) {        } else if (target.getFunctionSpace().getTypeCode()==ReducedContactElementsZero || target.getFunctionSpace().getTypeCode()==ReducedContactElementsOne) {
1013           Finley_Assemble_AverageElementData(mesh->ContactElements,&_target,&_in);           Dudley_Assemble_AverageElementData(mesh->ContactElements,&_target,&_in);
1014        } else {        } else {
1015           throw FinleyAdapterException("Error - No interpolation with data on contact elements possible.");           throw DudleyAdapterException("Error - No interpolation with data on contact elements possible.");
1016        }        }
1017        break;        break;
1018     case(ReducedContactElementsZero):     case(ReducedContactElementsZero):
1019     case(ReducedContactElementsOne):     case(ReducedContactElementsOne):
1020        if (target.getFunctionSpace().getTypeCode()==ReducedContactElementsZero || target.getFunctionSpace().getTypeCode()==ReducedContactElementsOne) {        if (target.getFunctionSpace().getTypeCode()==ReducedContactElementsZero || target.getFunctionSpace().getTypeCode()==ReducedContactElementsOne) {
1021           Finley_Assemble_CopyElementData(mesh->ContactElements,&_target,&_in);           Dudley_Assemble_CopyElementData(mesh->ContactElements,&_target,&_in);
1022        } else {        } else {
1023           throw FinleyAdapterException("Error - No interpolation with data on contact elements with reduced integration order possible.");           throw DudleyAdapterException("Error - No interpolation with data on contact elements with reduced integration order possible.");
1024        }        }
1025        break;        break;
1026     case(DegreesOfFreedom):           case(DegreesOfFreedom):      
1027        switch(target.getFunctionSpace().getTypeCode()) {        switch(target.getFunctionSpace().getTypeCode()) {
1028        case(ReducedDegreesOfFreedom):        case(ReducedDegreesOfFreedom):
1029        case(DegreesOfFreedom):        case(DegreesOfFreedom):
1030        Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);        Dudley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);
1031        break;        break;
1032        
1033        case(Nodes):        case(Nodes):
# Line 1036  void MeshAdapter::interpolateOnDomain(es Line 1036  void MeshAdapter::interpolateOnDomain(es
1036           escript::Data temp=escript::Data(in);           escript::Data temp=escript::Data(in);
1037           temp.expand();           temp.expand();
1038           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1039           Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in2);           Dudley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in2);
1040        } else {        } else {
1041           Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);           Dudley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);
1042        }        }
1043        break;        break;
1044        case(Elements):        case(Elements):
# Line 1046  void MeshAdapter::interpolateOnDomain(es Line 1046  void MeshAdapter::interpolateOnDomain(es
1046        if (getMPISize()>1) {        if (getMPISize()>1) {
1047           escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );
1048           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1049           Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in2,&_target);           Dudley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in2,&_target);
1050        } else {        } else {
1051           Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);           Dudley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);
1052        }        }
1053        break;        break;
1054        case(FaceElements):        case(FaceElements):
# Line 1056  void MeshAdapter::interpolateOnDomain(es Line 1056  void MeshAdapter::interpolateOnDomain(es
1056        if (getMPISize()>1) {        if (getMPISize()>1) {
1057           escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );
1058           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1059           Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in2,&_target);           Dudley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in2,&_target);
1060        
1061        } else {        } else {
1062           Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);           Dudley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);
1063        }        }
1064        break;        break;
1065        case(Points):        case(Points):
# Line 1067  void MeshAdapter::interpolateOnDomain(es Line 1067  void MeshAdapter::interpolateOnDomain(es
1067           escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );
1068           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1069        } else {        } else {
1070           Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);           Dudley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);
1071        }        }
1072        break;        break;
1073        case(ContactElementsZero):        case(ContactElementsZero):
# Line 1077  void MeshAdapter::interpolateOnDomain(es Line 1077  void MeshAdapter::interpolateOnDomain(es
1077        if (getMPISize()>1) {        if (getMPISize()>1) {
1078           escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );
1079           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1080           Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in2,&_target);           Dudley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in2,&_target);
1081        } else {        } else {
1082           Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);           Dudley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);
1083        }        }
1084        break;        break;
1085        default:        default:
1086           stringstream temp;           stringstream temp;
1087           temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();           temp << "Error - Interpolation On Domain: Dudley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();
1088           throw FinleyAdapterException(temp.str());           throw DudleyAdapterException(temp.str());
1089           break;           break;
1090        }        }
1091        break;        break;
1092     case(ReducedDegreesOfFreedom):     case(ReducedDegreesOfFreedom):
1093        switch(target.getFunctionSpace().getTypeCode()) {        switch(target.getFunctionSpace().getTypeCode()) {
1094        case(Nodes):        case(Nodes):
1095        throw FinleyAdapterException("Error - Finley does not support interpolation from reduced degrees of freedom to mesh nodes.");        throw DudleyAdapterException("Error - Dudley does not support interpolation from reduced degrees of freedom to mesh nodes.");
1096        break;        break;
1097        case(ReducedNodes):        case(ReducedNodes):
1098        if (getMPISize()>1) {        if (getMPISize()>1) {
1099           escript::Data temp=escript::Data(in);           escript::Data temp=escript::Data(in);
1100           temp.expand();           temp.expand();
1101           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1102           Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in2);           Dudley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in2);
1103        } else {        } else {
1104           Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);           Dudley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);
1105        }        }
1106        break;        break;
1107        case(DegreesOfFreedom):        case(DegreesOfFreedom):
1108        throw FinleyAdapterException("Error - Finley does not support interpolation from reduced degrees of freedom to degrees of freedom");        throw DudleyAdapterException("Error - Dudley does not support interpolation from reduced degrees of freedom to degrees of freedom");
1109        break;        break;
1110        case(ReducedDegreesOfFreedom):        case(ReducedDegreesOfFreedom):
1111        Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);        Dudley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);
1112        break;        break;
1113        case(Elements):        case(Elements):
1114        case(ReducedElements):        case(ReducedElements):
1115        if (getMPISize()>1) {        if (getMPISize()>1) {
1116           escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );
1117           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1118           Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in2,&_target);           Dudley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in2,&_target);
1119        } else {        } else {
1120           Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);           Dudley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);
1121        }        }
1122        break;        break;
1123        case(FaceElements):        case(FaceElements):
# Line 1125  void MeshAdapter::interpolateOnDomain(es Line 1125  void MeshAdapter::interpolateOnDomain(es
1125        if (getMPISize()>1) {        if (getMPISize()>1) {
1126           escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );
1127           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1128           Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in2,&_target);           Dudley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in2,&_target);
1129        } else {        } else {
1130           Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);           Dudley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);
1131        }        }
1132        break;        break;
1133        case(Points):        case(Points):
1134        if (getMPISize()>1) {        if (getMPISize()>1) {
1135           escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );
1136           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1137           Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in2,&_target);           Dudley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in2,&_target);
1138        } else {        } else {
1139           Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);           Dudley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);
1140        }        }
1141        break;        break;
1142        case(ContactElementsZero):        case(ContactElementsZero):
# Line 1146  void MeshAdapter::interpolateOnDomain(es Line 1146  void MeshAdapter::interpolateOnDomain(es
1146        if (getMPISize()>1) {        if (getMPISize()>1) {
1147           escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );           escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );
1148           escriptDataC _in2 = temp.getDataC();           escriptDataC _in2 = temp.getDataC();
1149           Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in2,&_target);           Dudley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in2,&_target);
1150        } else {        } else {
1151           Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);           Dudley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);
1152        }        }
1153        break;        break;
1154        default:        default:
1155           stringstream temp;           stringstream temp;
1156           temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();           temp << "Error - Interpolation On Domain: Dudley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();
1157           throw FinleyAdapterException(temp.str());           throw DudleyAdapterException(temp.str());
1158           break;           break;
1159        }        }
1160        break;        break;
1161     default:     default:
1162        stringstream temp;        stringstream temp;
1163        temp << "Error - Interpolation On Domain: Finley does not know anything about function space type %d" << in.getFunctionSpace().getTypeCode();        temp << "Error - Interpolation On Domain: Dudley does not know anything about function space type %d" << in.getFunctionSpace().getTypeCode();
1164        throw FinleyAdapterException(temp.str());        throw DudleyAdapterException(temp.str());
1165        break;        break;
1166     }     }
1167     checkFinleyError();     checkDudleyError();
1168  }  }
1169    
1170  //  //
# Line 1174  void MeshAdapter::setToX(escript::Data& Line 1174  void MeshAdapter::setToX(escript::Data&
1174  {  {
1175     const MeshAdapter& argDomain=dynamic_cast<const MeshAdapter&>(*(arg.getFunctionSpace().getDomain()));     const MeshAdapter& argDomain=dynamic_cast<const MeshAdapter&>(*(arg.getFunctionSpace().getDomain()));
1176     if (argDomain!=*this)     if (argDomain!=*this)
1177        throw FinleyAdapterException("Error - Illegal domain of data point locations");        throw DudleyAdapterException("Error - Illegal domain of data point locations");
1178     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
1179     // in case of values node coordinates we can do the job directly:     // in case of values node coordinates we can do the job directly:
1180     if (arg.getFunctionSpace().getTypeCode()==Nodes) {     if (arg.getFunctionSpace().getTypeCode()==Nodes) {
1181        escriptDataC _arg=arg.getDataC();        escriptDataC _arg=arg.getDataC();
1182        Finley_Assemble_NodeCoordinates(mesh->Nodes,&_arg);        Dudley_Assemble_NodeCoordinates(mesh->Nodes,&_arg);
1183     } else {     } else {
1184        escript::Data tmp_data=Vector(0.0,continuousFunction(asAbstractContinuousDomain()),true);        escript::Data tmp_data=Vector(0.0,continuousFunction(asAbstractContinuousDomain()),true);
1185        escriptDataC _tmp_data=tmp_data.getDataC();        escriptDataC _tmp_data=tmp_data.getDataC();
1186        Finley_Assemble_NodeCoordinates(mesh->Nodes,&_tmp_data);        Dudley_Assemble_NodeCoordinates(mesh->Nodes,&_tmp_data);
1187        // this is then interpolated onto arg:        // this is then interpolated onto arg:
1188        interpolateOnDomain(arg,tmp_data);        interpolateOnDomain(arg,tmp_data);
1189     }     }
1190     checkFinleyError();     checkDudleyError();
1191  }  }
1192    
1193  //  //
# Line 1198  void MeshAdapter::setToNormal(escript::D Line 1198  void MeshAdapter::setToNormal(escript::D
1198  /*   const MeshAdapter& normalDomain=dynamic_cast<const MeshAdapter&>(normal.getFunctionSpace().getDomain());*/  /*   const MeshAdapter& normalDomain=dynamic_cast<const MeshAdapter&>(normal.getFunctionSpace().getDomain());*/
1199     const MeshAdapter& normalDomain=dynamic_cast<const MeshAdapter&>(*(normal.getFunctionSpace().getDomain()));     const MeshAdapter& normalDomain=dynamic_cast<const MeshAdapter&>(*(normal.getFunctionSpace().getDomain()));
1200     if (normalDomain!=*this)     if (normalDomain!=*this)
1201        throw FinleyAdapterException("Error - Illegal domain of normal locations");        throw DudleyAdapterException("Error - Illegal domain of normal locations");
1202     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
1203     escriptDataC _normal=normal.getDataC();     escriptDataC _normal=normal.getDataC();
1204     switch(normal.getFunctionSpace().getTypeCode()) {     switch(normal.getFunctionSpace().getTypeCode()) {
1205     case(Nodes):     case(Nodes):
1206     throw FinleyAdapterException("Error - Finley does not support surface normal vectors for nodes");     throw DudleyAdapterException("Error - Dudley does not support surface normal vectors for nodes");
1207     break;     break;
1208     case(ReducedNodes):     case(ReducedNodes):
1209     throw FinleyAdapterException("Error - Finley does not support surface normal vectors for reduced nodes");     throw DudleyAdapterException("Error - Dudley does not support surface normal vectors for reduced nodes");
1210     break;     break;
1211     case(Elements):     case(Elements):
1212     throw FinleyAdapterException("Error - Finley does not support surface normal vectors for elements");     throw DudleyAdapterException("Error - Dudley does not support surface normal vectors for elements");
1213     break;     break;
1214     case(ReducedElements):     case(ReducedElements):
1215     throw FinleyAdapterException("Error - Finley does not support surface normal vectors for elements with reduced integration order");     throw DudleyAdapterException("Error - Dudley does not support surface normal vectors for elements with reduced integration order");
1216     break;     break;
1217     case (FaceElements):     case (FaceElements):
1218     Finley_Assemble_setNormal(mesh->Nodes,mesh->FaceElements,&_normal);     Dudley_Assemble_setNormal(mesh->Nodes,mesh->FaceElements,&_normal);
1219     break;     break;
1220     case (ReducedFaceElements):     case (ReducedFaceElements):
1221     Finley_Assemble_setNormal(mesh->Nodes,mesh->FaceElements,&_normal);     Dudley_Assemble_setNormal(mesh->Nodes,mesh->FaceElements,&_normal);
1222     break;     break;
1223     case(Points):     case(Points):
1224     throw FinleyAdapterException("Error - Finley does not support surface normal vectors for point elements");     throw DudleyAdapterException("Error - Dudley does not support surface normal vectors for point elements");
1225     break;     break;
1226     case (ContactElementsOne):     case (ContactElementsOne):
1227     case (ContactElementsZero):     case (ContactElementsZero):
1228     Finley_Assemble_setNormal(mesh->Nodes,mesh->ContactElements,&_normal);     Dudley_Assemble_setNormal(mesh->Nodes,mesh->ContactElements,&_normal);
1229     break;     break;
1230     case (ReducedContactElementsOne):     case (ReducedContactElementsOne):
1231     case (ReducedContactElementsZero):     case (ReducedContactElementsZero):
1232     Finley_Assemble_setNormal(mesh->Nodes,mesh->ContactElements,&_normal);     Dudley_Assemble_setNormal(mesh->Nodes,mesh->ContactElements,&_normal);
1233     break;     break;
1234     case(DegreesOfFreedom):     case(DegreesOfFreedom):
1235     throw FinleyAdapterException("Error - Finley does not support surface normal vectors for degrees of freedom.");     throw DudleyAdapterException("Error - Dudley does not support surface normal vectors for degrees of freedom.");
1236     break;     break;
1237     case(ReducedDegreesOfFreedom):     case(ReducedDegreesOfFreedom):
1238     throw FinleyAdapterException("Error - Finley does not support surface normal vectors for reduced degrees of freedom.");     throw DudleyAdapterException("Error - Dudley does not support surface normal vectors for reduced degrees of freedom.");
1239     break;     break;
1240     default:     default:
1241        stringstream temp;        stringstream temp;
1242        temp << "Error - Normal Vectors: Finley does not know anything about function space type " << normal.getFunctionSpace().getTypeCode();        temp << "Error - Normal Vectors: Dudley does not know anything about function space type " << normal.getFunctionSpace().getTypeCode();
1243        throw FinleyAdapterException(temp.str());        throw DudleyAdapterException(temp.str());
1244        break;        break;
1245     }     }
1246     checkFinleyError();     checkDudleyError();
1247  }  }
1248    
1249  //  //
# Line 1254  void MeshAdapter::interpolateACross(escr Line 1254  void MeshAdapter::interpolateACross(escr
1254     const_Domain_ptr targetDomain_p=target.getFunctionSpace().getDomain();     const_Domain_ptr targetDomain_p=target.getFunctionSpace().getDomain();
1255     const MeshAdapter* targetDomain=dynamic_cast<const MeshAdapter*>(targetDomain_p.get());     const MeshAdapter* targetDomain=dynamic_cast<const MeshAdapter*>(targetDomain_p.get());
1256     if (targetDomain!=this)     if (targetDomain!=this)
1257        throw FinleyAdapterException("Error - Illegal domain of interpolation target");        throw DudleyAdapterException("Error - Illegal domain of interpolation target");
1258    
1259     throw FinleyAdapterException("Error - Finley does not allow interpolation across domains yet.");     throw DudleyAdapterException("Error - Dudley does not allow interpolation across domains yet.");
1260  }  }
1261    
1262  //  //
# Line 1266  void MeshAdapter::setToIntegrals(vector< Line 1266  void MeshAdapter::setToIntegrals(vector<
1266  {  {
1267     const MeshAdapter& argDomain=dynamic_cast<const MeshAdapter&>(*(arg.getFunctionSpace().getDomain()));     const MeshAdapter& argDomain=dynamic_cast<const MeshAdapter&>(*(arg.getFunctionSpace().getDomain()));
1268     if (argDomain!=*this)     if (argDomain!=*this)
1269        throw FinleyAdapterException("Error - Illegal domain of integration kernel");        throw DudleyAdapterException("Error - Illegal domain of integration kernel");
1270    
1271     double blocktimer_start = blocktimer_time();     double blocktimer_start = blocktimer_time();
1272     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
1273     escriptDataC _temp;     escriptDataC _temp;
1274     escript::Data temp;     escript::Data temp;
1275     escriptDataC _arg=arg.getDataC();     escriptDataC _arg=arg.getDataC();
# Line 1277  void MeshAdapter::setToIntegrals(vector< Line 1277  void MeshAdapter::setToIntegrals(vector<
1277     case(Nodes):     case(Nodes):
1278     temp=escript::Data( arg, escript::function(asAbstractContinuousDomain()) );     temp=escript::Data( arg, escript::function(asAbstractContinuousDomain()) );
1279     _temp=temp.getDataC();     _temp=temp.getDataC();
1280     Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);     Dudley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);
1281     break;     break;
1282     case(ReducedNodes):     case(ReducedNodes):
1283     temp=escript::Data( arg, escript::function(asAbstractContinuousDomain()) );     temp=escript::Data( arg, escript::function(asAbstractContinuousDomain()) );
1284     _temp=temp.getDataC();     _temp=temp.getDataC();
1285     Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);     Dudley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);
1286     break;     break;
1287     case(Elements):     case(Elements):
1288     Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_arg,&integrals[0]);     Dudley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_arg,&integrals[0]);
1289     break;     break;
1290     case(ReducedElements):     case(ReducedElements):
1291     Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_arg,&integrals[0]);     Dudley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_arg,&integrals[0]);
1292     break;     break;
1293     case(FaceElements):     case(FaceElements):
1294     Finley_Assemble_integrate(mesh->Nodes,mesh->FaceElements,&_arg,&integrals[0]);     Dudley_Assemble_integrate(mesh->Nodes,mesh->FaceElements,&_arg,&integrals[0]);
1295     break;     break;
1296     case(ReducedFaceElements):     case(ReducedFaceElements):
1297     Finley_Assemble_integrate(mesh->Nodes,mesh->FaceElements,&_arg,&integrals[0]);     Dudley_Assemble_integrate(mesh->Nodes,mesh->FaceElements,&_arg,&integrals[0]);
1298     break;     break;
1299     case(Points):     case(Points):
1300     throw FinleyAdapterException("Error - Integral of data on points is not supported.");     throw DudleyAdapterException("Error - Integral of data on points is not supported.");
1301     break;     break;
1302     case(ContactElementsZero):     case(ContactElementsZero):
1303     Finley_Assemble_integrate(mesh->Nodes,mesh->ContactElements,&_arg,&integrals[0]);     Dudley_Assemble_integrate(mesh->Nodes,mesh->ContactElements,&_arg,&integrals[0]);
1304     break;     break;
1305     case(ReducedContactElementsZero):     case(ReducedContactElementsZero):
1306     Finley_Assemble_integrate(mesh->Nodes,mesh->ContactElements,&_arg,&integrals[0]);     Dudley_Assemble_integrate(mesh->Nodes,mesh->ContactElements,&_arg,&integrals[0]);
1307     break;     break;
1308     case(ContactElementsOne):     case(ContactElementsOne):
1309     Finley_Assemble_integrate(mesh->Nodes,mesh->ContactElements,&_arg,&integrals[0]);     Dudley_Assemble_integrate(mesh->Nodes,mesh->ContactElements,&_arg,&integrals[0]);
1310     break;     break;
1311     case(ReducedContactElementsOne):     case(ReducedContactElementsOne):
1312     Finley_Assemble_integrate(mesh->Nodes,mesh->ContactElements,&_arg,&integrals[0]);     Dudley_Assemble_integrate(mesh->Nodes,mesh->ContactElements,&_arg,&integrals[0]);
1313     break;     break;
1314     case(DegreesOfFreedom):     case(DegreesOfFreedom):
1315     temp=escript::Data( arg, escript::function(asAbstractContinuousDomain()) );     temp=escript::Data( arg, escript::function(asAbstractContinuousDomain()) );
1316     _temp=temp.getDataC();     _temp=temp.getDataC();
1317     Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);     Dudley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);
1318     break;     break;
1319     case(ReducedDegreesOfFreedom):     case(ReducedDegreesOfFreedom):
1320     temp=escript::Data( arg, escript::function(asAbstractContinuousDomain()) );     temp=escript::Data( arg, escript::function(asAbstractContinuousDomain()) );
1321     _temp=temp.getDataC();     _temp=temp.getDataC();
1322     Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);     Dudley_Assemble_integrate(mesh->Nodes,mesh->Elements,&_temp,&integrals[0]);
1323     break;     break;
1324     default:     default:
1325        stringstream temp;        stringstream temp;
1326        temp << "Error - Integrals: Finley does not know anything about function space type " << arg.getFunctionSpace().getTypeCode();        temp << "Error - Integrals: Dudley does not know anything about function space type " << arg.getFunctionSpace().getTypeCode();
1327        throw FinleyAdapterException(temp.str());        throw DudleyAdapterException(temp.str());
1328        break;        break;
1329     }     }
1330     checkFinleyError();     checkDudleyError();
1331     blocktimer_increment("integrate()", blocktimer_start);     blocktimer_increment("integrate()", blocktimer_start);
1332  }  }
1333    
# Line 1338  void MeshAdapter::setToGradient(escript: Line 1338  void MeshAdapter::setToGradient(escript:
1338  {  {
1339     const MeshAdapter& argDomain=dynamic_cast<const MeshAdapter&>(*(arg.getFunctionSpace().getDomain()));     const MeshAdapter& argDomain=dynamic_cast<const MeshAdapter&>(*(arg.getFunctionSpace().getDomain()));
1340     if (argDomain!=*this)     if (argDomain!=*this)
1341        throw FinleyAdapterException("Error - Illegal domain of gradient argument");        throw DudleyAdapterException("Error - Illegal domain of gradient argument");
1342     const MeshAdapter& gradDomain=dynamic_cast<const MeshAdapter&>(*(grad.getFunctionSpace().getDomain()));     const MeshAdapter& gradDomain=dynamic_cast<const MeshAdapter&>(*(grad.getFunctionSpace().getDomain()));
1343     if (gradDomain!=*this)     if (gradDomain!=*this)
1344        throw FinleyAdapterException("Error - Illegal domain of gradient");        throw DudleyAdapterException("Error - Illegal domain of gradient");
1345    
1346     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
1347     escriptDataC _grad=grad.getDataC();     escriptDataC _grad=grad.getDataC();
1348     escriptDataC nodeDataC;     escriptDataC nodeDataC;
1349     escript::Data temp;     escript::Data temp;
# Line 1362  void MeshAdapter::setToGradient(escript: Line 1362  void MeshAdapter::setToGradient(escript:
1362     }     }
1363     switch(grad.getFunctionSpace().getTypeCode()) {     switch(grad.getFunctionSpace().getTypeCode()) {
1364     case(Nodes):     case(Nodes):
1365     throw FinleyAdapterException("Error - Gradient at nodes is not supported.");     throw DudleyAdapterException("Error - Gradient at nodes is not supported.");
1366     break;     break;
1367     case(ReducedNodes):     case(ReducedNodes):
1368     throw FinleyAdapterException("Error - Gradient at reduced nodes is not supported.");     throw DudleyAdapterException("Error - Gradient at reduced nodes is not supported.");
1369     break;     break;
1370     case(Elements):     case(Elements):
1371     Finley_Assemble_gradient(mesh->Nodes,mesh->Elements,&_grad,&nodeDataC);     Dudley_Assemble_gradient(mesh->Nodes,mesh->Elements,&_grad,&nodeDataC);
1372     break;     break;
1373     case(ReducedElements):     case(ReducedElements):
1374     Finley_Assemble_gradient(mesh->Nodes,mesh->Elements,&_grad,&nodeDataC);     Dudley_Assemble_gradient(mesh->Nodes,mesh->Elements,&_grad,&nodeDataC);
1375     break;     break;
1376     case(FaceElements):     case(FaceElements):
1377     Finley_Assemble_gradient(mesh->Nodes,mesh->FaceElements,&_grad,&nodeDataC);     Dudley_Assemble_gradient(mesh->Nodes,mesh->FaceElements,&_grad,&nodeDataC);
1378     break;     break;
1379     case(ReducedFaceElements):     case(ReducedFaceElements):
1380     Finley_Assemble_gradient(mesh->Nodes,mesh->FaceElements,&_grad,&nodeDataC);     Dudley_Assemble_gradient(mesh->Nodes,mesh->FaceElements,&_grad,&nodeDataC);
1381     break;     break;
1382     case(Points):     case(Points):
1383     throw FinleyAdapterException("Error - Gradient at points is not supported.");     throw DudleyAdapterException("Error - Gradient at points is not supported.");
1384     break;     break;
1385     case(ContactElementsZero):     case(ContactElementsZero):
1386     Finley_Assemble_gradient(mesh->Nodes,mesh->ContactElements,&_grad,&nodeDataC);     Dudley_Assemble_gradient(mesh->Nodes,mesh->ContactElements,&_grad,&nodeDataC);
1387     break;     break;
1388     case(ReducedContactElementsZero):     case(ReducedContactElementsZero):
1389     Finley_Assemble_gradient(mesh->Nodes,mesh->ContactElements,&_grad,&nodeDataC);     Dudley_Assemble_gradient(mesh->Nodes,mesh->ContactElements,&_grad,&nodeDataC);
1390     break;     break;
1391     case(ContactElementsOne):     case(ContactElementsOne):
1392     Finley_Assemble_gradient(mesh->Nodes,mesh->ContactElements,&_grad,&nodeDataC);     Dudley_Assemble_gradient(mesh->Nodes,mesh->ContactElements,&_grad,&nodeDataC);
1393     break;     break;
1394     case(ReducedContactElementsOne):     case(ReducedContactElementsOne):
1395     Finley_Assemble_gradient(mesh->Nodes,mesh->ContactElements,&_grad,&nodeDataC);     Dudley_Assemble_gradient(mesh->Nodes,mesh->ContactElements,&_grad,&nodeDataC);
1396     break;     break;
1397     case(DegreesOfFreedom):     case(DegreesOfFreedom):
1398     throw FinleyAdapterException("Error - Gradient at degrees of freedom is not supported.");     throw DudleyAdapterException("Error - Gradient at degrees of freedom is not supported.");
1399     break;     break;
1400     case(ReducedDegreesOfFreedom):     case(ReducedDegreesOfFreedom):
1401     throw FinleyAdapterException("Error - Gradient at reduced degrees of freedom is not supported.");     throw DudleyAdapterException("Error - Gradient at reduced degrees of freedom is not supported.");
1402     break;     break;
1403     default:     default:
1404        stringstream temp;        stringstream temp;
1405        temp << "Error - Gradient: Finley does not know anything about function space type " << arg.getFunctionSpace().getTypeCode();        temp << "Error - Gradient: Dudley does not know anything about function space type " << arg.getFunctionSpace().getTypeCode();
1406        throw FinleyAdapterException(temp.str());        throw DudleyAdapterException(temp.str());
1407        break;        break;
1408     }     }
1409     checkFinleyError();     checkDudleyError();
1410  }  }
1411    
1412  //  //
# Line 1414  void MeshAdapter::setToGradient(escript: Line 1414  void MeshAdapter::setToGradient(escript:
1414  //  //
1415  void MeshAdapter::setToSize(escript::Data& size) const  void MeshAdapter::setToSize(escript::Data& size) const
1416  {  {
1417     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
1418     escriptDataC tmp=size.getDataC();     escriptDataC tmp=size.getDataC();
1419     switch(size.getFunctionSpace().getTypeCode()) {     switch(size.getFunctionSpace().getTypeCode()) {
1420     case(Nodes):     case(Nodes):
1421     throw FinleyAdapterException("Error - Size of nodes is not supported.");     throw DudleyAdapterException("Error - Size of nodes is not supported.");
1422     break;     break;
1423     case(ReducedNodes):     case(ReducedNodes):
1424     throw FinleyAdapterException("Error - Size of reduced nodes is not supported.");     throw DudleyAdapterException("Error - Size of reduced nodes is not supported.");
1425     break;     break;
1426     case(Elements):     case(Elements):
1427     Finley_Assemble_getSize(mesh->Nodes,mesh->Elements,&tmp);     Dudley_Assemble_getSize(mesh->Nodes,mesh->Elements,&tmp);
1428     break;     break;
1429     case(ReducedElements):     case(ReducedElements):
1430     Finley_Assemble_getSize(mesh->Nodes,mesh->Elements,&tmp);     Dudley_Assemble_getSize(mesh->Nodes,mesh->Elements,&tmp);
1431     break;     break;
1432     case(FaceElements):     case(FaceElements):
1433     Finley_Assemble_getSize(mesh->Nodes,mesh->FaceElements,&tmp);     Dudley_Assemble_getSize(mesh->Nodes,mesh->FaceElements,&tmp);
1434     break;     break;
1435     case(ReducedFaceElements):     case(ReducedFaceElements):
1436     Finley_Assemble_getSize(mesh->Nodes,mesh->FaceElements,&tmp);     Dudley_Assemble_getSize(mesh->Nodes,mesh->FaceElements,&tmp);
1437     break;     break;
1438     case(Points):     case(Points):
1439     throw FinleyAdapterException("Error - Size of point elements is not supported.");     throw DudleyAdapterException("Error - Size of point elements is not supported.");
1440     break;     break;
1441     case(ContactElementsZero):     case(ContactElementsZero):
1442     case(ContactElementsOne):     case(ContactElementsOne):
1443     Finley_Assemble_getSize(mesh->Nodes,mesh->ContactElements,&tmp);     Dudley_Assemble_getSize(mesh->Nodes,mesh->ContactElements,&tmp);
1444     break;     break;
1445     case(ReducedContactElementsZero):     case(ReducedContactElementsZero):
1446     case(ReducedContactElementsOne):     case(ReducedContactElementsOne):
1447     Finley_Assemble_getSize(mesh->Nodes,mesh->ContactElements,&tmp);     Dudley_Assemble_getSize(mesh->Nodes,mesh->ContactElements,&tmp);
1448     break;     break;
1449     case(DegreesOfFreedom):     case(DegreesOfFreedom):
1450     throw FinleyAdapterException("Error - Size of degrees of freedom is not supported.");     throw DudleyAdapterException("Error - Size of degrees of freedom is not supported.");
1451     break;     break;
1452     case(ReducedDegreesOfFreedom):     case(ReducedDegreesOfFreedom):
1453     throw FinleyAdapterException("Error - Size of reduced degrees of freedom is not supported.");     throw DudleyAdapterException("Error - Size of reduced degrees of freedom is not supported.");
1454     break;     break;
1455     default:     default:
1456        stringstream temp;        stringstream temp;
1457        temp << "Error - Element size: Finley does not know anything about function space type " << size.getFunctionSpace().getTypeCode();        temp << "Error - Element size: Dudley does not know anything about function space type " << size.getFunctionSpace().getTypeCode();
1458        throw FinleyAdapterException(temp.str());        throw DudleyAdapterException(temp.str());
1459        break;        break;
1460     }     }
1461     checkFinleyError();     checkDudleyError();
1462  }  }
1463    
1464  //  //
# Line 1466  void MeshAdapter::setToSize(escript::Dat Line 1466  void MeshAdapter::setToSize(escript::Dat
1466  //  //
1467  void MeshAdapter::setNewX(const escript::Data& new_x)  void MeshAdapter::setNewX(const escript::Data& new_x)
1468  {  {
1469     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
1470     escriptDataC tmp;     escriptDataC tmp;
1471     const MeshAdapter& newDomain=dynamic_cast<const MeshAdapter&>(*(new_x.getFunctionSpace().getDomain()));     const MeshAdapter& newDomain=dynamic_cast<const MeshAdapter&>(*(new_x.getFunctionSpace().getDomain()));
1472     if (newDomain!=*this)     if (newDomain!=*this)
1473        throw FinleyAdapterException("Error - Illegal domain of new point locations");        throw DudleyAdapterException("Error - Illegal domain of new point locations");
1474     if ( new_x.getFunctionSpace() == continuousFunction(asAbstractContinuousDomain()) ) {     if ( new_x.getFunctionSpace() == continuousFunction(asAbstractContinuousDomain()) ) {
1475         tmp = new_x.getDataC();         tmp = new_x.getDataC();
1476         Finley_Mesh_setCoordinates(mesh,&tmp);         Dudley_Mesh_setCoordinates(mesh,&tmp);
1477     } else {     } else {
1478         escript::Data new_x_inter=escript::Data( new_x,  continuousFunction(asAbstractContinuousDomain()) );         escript::Data new_x_inter=escript::Data( new_x,  continuousFunction(asAbstractContinuousDomain()) );
1479         tmp = new_x_inter.getDataC();         tmp = new_x_inter.getDataC();
1480         Finley_Mesh_setCoordinates(mesh,&tmp);         Dudley_Mesh_setCoordinates(mesh,&tmp);
1481     }     }
1482     checkFinleyError();     checkDudleyError();
1483  }  }
1484    
1485  //  //
# Line 1499  void MeshAdapter::extractArgsFromDict(co Line 1499  void MeshAdapter::extractArgsFromDict(co
1499        string n=boost::python::extract<string>(keys[i]);        string n=boost::python::extract<string>(keys[i]);
1500        escript::Data& d=boost::python::extract<escript::Data&>(arg[keys[i]]);        escript::Data& d=boost::python::extract<escript::Data&>(arg[keys[i]]);
1501        if (dynamic_cast<const MeshAdapter&>(*(d.getFunctionSpace().getDomain())) !=*this)        if (dynamic_cast<const MeshAdapter&>(*(d.getFunctionSpace().getDomain())) !=*this)
1502           throw FinleyAdapterException("Error: Data must be defined on same Domain");           throw DudleyAdapterException("Error: Data must be defined on same Domain");
1503        data[i] = d.getDataC();        data[i] = d.getDataC();
1504        dataPtr[i] = &(data[i]);        dataPtr[i] = &(data[i]);
1505        names[i] = TMPMEMALLOC(n.length()+1, char);        names[i] = TMPMEMALLOC(n.length()+1, char);
# Line 1518  void MeshAdapter::saveDX(const string& f Line 1518  void MeshAdapter::saveDX(const string& f
1518     escriptDataC **ptr_data;     escriptDataC **ptr_data;
1519    
1520     extractArgsFromDict(arg, num_data, names, data, ptr_data);     extractArgsFromDict(arg, num_data, names, data, ptr_data);
1521     Finley_Mesh_saveDX(filename.c_str(), m_finleyMesh.get(), num_data, names, ptr_data);     Dudley_Mesh_saveDX(filename.c_str(), m_dudleyMesh.get(), num_data, names, ptr_data);
1522     checkFinleyError();     checkDudleyError();
1523    
1524     /* win32 refactor */     /* win32 refactor */
1525     TMPMEMFREE(data);     TMPMEMFREE(data);
# Line 1544  void MeshAdapter::saveVTK(const string& Line 1544  void MeshAdapter::saveVTK(const string&
1544     escriptDataC **ptr_data;     escriptDataC **ptr_data;
1545    
1546     extractArgsFromDict(arg, num_data, names, data, ptr_data);     extractArgsFromDict(arg, num_data, names, data, ptr_data);
1547     Finley_Mesh_saveVTK(filename.c_str(), m_finleyMesh.get(), num_data, names, ptr_data, metadata.c_str(), metadata_schema.c_str());     Dudley_Mesh_saveVTK(filename.c_str(), m_dudleyMesh.get(), num_data, names, ptr_data, metadata.c_str(), metadata_schema.c_str());
1548     checkFinleyError();     checkDudleyError();
1549    
1550     /* win32 refactor */     /* win32 refactor */
1551     TMPMEMFREE(data);     TMPMEMFREE(data);
# Line 1562  bool MeshAdapter::ownSample(int fs_code, Line 1562  bool MeshAdapter::ownSample(int fs_code,
1562  #ifdef PASO_MPI  #ifdef PASO_MPI
1563      index_t myFirstNode=0, myLastNode=0, k=0;      index_t myFirstNode=0, myLastNode=0, k=0;
1564      index_t* globalNodeIndex=0;      index_t* globalNodeIndex=0;
1565      Finley_Mesh* mesh_p=m_finleyMesh.get();      Dudley_Mesh* mesh_p=m_dudleyMesh.get();
1566      if (fs_code == FINLEY_REDUCED_NODES)      if (fs_code == DUDLEY_REDUCED_NODES)
1567      {      {
1568      myFirstNode = Finley_NodeFile_getFirstReducedNode(mesh_p->Nodes);      myFirstNode = Dudley_NodeFile_getFirstReducedNode(mesh_p->Nodes);
1569      myLastNode = Finley_NodeFile_getLastReducedNode(mesh_p->Nodes);      myLastNode = Dudley_NodeFile_getLastReducedNode(mesh_p->Nodes);
1570      globalNodeIndex = Finley_NodeFile_borrowGlobalReducedNodesIndex(mesh_p->Nodes);      globalNodeIndex = Dudley_NodeFile_borrowGlobalReducedNodesIndex(mesh_p->Nodes);
1571      }      }
1572      else      else
1573      {      {
1574      myFirstNode = Finley_NodeFile_getFirstNode(mesh_p->Nodes);      myFirstNode = Dudley_NodeFile_getFirstNode(mesh_p->Nodes);
1575      myLastNode = Finley_NodeFile_getLastNode(mesh_p->Nodes);      myLastNode = Dudley_NodeFile_getLastNode(mesh_p->Nodes);
1576      globalNodeIndex = Finley_NodeFile_borrowGlobalNodesIndex(mesh_p->Nodes);      globalNodeIndex = Dudley_NodeFile_borrowGlobalNodesIndex(mesh_p->Nodes);
1577      }      }
1578      k=globalNodeIndex[id];      k=globalNodeIndex[id];
1579      return static_cast<bool>( (myFirstNode <= k) && (k < myLastNode) );      return static_cast<bool>( (myFirstNode <= k) && (k < myLastNode) );
# Line 1598  SystemMatrixAdapter MeshAdapter::newSyst Line 1598  SystemMatrixAdapter MeshAdapter::newSyst
1598     // is the domain right?     // is the domain right?
1599     const MeshAdapter& row_domain=dynamic_cast<const MeshAdapter&>(*(row_functionspace.getDomain()));     const MeshAdapter& row_domain=dynamic_cast<const MeshAdapter&>(*(row_functionspace.getDomain()));
1600     if (row_domain!=*this)     if (row_domain!=*this)
1601        throw FinleyAdapterException("Error - domain of row function space does not match the domain of matrix generator.");        throw DudleyAdapterException("Error - domain of row function space does not match the domain of matrix generator.");
1602     const MeshAdapter& col_domain=dynamic_cast<const MeshAdapter&>(*(column_functionspace.getDomain()));     const MeshAdapter& col_domain=dynamic_cast<const MeshAdapter&>(*(column_functionspace.getDomain()));
1603     if (col_domain!=*this)     if (col_domain!=*this)
1604        throw FinleyAdapterException("Error - domain of columnn function space does not match the domain of matrix generator.");        throw DudleyAdapterException("Error - domain of columnn function space does not match the domain of matrix generator.");
1605     // is the function space type right     // is the function space type right
1606     if (row_functionspace.getTypeCode()==DegreesOfFreedom) {     if (row_functionspace.getTypeCode()==DegreesOfFreedom) {
1607        reduceRowOrder=0;        reduceRowOrder=0;
1608     } else if (row_functionspace.getTypeCode()==ReducedDegreesOfFreedom) {     } else if (row_functionspace.getTypeCode()==ReducedDegreesOfFreedom) {
1609        reduceRowOrder=1;        reduceRowOrder=1;
1610     } else {     } else {
1611        throw FinleyAdapterException("Error - illegal function space type for system matrix rows.");        throw DudleyAdapterException("Error - illegal function space type for system matrix rows.");
1612     }     }
1613     if (column_functionspace.getTypeCode()==DegreesOfFreedom) {     if (column_functionspace.getTypeCode()==DegreesOfFreedom) {
1614        reduceColOrder=0;        reduceColOrder=0;
1615     } else if (column_functionspace.getTypeCode()==ReducedDegreesOfFreedom) {     } else if (column_functionspace.getTypeCode()==ReducedDegreesOfFreedom) {
1616        reduceColOrder=1;        reduceColOrder=1;
1617     } else {     } else {
1618        throw FinleyAdapterException("Error - illegal function space type for system matrix columns.");        throw DudleyAdapterException("Error - illegal function space type for system matrix columns.");
1619     }     }
1620     // generate matrix:     // generate matrix:
1621    
1622     Paso_SystemMatrixPattern* fsystemMatrixPattern=Finley_getPattern(getFinley_Mesh(),reduceRowOrder,reduceColOrder);     Paso_SystemMatrixPattern* fsystemMatrixPattern=Dudley_getPattern(getDudley_Mesh(),reduceRowOrder,reduceColOrder);
1623     checkFinleyError();     checkDudleyError();
1624     Paso_SystemMatrix* fsystemMatrix;     Paso_SystemMatrix* fsystemMatrix;
1625     int trilinos = 0;     int trilinos = 0;
1626     if (trilinos) {     if (trilinos) {
# Line 1649  TransportProblemAdapter MeshAdapter::new Line 1649  TransportProblemAdapter MeshAdapter::new
1649     // is the domain right?     // is the domain right?
1650     const MeshAdapter& domain=dynamic_cast<const MeshAdapter&>(*(functionspace.getDomain()));     const MeshAdapter& domain=dynamic_cast<const MeshAdapter&>(*(functionspace.getDomain()));
1651     if (domain!=*this)     if (domain!=*this)
1652        throw FinleyAdapterException("Error - domain of function space does not match the domain of transport problem generator.");        throw DudleyAdapterException("Error - domain of function space does not match the domain of transport problem generator.");
1653     // is the function space type right     // is the function space type right
1654     if (functionspace.getTypeCode()==DegreesOfFreedom) {     if (functionspace.getTypeCode()==DegreesOfFreedom) {
1655        reduceOrder=0;        reduceOrder=0;
1656     } else if (functionspace.getTypeCode()==ReducedDegreesOfFreedom) {     } else if (functionspace.getTypeCode()==ReducedDegreesOfFreedom) {
1657        reduceOrder=1;        reduceOrder=1;
1658     } else {     } else {
1659        throw FinleyAdapterException("Error - illegal function space type for system matrix rows.");        throw DudleyAdapterException("Error - illegal function space type for system matrix rows.");
1660     }     }
1661     // generate matrix:     // generate matrix:
1662    
1663     Paso_SystemMatrixPattern* fsystemMatrixPattern=Finley_getPattern(getFinley_Mesh(),reduceOrder,reduceOrder);     Paso_SystemMatrixPattern* fsystemMatrixPattern=Dudley_getPattern(getDudley_Mesh(),reduceOrder,reduceOrder);
1664     checkFinleyError();     checkDudleyError();
1665     Paso_TransportProblem* transportProblem;     Paso_TransportProblem* transportProblem;
1666     transportProblem=Paso_TransportProblem_alloc(useBackwardEuler,fsystemMatrixPattern,blocksize);     transportProblem=Paso_TransportProblem_alloc(useBackwardEuler,fsystemMatrixPattern,blocksize);
1667     checkPasoError();     checkPasoError();
# Line 1697  bool MeshAdapter::isCellOriented(int fun Line 1697  bool MeshAdapter::isCellOriented(int fun
1697     break;     break;
1698     default:     default:
1699        stringstream temp;        stringstream temp;
1700        temp << "Error - Cell: Finley does not know anything about function space type " << functionSpaceCode;        temp << "Error - Cell: Dudley does not know anything about function space type " << functionSpaceCode;
1701        throw FinleyAdapterException(temp.str());        throw DudleyAdapterException(temp.str());
1702        break;        break;
1703     }     }
1704     checkFinleyError();     checkDudleyError();
1705     return false;     return false;
1706  }  }
1707    
# Line 1870  bool MeshAdapter::probeInterpolationOnDo Line 1870  bool MeshAdapter::probeInterpolationOnDo
1870      return true;      return true;
1871      default:      default:
1872            stringstream temp;            stringstream temp;
1873            temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_target;            temp << "Error - Interpolation On Domain: Dudley does not know anything about function space type " << functionSpaceType_target;
1874            throw FinleyAdapterException(temp.str());            throw DudleyAdapterException(temp.str());
1875     }     }
1876     break;     break;
1877     case(ReducedNodes):     case(ReducedNodes):
# Line 1893  bool MeshAdapter::probeInterpolationOnDo Line 1893  bool MeshAdapter::probeInterpolationOnDo
1893      return false;      return false;
1894      default:      default:
1895          stringstream temp;          stringstream temp;
1896          temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_target;          temp << "Error - Interpolation On Domain: Dudley does not know anything about function space type " << functionSpaceType_target;
1897          throw FinleyAdapterException(temp.str());          throw DudleyAdapterException(temp.str());
1898     }     }
1899     break;     break;
1900     case(Elements):     case(Elements):
# Line 1965  bool MeshAdapter::probeInterpolationOnDo Line 1965  bool MeshAdapter::probeInterpolationOnDo
1965      return true;      return true;
1966      default:      default:
1967          stringstream temp;          stringstream temp;
1968          temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_target;          temp << "Error - Interpolation On Domain: Dudley does not know anything about function space type " << functionSpaceType_target;
1969          throw FinleyAdapterException(temp.str());          throw DudleyAdapterException(temp.str());
1970      }      }
1971      break;      break;
1972     case(ReducedDegreesOfFreedom):     case(ReducedDegreesOfFreedom):
# Line 1988  bool MeshAdapter::probeInterpolationOnDo Line 1988  bool MeshAdapter::probeInterpolationOnDo
1988      return false;      return false;
1989      default:      default:
1990          stringstream temp;          stringstream temp;
1991          temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_target;          temp << "Error - Interpolation On Domain: Dudley does not know anything about function space type " << functionSpaceType_target;
1992          throw FinleyAdapterException(temp.str());          throw DudleyAdapterException(temp.str());
1993      }      }
1994      break;      break;
1995     default:     default:
1996        stringstream temp;        stringstream temp;
1997        temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_source;        temp << "Error - Interpolation On Domain: Dudley does not know anything about function space type " << functionSpaceType_source;
1998        throw FinleyAdapterException(temp.str());        throw DudleyAdapterException(temp.str());
1999        break;        break;
2000     }     }
2001     checkFinleyError();     checkDudleyError();
2002     return false;     return false;
2003  }  }
2004    
# Line 2011  bool MeshAdapter::operator==(const Abstr Line 2011  bool MeshAdapter::operator==(const Abstr
2011  {  {
2012     const MeshAdapter* temp=dynamic_cast<const MeshAdapter*>(&other);     const MeshAdapter* temp=dynamic_cast<const MeshAdapter*>(&other);
2013     if (temp!=0) {     if (temp!=0) {
2014        return (m_finleyMesh==temp->m_finleyMesh);        return (m_dudleyMesh==temp->m_dudleyMesh);
2015     } else {     } else {
2016        return false;        return false;
2017     }     }
# Line 2024  bool MeshAdapter::operator!=(const Abstr Line 2024  bool MeshAdapter::operator!=(const Abstr
2024    
2025  int MeshAdapter::getSystemMatrixTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const  int MeshAdapter::getSystemMatrixTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const
2026  {  {
2027     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
2028     int out=Paso_SystemMatrix_getSystemMatrixTypeId(SystemMatrixAdapter::mapOptionToPaso(solver),SystemMatrixAdapter::mapOptionToPaso(preconditioner), SystemMatrixAdapter::mapOptionToPaso(package),symmetry?1:0, mesh->MPIInfo);     int out=Paso_SystemMatrix_getSystemMatrixTypeId(SystemMatrixAdapter::mapOptionToPaso(solver),SystemMatrixAdapter::mapOptionToPaso(preconditioner), SystemMatrixAdapter::mapOptionToPaso(package),symmetry?1:0, mesh->MPIInfo);
2029     checkPasoError();     checkPasoError();
2030     return out;     return out;
2031  }  }
2032  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
2033  {  {
2034     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
2035     int out=Paso_TransportProblem_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);
2036     checkPasoError();     checkPasoError();
2037     return out;     return out;
# Line 2055  escript::Data MeshAdapter::getSize() con Line 2055  escript::Data MeshAdapter::getSize() con
2055  const int* MeshAdapter::borrowSampleReferenceIDs(int functionSpaceType) const  const int* MeshAdapter::borrowSampleReferenceIDs(int functionSpaceType) const
2056  {  {
2057     int *out = NULL;     int *out = NULL;
2058     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
2059     switch (functionSpaceType) {     switch (functionSpaceType) {
2060     case(Nodes):     case(Nodes):
2061     out=mesh->Nodes->Id;     out=mesh->Nodes->Id;
# Line 2099  const int* MeshAdapter::borrowSampleRefe Line 2099  const int* MeshAdapter::borrowSampleRefe
2099     default:     default:
2100        stringstream temp;        stringstream temp;
2101        temp << "Error - Invalid function space type: " << functionSpaceType << " for domain: " << getDescription();        temp << "Error - Invalid function space type: " << functionSpaceType << " for domain: " << getDescription();
2102        throw FinleyAdapterException(temp.str());        throw DudleyAdapterException(temp.str());
2103        break;        break;
2104     }     }
2105     return out;     return out;
# Line 2107  const int* MeshAdapter::borrowSampleRefe Line 2107  const int* MeshAdapter::borrowSampleRefe
2107  int MeshAdapter::getTagFromSampleNo(int functionSpaceType, int sampleNo) const  int MeshAdapter::getTagFromSampleNo(int functionSpaceType, int sampleNo) const
2108  {  {
2109     int out=0;     int out=0;
2110     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
2111     switch (functionSpaceType) {     switch (functionSpaceType) {
2112     case(Nodes):     case(Nodes):
2113     out=mesh->Nodes->Tag[sampleNo];     out=mesh->Nodes->Tag[sampleNo];
2114     break;     break;
2115     case(ReducedNodes):     case(ReducedNodes):
2116     throw FinleyAdapterException(" Error - ReducedNodes does not support tags.");     throw DudleyAdapterException(" Error - ReducedNodes does not support tags.");
2117     break;     break;
2118     case(Elements):     case(Elements):
2119     out=mesh->Elements->Tag[sampleNo];     out=mesh->Elements->Tag[sampleNo];
# Line 2143  int MeshAdapter::getTagFromSampleNo(int Line 2143  int MeshAdapter::getTagFromSampleNo(int
2143     out=mesh->ContactElements->Tag[sampleNo];     out=mesh->ContactElements->Tag[sampleNo];
2144     break;     break;
2145     case(DegreesOfFreedom):     case(DegreesOfFreedom):
2146     throw FinleyAdapterException(" Error - DegreesOfFreedom does not support tags.");     throw DudleyAdapterException(" Error - DegreesOfFreedom does not support tags.");
2147     break;     break;
2148     case(ReducedDegreesOfFreedom):     case(ReducedDegreesOfFreedom):
2149     throw FinleyAdapterException(" Error - ReducedDegreesOfFreedom does not support tags.");     throw DudleyAdapterException(" Error - ReducedDegreesOfFreedom does not support tags.");
2150     break;     break;
2151     default:     default:
2152        stringstream temp;        stringstream temp;
2153        temp << "Error - Invalid function space type: " << functionSpaceType << " for domain: " << getDescription();        temp << "Error - Invalid function space type: " << functionSpaceType << " for domain: " << getDescription();
2154        throw FinleyAdapterException(temp.str());        throw DudleyAdapterException(temp.str());
2155        break;        break;
2156     }     }
2157     return out;     return out;
# Line 2160  int MeshAdapter::getTagFromSampleNo(int Line 2160  int MeshAdapter::getTagFromSampleNo(int
2160    
2161  void MeshAdapter::setTags(const int functionSpaceType, const int newTag, const escript::Data& mask) const  void MeshAdapter::setTags(const int functionSpaceType, const int newTag, const escript::Data& mask) const
2162  {  {
2163     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
2164     escriptDataC tmp=mask.getDataC();     escriptDataC tmp=mask.getDataC();
2165     switch(functionSpaceType) {     switch(functionSpaceType) {
2166     case(Nodes):     case(Nodes):
2167     Finley_NodeFile_setTags(mesh->Nodes,newTag,&tmp);     Dudley_NodeFile_setTags(mesh->Nodes,newTag,&tmp);
2168     break;     break;
2169     case(ReducedNodes):     case(ReducedNodes):
2170     throw FinleyAdapterException("Error - ReducedNodes does not support tags");     throw DudleyAdapterException("Error - ReducedNodes does not support tags");
2171     break;     break;
2172     case(DegreesOfFreedom):     case(DegreesOfFreedom):
2173     throw FinleyAdapterException("Error - DegreesOfFreedom does not support tags");     throw DudleyAdapterException("Error - DegreesOfFreedom does not support tags");
2174     break;     break;
2175     case(ReducedDegreesOfFreedom):     case(ReducedDegreesOfFreedom):
2176     throw FinleyAdapterException("Error - ReducedDegreesOfFreedom does not support tags");     throw DudleyAdapterException("Error - ReducedDegreesOfFreedom does not support tags");
2177     break;     break;
2178     case(Elements):     case(Elements):
2179     Finley_ElementFile_setTags(mesh->Elements,newTag,&tmp);     Dudley_ElementFile_setTags(mesh->Elements,newTag,&tmp);
2180     break;     break;
2181     case(ReducedElements):     case(ReducedElements):
2182     Finley_ElementFile_setTags(mesh->Elements,newTag,&tmp);     Dudley_ElementFile_setTags(mesh->Elements,newTag,&tmp);
2183     break;     break;
2184     case(FaceElements):     case(FaceElements):
2185     Finley_ElementFile_setTags(mesh->FaceElements,newTag,&tmp);     Dudley_ElementFile_setTags(mesh->FaceElements,newTag,&tmp);
2186     break;     break;
2187     case(ReducedFaceElements):     case(ReducedFaceElements):
2188     Finley_ElementFile_setTags(mesh->FaceElements,newTag,&tmp);     Dudley_ElementFile_setTags(mesh->FaceElements,newTag,&tmp);
2189     break;     break;
2190     case(Points):     case(Points):
2191     Finley_ElementFile_setTags(mesh->Points,newTag,&tmp);     Dudley_ElementFile_setTags(mesh->Points,newTag,&tmp);
2192     break;     break;
2193     case(ContactElementsZero):     case(ContactElementsZero):
2194     Finley_ElementFile_setTags(mesh->ContactElements,newTag,&tmp);     Dudley_ElementFile_setTags(mesh->ContactElements,newTag,&tmp);
2195     break;     break;
2196     case(ReducedContactElementsZero):     case(ReducedContactElementsZero):
2197     Finley_ElementFile_setTags(mesh->ContactElements,newTag,&tmp);     Dudley_ElementFile_setTags(mesh->ContactElements,newTag,&tmp);
2198     break;     break;
2199     case(ContactElementsOne):     case(ContactElementsOne):
2200     Finley_ElementFile_setTags(mesh->ContactElements,newTag,&tmp);     Dudley_ElementFile_setTags(mesh->ContactElements,newTag,&tmp);
2201     break;     break;
2202     case(ReducedContactElementsOne):     case(ReducedContactElementsOne):
2203     Finley_ElementFile_setTags(mesh->ContactElements,newTag,&tmp);     Dudley_ElementFile_setTags(mesh->ContactElements,newTag,&tmp);
2204     break;     break;
2205     default:     default:
2206        stringstream temp;        stringstream temp;
2207        temp << "Error - Finley does not know anything about function space type " << functionSpaceType;        temp << "Error - Dudley does not know anything about function space type " << functionSpaceType;
2208        throw FinleyAdapterException(temp.str());        throw DudleyAdapterException(temp.str());
2209     }     }
2210     checkFinleyError();     checkDudleyError();
2211     return;     return;
2212  }  }
2213    
2214  void MeshAdapter::setTagMap(const string& name,  int tag)  void MeshAdapter::setTagMap(const string& name,  int tag)
2215  {  {
2216     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
2217     Finley_Mesh_addTagMap(mesh, name.c_str(),tag);     Dudley_Mesh_addTagMap(mesh, name.c_str(),tag);
2218     checkPasoError();     checkPasoError();
2219     // throwStandardException("MeshAdapter::set TagMap is not implemented.");     // throwStandardException("MeshAdapter::set TagMap is not implemented.");
2220  }  }
2221    
2222  int MeshAdapter::getTag(const string& name) const  int MeshAdapter::getTag(const string& name) const
2223  {  {
2224     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
2225     int tag=0;     int tag=0;
2226     tag=Finley_Mesh_getTag(mesh, name.c_str());     tag=Dudley_Mesh_getTag(mesh, name.c_str());
2227     checkPasoError();     checkPasoError();
2228     // throwStandardException("MeshAdapter::getTag is not implemented.");     // throwStandardException("MeshAdapter::getTag is not implemented.");
2229     return tag;     return tag;
# Line 2231  int MeshAdapter::getTag(const string& na Line 2231  int MeshAdapter::getTag(const string& na
2231    
2232  bool MeshAdapter::isValidTagName(const string& name) const  bool MeshAdapter::isValidTagName(const string& name) const
2233  {  {
2234     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
2235     return Finley_Mesh_isValidTagName(mesh,name.c_str());     return Dudley_Mesh_isValidTagName(mesh,name.c_str());
2236  }  }
2237    
2238  string MeshAdapter::showTagNames() const  string MeshAdapter::showTagNames() const
2239  {  {
2240     stringstream temp;     stringstream temp;
2241     Finley_Mesh* mesh=m_finleyMesh.get();     Dudley_Mesh* mesh=m_dudleyMesh.get();
2242     Finley_TagMap* tag_map=mesh->TagMap;     Dudley_TagMap* tag_map=mesh->TagMap;
2243     while (tag_map) {     while (tag_map) {
2244        temp << tag_map->name;        temp << tag_map->name;
2245        tag_map=tag_map->next;        tag_map=tag_map->next;
# Line 2250  string MeshAdapter::showTagNames() const Line 2250  string MeshAdapter::showTagNames() const
2250    
2251  int MeshAdapter::getNumberOfTagsInUse(int functionSpaceCode) const  int MeshAdapter::getNumberOfTagsInUse(int functionSpaceCode) const
2252  {  {
2253    Finley_Mesh* mesh=m_finleyMesh.get();    Dudley_Mesh* mesh=m_dudleyMesh.get();
2254    dim_t numTags=0;    dim_t numTags=0;
2255    switch(functionSpaceCode) {    switch(functionSpaceCode) {
2256     case(Nodes):     case(Nodes):
2257            numTags=mesh->Nodes->numTagsInUse;            numTags=mesh->Nodes->numTagsInUse;
2258            break;            break;
2259     case(ReducedNodes):     case(ReducedNodes):
2260            throw FinleyAdapterException("Error - ReducedNodes does not support tags");            throw DudleyAdapterException("Error - ReducedNodes does not support tags");
2261            break;            break;
2262     case(DegreesOfFreedom):     case(DegreesOfFreedom):
2263            throw FinleyAdapterException("Error - DegreesOfFreedom does not support tags");            throw DudleyAdapterException("Error - DegreesOfFreedom does not support tags");
2264            break;            break;
2265     case(ReducedDegreesOfFreedom):     case(ReducedDegreesOfFreedom):
2266            throw FinleyAdapterException("Error - ReducedDegreesOfFreedom does not support tags");            throw DudleyAdapterException("Error - ReducedDegreesOfFreedom does not support tags");
2267            break;            break;
2268     case(Elements):     case(Elements):
2269     case(ReducedElements):     case(ReducedElements):
# Line 2284  int MeshAdapter::getNumberOfTagsInUse(in Line 2284  int MeshAdapter::getNumberOfTagsInUse(in
2284            break;            break;
2285     default:     default:
2286        stringstream temp;        stringstream temp;
2287        temp << "Error - Finley does not know anything about function space type " << functionSpaceCode;        temp << "Error - Dudley does not know anything about function space type " << functionSpaceCode;
2288        throw FinleyAdapterException(temp.str());        throw DudleyAdapterException(temp.str());
2289    }    }
2290    return numTags;    return numTags;
2291  }  }
2292    
2293  const int* MeshAdapter::borrowListOfTagsInUse(int functionSpaceCode) const  const int* MeshAdapter::borrowListOfTagsInUse(int functionSpaceCode) const
2294  {  {
2295    Finley_Mesh* mesh=m_finleyMesh.get();    Dudley_Mesh* mesh=m_dudleyMesh.get();
2296    index_t* tags=NULL;    index_t* tags=NULL;
2297    switch(functionSpaceCode) {    switch(functionSpaceCode) {
2298     case(Nodes):     case(Nodes):
2299            tags=mesh->Nodes->tagsInUse;            tags=mesh->Nodes->tagsInUse;
2300            break;            break;
2301     case(ReducedNodes):     case(ReducedNodes):
2302            throw FinleyAdapterException("Error - ReducedNodes does not support tags");            throw DudleyAdapterException("Error - ReducedNodes does not support tags");
2303            break;            break;
2304     case(DegreesOfFreedom):     case(DegreesOfFreedom):
2305            throw FinleyAdapterException("Error - DegreesOfFreedom does not support tags");            throw DudleyAdapterException("Error - DegreesOfFreedom does not support tags");
2306            break;            break;
2307     case(ReducedDegreesOfFreedom):     case(ReducedDegreesOfFreedom):
2308            throw FinleyAdapterException("Error - ReducedDegreesOfFreedom does not support tags");            throw DudleyAdapterException("Error - ReducedDegreesOfFreedom does not support tags");
2309            break;            break;
2310     case(Elements):     case(Elements):
2311     case(ReducedElements):     case(ReducedElements):
# Line 2326  const int* MeshAdapter::borrowListOfTags Line 2326  const int* MeshAdapter::borrowListOfTags
2326            break;            break;
2327     default:     default:
2328        stringstream temp;        stringstream temp;
2329        temp << "Error - Finley does not know anything about function space type " << functionSpaceCode;        temp << "Error - Dudley does not know anything about function space type " << functionSpaceCode;
2330        throw FinleyAdapterException(temp.str());        throw DudleyAdapterException(temp.str());
2331    }    }
2332    return tags;    return tags;
2333  }  }
# Line 2358  bool MeshAdapter::canTag(int functionSpa Line 2358  bool MeshAdapter::canTag(int functionSpa
2358    
2359  AbstractDomain::StatusType MeshAdapter::getStatus() const  AbstractDomain::StatusType MeshAdapter::getStatus() const
2360  {  {
2361    Finley_Mesh* mesh=m_finleyMesh.get();    Dudley_Mesh* mesh=m_dudleyMesh.get();
2362    return Finley_Mesh_getStatus(mesh);    return Dudley_Mesh_getStatus(mesh);
2363  }  }
2364    
2365  int MeshAdapter::getApproximationOrder(const int functionSpaceCode) const  int MeshAdapter::getApproximationOrder(const int functionSpaceCode) const
2366  {  {
2367        
2368    Finley_Mesh* mesh=m_finleyMesh.get();    Dudley_Mesh* mesh=m_dudleyMesh.get();
2369    int order =-1;    int order =-1;
2370    switch(functionSpaceCode) {    switch(functionSpaceCode) {
2371     case(Nodes):     case(Nodes):
# Line 2391  int MeshAdapter::getApproximationOrder(c Line 2391  int MeshAdapter::getApproximationOrder(c
2391            break;            break;
2392     default:     default:
2393        stringstream temp;        stringstream temp;
2394        temp << "Error - Finley does not know anything about function space type " << functionSpaceCode;        temp << "Error - Dudley does not know anything about function space type " << functionSpaceCode;
2395        throw FinleyAdapterException(temp.str());        throw DudleyAdapterException(temp.str());
2396    }    }
2397    return order;    return order;
2398  }  }
2399    
2400  ReferenceElementSetWrapper::ReferenceElementSetWrapper(ElementTypeId id, index_t order, index_t reducedOrder)  ReferenceElementSetWrapper::ReferenceElementSetWrapper(ElementTypeId id, index_t order, index_t reducedOrder)
2401  {  {
2402    m_refSet = Finley_ReferenceElementSet_alloc(id, order, reducedOrder);    m_refSet = Dudley_ReferenceElementSet_alloc(id, order, reducedOrder);
2403  }  }
2404    
2405  ReferenceElementSetWrapper::~ReferenceElementSetWrapper()  ReferenceElementSetWrapper::~ReferenceElementSetWrapper()
2406  {  {
2407    Finley_ReferenceElementSet_dealloc(m_refSet);    Dudley_ReferenceElementSet_dealloc(m_refSet);
2408  }  }
2409    
2410  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.3082  
changed lines
  Added in v.3086

  ViewVC Help
Powered by ViewVC 1.1.26