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

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

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

trunk/esys2/finley/src/CPPAdapter/MeshAdapter.cpp revision 97 by jgs, Tue Dec 14 05:39:33 2004 UTC trunk/finley/src/CPPAdapter/MeshAdapter.cpp revision 472 by jgs, Fri Jan 27 01:50:59 2006 UTC
# Line 12  Line 12 
12   *                                                                            *   *                                                                            *
13   ******************************************************************************   ******************************************************************************
14  */  */
15  extern "C" {  
16  #include "finley/finleyC/Finley.h"  #include "MeshAdapter.h"
 #include "finley/finleyC/Assemble.h"  
 #include "finley/finleyC/Mesh.h"  
 #include "finley/finleyC/Finley.h"  
 #include "finley/finleyC/System.h"  
 }  
 #include "finley/CPPAdapter/SystemMatrixAdapter.h"  
 #include "finley/CPPAdapter/MeshAdapter.h"  
 #include "finley/CPPAdapter/FinleyError.h"  
 #include "finley/CPPAdapter/FinleyAdapterException.h"  
 #include "escript/Data/FunctionSpaceFactory.h"  
 #include "escript/Data/Data.h"  
 #include "escript/Data/DataArrayView.h"  
 #include "escript/Data/FunctionSpace.h"  
 #include "escript/Data/DataFactory.h"  
 #include <iostream>  
 #include <vector>  
 #include <sstream>  
17    
18  using namespace std;  using namespace std;
19  using namespace escript;  using namespace escript;
20    
21  namespace finley {  namespace finley {
22    
 struct null_deleter  
 {  
   void operator()(void const *ptr) const  
   {  
   }  
 };  
   
23  //  //
24  // define the statics  // define the static constants
25  MeshAdapter::FunctionSpaceNamesMapType MeshAdapter::m_functionSpaceTypeNames;  MeshAdapter::FunctionSpaceNamesMapType MeshAdapter::m_functionSpaceTypeNames;
26  const int MeshAdapter::DegreesOfFreedom=FINLEY_DEGREES_OF_FREEDOM;  const int MeshAdapter::DegreesOfFreedom=FINLEY_DEGREES_OF_FREEDOM;
27  const int MeshAdapter::ReducedDegreesOfFreedom=FINLEY_REDUCED_DEGREES_OF_FREEDOM;  const int MeshAdapter::ReducedDegreesOfFreedom=FINLEY_REDUCED_DEGREES_OF_FREEDOM;
# Line 64  MeshAdapter::MeshAdapter(Finley_Mesh* fi Line 40  MeshAdapter::MeshAdapter(Finley_Mesh* fi
40    // for us.    // for us.
41    m_finleyMesh.reset(finleyMesh,null_deleter());    m_finleyMesh.reset(finleyMesh,null_deleter());
42  }  }
43    
44  //  //
45  // The copy constructor should just increment the use count  // The copy constructor should just increment the use count
46  MeshAdapter::MeshAdapter(const MeshAdapter& in):  MeshAdapter::MeshAdapter(const MeshAdapter& in):
# Line 150  int MeshAdapter::getContinuousFunctionCo Line 127  int MeshAdapter::getContinuousFunctionCo
127  {  {
128    return Nodes;    return Nodes;
129  }  }
130    
131  int MeshAdapter::getFunctionCode() const  int MeshAdapter::getFunctionCode() const
132  {  {
133    return Elements;    return Elements;
134  }  }
135    
136  int MeshAdapter::getFunctionOnBoundaryCode() const  int MeshAdapter::getFunctionOnBoundaryCode() const
137  {  {
138    return FaceElements;    return FaceElements;
139  }  }
140    
141  int MeshAdapter::getFunctionOnContactZeroCode() const  int MeshAdapter::getFunctionOnContactZeroCode() const
142  {  {
143    return ContactElementsZero;    return ContactElementsZero;
144  }  }
145    
146  int MeshAdapter::getFunctionOnContactOneCode() const  int MeshAdapter::getFunctionOnContactOneCode() const
147  {  {
148    return ContactElementsOne;    return ContactElementsOne;
# Line 171  int MeshAdapter::getSolutionCode() const Line 152  int MeshAdapter::getSolutionCode() const
152  {  {
153    return DegreesOfFreedom;    return DegreesOfFreedom;
154  }  }
155    
156  int MeshAdapter::getReducedSolutionCode() const  int MeshAdapter::getReducedSolutionCode() const
157  {  {
158    return ReducedDegreesOfFreedom;    return ReducedDegreesOfFreedom;
159  }  }
160    
161  int MeshAdapter::getDiracDeltaFunctionCode() const  int MeshAdapter::getDiracDeltaFunctionCode() const
162  {  {
163    return Points;    return Points;
164  }  }
165    
 int MeshAdapter::getTagFromSampleNo(int functionSpaceType, int sampleNo) const  
 {  
   //  
   // It is assumed the sampleNo has been checked  
   // before calling this function.  
   int* tagList;  
   int numTags;  
   getTagList(functionSpaceType, &tagList, &numTags);  
   return tagList[sampleNo];  
 }  
   
166  //  //
167  // returns a pointer to the tag list of samples of functionSpaceType  // returns a pointer to the tag list of samples of functionSpaceType
168  //  //
# Line 251  void MeshAdapter::getTagList(int functio Line 223  void MeshAdapter::getTagList(int functio
223      break;      break;
224    default:    default:
225      stringstream temp;      stringstream temp;
226      temp << "Error - Invalid function space type: "      temp << "Error - Invalid function space type: " << functionSpaceType << " for domain: " << getDescription();
      << functionSpaceType << " for domain: " << getDescription();  
227      throw FinleyAdapterException(temp.str());      throw FinleyAdapterException(temp.str());
228      break;      break;
229    }    }
230      if (*tagList==NULL) {
231        stringstream temp;
232        temp << "Error - no tags available for " << functionSpaceType << " for domain: " << getDescription();
233        throw FinleyAdapterException(temp.str());
234      }
235      return;
236    }
237    
238    //
239    // returns a pointer to the reference no list of samples of functionSpaceType
240    //
241    void MeshAdapter::getReferenceNoList(int functionSpaceType, int** referenceNoList,
242                     int* numReferenceNo) const
243    {
244      *referenceNoList=NULL;
245      *numReferenceNo=0;
246      Finley_Mesh* mesh=m_finleyMesh.get();
247      switch (functionSpaceType) {
248      case(Nodes):
249        if (mesh->Nodes!=NULL) {
250          *referenceNoList=mesh->Nodes->Id;
251          *numReferenceNo=mesh->Nodes->numNodes;
252        }
253        break;
254      case(Elements):
255        if (mesh->Elements!=NULL) {
256          *referenceNoList=mesh->Elements->Id;
257          *numReferenceNo=mesh->Elements->numElements;
258        }
259        break;
260      case(FaceElements):
261        if (mesh->FaceElements!=NULL) {
262          *referenceNoList=mesh->FaceElements->Id;
263          *numReferenceNo=mesh->FaceElements->numElements;
264        }
265        break;
266      case(Points):
267        if (mesh->Points!=NULL) {
268          *referenceNoList=mesh->Points->Id;
269          *numReferenceNo=mesh->Points->numElements;
270        }
271        break;
272      case(ContactElementsZero):
273        if (mesh->ContactElements!=NULL) {
274          *referenceNoList=mesh->ContactElements->Id;
275          *numReferenceNo=mesh->ContactElements->numElements;
276        }
277        break;
278      case(ContactElementsOne):
279        if (mesh->ContactElements!=NULL) {
280          *referenceNoList=mesh->ContactElements->Id;
281          *numReferenceNo=mesh->ContactElements->numElements;
282        }
283        break;
284      case(DegreesOfFreedom):
285        if (mesh->Nodes!=NULL) {
286          *referenceNoList=NULL;
287          *numReferenceNo=0;
288        }
289        break;
290      case(ReducedDegreesOfFreedom):
291        if (mesh->Nodes!=NULL) {
292          *referenceNoList=NULL;
293          *numReferenceNo=0;
294        }
295        break;
296      default:
297        stringstream temp;
298        temp << "Error - Invalid function space type: " << functionSpaceType << " for domain: " << getDescription();
299        throw FinleyAdapterException(temp.str());
300        break;
301      }
302      if (*referenceNoList==NULL) {
303        stringstream temp;
304        temp << "Error - reference number list available for " << functionSpaceType << " for domain: " << getDescription();
305        throw FinleyAdapterException(temp.str());
306      }
307    return;    return;
308  }  }
309    
# Line 268  int MeshAdapter::getDim() const Line 316  int MeshAdapter::getDim() const
316    checkFinleyError();    checkFinleyError();
317    return numDim;    return numDim;
318  }  }
319    
320  //  //
321  // return the number of data points per sample and the number of samples  // return the number of data points per sample and the number of samples
322  // needed to represent data on a parts of the mesh.  // needed to represent data on a parts of the mesh.
# Line 326  pair<int,int> MeshAdapter::getDataShape( Line 375  pair<int,int> MeshAdapter::getDataShape(
375             break;             break;
376        default:        default:
377          stringstream temp;          stringstream temp;
378          temp << "Error - Invalid function space type: "          temp << "Error - Invalid function space type: " << functionSpaceCode << " for domain: " << getDescription();
          << functionSpaceCode << " for domain: " << getDescription();  
379          throw FinleyAdapterException(temp.str());          throw FinleyAdapterException(temp.str());
380          break;          break;
381        }        }
382        return pair<int,int>(numDataPointsPerSample,numSamples);        return pair<int,int>(numDataPointsPerSample,numSamples);
383  }  }
384    
385  //  //
386  // adds linear PDE of second order into a given stiffness matrix and right hand side:  // adds linear PDE of second order into a given stiffness matrix and right hand side:
387  //  //
# Line 343  void MeshAdapter::addPDEToSystem( Line 392  void MeshAdapter::addPDEToSystem(
392                       const Data& d_contact,const Data& y_contact) const                       const Data& d_contact,const Data& y_contact) const
393  {  {
394     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
395     Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,mat.getFinley_SystemMatrix(),&(rhs.getDataC()),     Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,mat.getPaso_SystemMatrix(),&(rhs.getDataC()),
396                         &(A.getDataC()),&(B.getDataC()),&(C.getDataC()),&(D.getDataC()),&(X.getDataC()),&(Y.getDataC()));                         &(A.getDataC()),&(B.getDataC()),&(C.getDataC()),&(D.getDataC()),&(X.getDataC()),&(Y.getDataC()));
397     checkFinleyError();     checkFinleyError();
398     Finley_Assemble_RobinCondition(mesh->Nodes,mesh->FaceElements,     Finley_Assemble_RobinCondition(mesh->Nodes,mesh->FaceElements,
399                    mat.getFinley_SystemMatrix(),                    mat.getPaso_SystemMatrix(),
400                    &(rhs.getDataC()),                    &(rhs.getDataC()),
401                                    &(d.getDataC()),&(y.getDataC()),                                    &(d.getDataC()),&(y.getDataC()),
402                                    Finley_Assemble_handelShapeMissMatch_Mean_out);                                    Finley_Assemble_handelShapeMissMatch_Mean_out);
403     checkFinleyError();     checkFinleyError();
404     Finley_Assemble_RobinCondition(mesh->Nodes,mesh->FaceElements,     Finley_Assemble_RobinCondition(mesh->Nodes,mesh->ContactElements,
405                    mat.getFinley_SystemMatrix(),                    mat.getPaso_SystemMatrix(),
406                    &(rhs.getDataC()),                    &(rhs.getDataC()),
407                                    &(d_contact.getDataC()),                                    &(d_contact.getDataC()),
408                    &(y_contact.getDataC()),                    &(y_contact.getDataC()),
409                                    Finley_Assemble_handelShapeMissMatch_Step_out);                                    Finley_Assemble_handelShapeMissMatch_Step_out);
410     checkFinleyError();     checkFinleyError();
411  }  }
412    
413  //  //
414  // adds linear PDE of second order into the right hand side only  // adds linear PDE of second order into the right hand side only
415  //  //
# Line 367  void MeshAdapter::addPDEToRHS( Data& rhs Line 417  void MeshAdapter::addPDEToRHS( Data& rhs
417                       const  Data& X,const  Data& Y, const Data& y, const Data& y_contact) const                       const  Data& X,const  Data& Y, const Data& y, const Data& y_contact) const
418  {  {
419     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
420     Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,0,&(rhs.getDataC()),0,0,0,0,&(X.getDataC()),&(Y.getDataC()));  
421       // Finley_Assemble_PDE_RHS(mesh->Nodes,mesh->Elements,&(rhs.getDataC()),&(X.getDataC()),&(Y.getDataC()));
422       Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,0,&(rhs.getDataC()),0,0,0,0,&(X.getDataC()),&(Y.getDataC()));
423     checkFinleyError();     checkFinleyError();
424     Finley_Assemble_RobinCondition(mesh->Nodes,mesh->FaceElements,0,&(rhs.getDataC()),0,&(y.getDataC()),  
425                                    Finley_Assemble_handelShapeMissMatch_Mean_out);     // Finley_Assemble_RobinCondition_RHS(mesh->Nodes,mesh->FaceElements,&(rhs.getDataC()),&(y.getDataC()),Finley_Assemble_handelShapeMissMatch_Mean_out);
426  // cout << "Calling :addPDEToRHS." << endl;     Finley_Assemble_RobinCondition(mesh->Nodes,mesh->FaceElements,0,&(rhs.getDataC()),0,&(y.getDataC()),Finley_Assemble_handelShapeMissMatch_Mean_out);
427    
428     checkFinleyError();     checkFinleyError();
429     Finley_Assemble_RobinCondition(mesh->Nodes,mesh->FaceElements,0,&(rhs.getDataC()),0,&(y_contact.getDataC()),     Finley_Assemble_RobinCondition(mesh->Nodes,mesh->ContactElements,0,&(rhs.getDataC()),0,&(y_contact.getDataC()),Finley_Assemble_handelShapeMissMatch_Step_out);
430                                    Finley_Assemble_handelShapeMissMatch_Step_out);     // Finley_Assemble_RobinCondition_RHS(mesh->Nodes,mesh->ContactElements,&(rhs.getDataC()),&(y_contact.getDataC()),Finley_Assemble_handelShapeMissMatch_Step_out);
 // cout << "Calling :addPDEToRHS." << endl;  
431     checkFinleyError();     checkFinleyError();
432  }  }
433    
434  //  //
435  // interpolates data between different function spaces:  // interpolates data between different function spaces:
436  //  //
# Line 415  void MeshAdapter::interpolateOnDomain(Da Line 468  void MeshAdapter::interpolateOnDomain(Da
468                 Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&(in.getDataC()),&(target.getDataC()));                 Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&(in.getDataC()),&(target.getDataC()));
469                 break;                 break;
470             default:             default:
471                 Finley_ErrorCode=TYPE_ERROR;                 stringstream temp;
472                 sprintf(Finley_ErrorMsg,"Interpolation on Domain: Finley does not know anything about function space type %d",target.getFunctionSpace().getTypeCode());                 temp << "Error - Interpolation on Domain: Finley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();
473                   throw FinleyAdapterException(temp.str());
474                 break;                 break;
475          }          }
476          break;          break;
# Line 424  void MeshAdapter::interpolateOnDomain(Da Line 478  void MeshAdapter::interpolateOnDomain(Da
478          if (target.getFunctionSpace().getTypeCode()==Elements) {          if (target.getFunctionSpace().getTypeCode()==Elements) {
479             Finley_Assemble_CopyElementData(mesh->Elements,&(target.getDataC()),&(in.getDataC()));             Finley_Assemble_CopyElementData(mesh->Elements,&(target.getDataC()),&(in.getDataC()));
480          } else {          } else {
481             Finley_ErrorCode=TYPE_ERROR;             throw FinleyAdapterException("Error - No interpolation with data on elements possible.");
            sprintf(Finley_ErrorMsg,"No interpolation with data on elements possible.");  
482          }          }
483          break;          break;
484       case(FaceElements):       case(FaceElements):
485          if (target.getFunctionSpace().getTypeCode()==FaceElements) {          if (target.getFunctionSpace().getTypeCode()==FaceElements) {
486             Finley_Assemble_CopyElementData(mesh->FaceElements,&(target.getDataC()),&(in.getDataC()));             Finley_Assemble_CopyElementData(mesh->FaceElements,&(target.getDataC()),&(in.getDataC()));
487          } else {          } else {
488             Finley_ErrorCode=TYPE_ERROR;             throw FinleyAdapterException("Error - No interpolation with data on face elements possible.");
            sprintf(Finley_ErrorMsg,"No interpolation with data on face elements possible.");  
489             break;             break;
490         }         }
491       case(Points):       case(Points):
492          if (target.getFunctionSpace().getTypeCode()==Points) {          if (target.getFunctionSpace().getTypeCode()==Points) {
493             Finley_Assemble_CopyElementData(mesh->Points,&(target.getDataC()),&(in.getDataC()));             Finley_Assemble_CopyElementData(mesh->Points,&(target.getDataC()),&(in.getDataC()));
494          } else {          } else {
495             Finley_ErrorCode=TYPE_ERROR;             throw FinleyAdapterException("Error - No interpolation with data on points possible.");
            sprintf(Finley_ErrorMsg,"No interpolation with data on points possible.");  
496             break;             break;
497          }          }
498          break;          break;
# Line 450  void MeshAdapter::interpolateOnDomain(Da Line 501  void MeshAdapter::interpolateOnDomain(Da
501          if (target.getFunctionSpace().getTypeCode()==ContactElementsZero || target.getFunctionSpace().getTypeCode()==ContactElementsOne) {          if (target.getFunctionSpace().getTypeCode()==ContactElementsZero || target.getFunctionSpace().getTypeCode()==ContactElementsOne) {
502             Finley_Assemble_CopyElementData(mesh->ContactElements,&(target.getDataC()),&(in.getDataC()));             Finley_Assemble_CopyElementData(mesh->ContactElements,&(target.getDataC()),&(in.getDataC()));
503          } else {          } else {
504             Finley_ErrorCode=TYPE_ERROR;             throw FinleyAdapterException("Error - No interpolation with data on contact elements possible.");
            sprintf(Finley_ErrorMsg,"No interpolation with data on contact elements possible.");  
505             break;             break;
506          }          }
507          break;          break;
# Line 476  void MeshAdapter::interpolateOnDomain(Da Line 526  void MeshAdapter::interpolateOnDomain(Da
526                Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&(in.getDataC()),&(target.getDataC()));                Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&(in.getDataC()),&(target.getDataC()));
527               break;               break;
528             default:             default:
529               Finley_ErrorCode=TYPE_ERROR;               stringstream temp;
530               sprintf(Finley_ErrorMsg,"Interpolation On Domain: Finley does not know anything about function space type %d",target.getFunctionSpace().getTypeCode());               temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();
531                 throw FinleyAdapterException(temp.str());
532               break;               break;
533          }          }
534          break;          break;
535       case(ReducedDegreesOfFreedom):       case(ReducedDegreesOfFreedom):
536         switch(target.getFunctionSpace().getTypeCode()) {         switch(target.getFunctionSpace().getTypeCode()) {
537            case(ReducedDegreesOfFreedom):            case(ReducedDegreesOfFreedom):
           case(Nodes):  
538               Finley_Assemble_CopyNodalData(mesh->Nodes,&(target.getDataC()),&(in.getDataC()));               Finley_Assemble_CopyNodalData(mesh->Nodes,&(target.getDataC()),&(in.getDataC()));
539               break;               break;
540            case(Elements):            case(Elements):
# Line 500  void MeshAdapter::interpolateOnDomain(Da Line 550  void MeshAdapter::interpolateOnDomain(Da
550            case(ContactElementsOne):            case(ContactElementsOne):
551               Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&(in.getDataC()),&(target.getDataC()));               Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&(in.getDataC()),&(target.getDataC()));
552               break;               break;
553              case(Nodes):
554                 throw FinleyAdapterException("Error - Finley does not support interpolation from reduced degrees of freedom to mesh nodes.");
555                 break;
556            case(DegreesOfFreedom):            case(DegreesOfFreedom):
557               Finley_ErrorCode=TYPE_ERROR;               throw FinleyAdapterException("Error - Finley does not support interpolation from reduced degrees of freedom to degrees of freedom");
              sprintf(Finley_ErrorMsg,"Finley does not support interpolation from reduced degrees of freedom to degrees of freedom");  
558               break;               break;
559            default:            default:
560               Finley_ErrorCode=TYPE_ERROR;               stringstream temp;
561               sprintf(Finley_ErrorMsg,"Interpolation On Domain: Finley does not know anything about function space type %d",target.getFunctionSpace().getTypeCode());               temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();
562                 throw FinleyAdapterException(temp.str());
563               break;               break;
564         }         }
565         break;         break;
566       default:       default:
567          Finley_ErrorCode=TYPE_ERROR;          stringstream temp;
568          sprintf(Finley_ErrorMsg,"Interpolation On Domain: Finley does not know anything about function space type %d",in.getFunctionSpace().getTypeCode());          temp << "Error - Interpolation On Domain: Finley does not know anything about function space type %d" << in.getFunctionSpace().getTypeCode();
569            throw FinleyAdapterException(temp.str());
570          break;          break;
571    }    }
572    checkFinleyError();    checkFinleyError();
# Line 538  void MeshAdapter::setToX(Data& arg) cons Line 592  void MeshAdapter::setToX(Data& arg) cons
592    }    }
593    checkFinleyError();    checkFinleyError();
594  }  }
595    
596  //  //
597  // return the normal vectors at the location of data points as a Data object:  // return the normal vectors at the location of data points as a Data object:
598  //  //
# Line 549  void MeshAdapter::setToNormal(Data& norm Line 604  void MeshAdapter::setToNormal(Data& norm
604    Finley_Mesh* mesh=m_finleyMesh.get();    Finley_Mesh* mesh=m_finleyMesh.get();
605    switch(normal.getFunctionSpace().getTypeCode()) {    switch(normal.getFunctionSpace().getTypeCode()) {
606      case(Nodes):      case(Nodes):
607        Finley_ErrorCode=TYPE_ERROR;        throw FinleyAdapterException("Error - Finley does not support surface normal vectors for nodes");
       sprintf(Finley_ErrorMsg,"Finley does not support surface normal vectors for nodes");  
608        break;        break;
609      case(Elements):      case(Elements):
610        Finley_ErrorCode=TYPE_ERROR;        throw FinleyAdapterException("Error - Finley does not support surface normal vectors for elements");
       sprintf(Finley_ErrorMsg,"Finley does not support surface normal vectors for elements");  
611        break;        break;
612      case (FaceElements):      case (FaceElements):
613        Finley_Assemble_setNormal(mesh->Nodes,mesh->FaceElements,&(normal.getDataC()));        Finley_Assemble_setNormal(mesh->Nodes,mesh->FaceElements,&(normal.getDataC()));
614        break;        break;
615      case(Points):      case(Points):
616        Finley_ErrorCode=TYPE_ERROR;        throw FinleyAdapterException("Error - Finley does not support surface normal vectors for point elements");
       sprintf(Finley_ErrorMsg,"Finley does not support surface normal vectors for point elements");  
617        break;        break;
618      case (ContactElementsOne):      case (ContactElementsOne):
619      case (ContactElementsZero):      case (ContactElementsZero):
620        Finley_Assemble_setNormal(mesh->Nodes,mesh->ContactElements,&(normal.getDataC()));        Finley_Assemble_setNormal(mesh->Nodes,mesh->ContactElements,&(normal.getDataC()));
621        break;        break;
622      case(DegreesOfFreedom):      case(DegreesOfFreedom):
623        Finley_ErrorCode=TYPE_ERROR;        throw FinleyAdapterException("Error - Finley does not support surface normal vectors for degrees of freedom.");
       sprintf(Finley_ErrorMsg,"Finley does not support surface normal vectors for degrees of freedom.");  
624        break;        break;
625      case(ReducedDegreesOfFreedom):      case(ReducedDegreesOfFreedom):
626        Finley_ErrorCode=TYPE_ERROR;        throw FinleyAdapterException("Error - Finley does not support surface normal vectors for reduced degrees of freedom.");
       sprintf(Finley_ErrorMsg,"Finley does not support surface normal vectors for reduced degrees of freedom.");  
627        break;        break;
628      default:      default:
629        Finley_ErrorCode=TYPE_ERROR;        stringstream temp;
630        sprintf(Finley_ErrorMsg,"Normal Vectors: Finley does not know anything about function space type %d",normal.getFunctionSpace().getTypeCode());        temp << "Error - Normal Vectors: Finley does not know anything about function space type " << normal.getFunctionSpace().getTypeCode();
631          throw FinleyAdapterException(temp.str());
632        break;        break;
633    }    }
634    checkFinleyError();    checkFinleyError();
635  }  }
636    
637  //  //
638  // interpolates data to other domain:  // interpolates data to other domain:
639  //  //
# Line 591  void MeshAdapter::interpolateACross(Data Line 643  void MeshAdapter::interpolateACross(Data
643    if (targetDomain!=*this)    if (targetDomain!=*this)
644       throw FinleyAdapterException("Error - Illegal domain of interpolation target");       throw FinleyAdapterException("Error - Illegal domain of interpolation target");
645    
646    Finley_ErrorCode=SYSTEM_ERROR;    throw FinleyAdapterException("Error - Finley does not allow interpolation across domains yet.");
   sprintf(Finley_ErrorMsg,"Finley does not allow interpolation across domains yet.");  
   checkFinleyError();  
647  }  }
648    
649  //  //
650  // calculates the integral of a function defined of arg:  // calculates the integral of a function defined of arg:
651  //  //
# Line 607  void MeshAdapter::setToIntegrals(std::ve Line 658  void MeshAdapter::setToIntegrals(std::ve
658    Finley_Mesh* mesh=m_finleyMesh.get();    Finley_Mesh* mesh=m_finleyMesh.get();
659    switch(arg.getFunctionSpace().getTypeCode()) {    switch(arg.getFunctionSpace().getTypeCode()) {
660       case(Nodes):       case(Nodes):
661          Finley_ErrorCode=TYPE_ERROR;          throw FinleyAdapterException("Error - Integral of data on nodes is not supported.");
         sprintf(Finley_ErrorMsg,"Integral of data on nodes is not supported.");  
662          break;          break;
663       case(Elements):       case(Elements):
664          Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&(arg.getDataC()),&integrals[0]);          Finley_Assemble_integrate(mesh->Nodes,mesh->Elements,&(arg.getDataC()),&integrals[0]);
# Line 617  void MeshAdapter::setToIntegrals(std::ve Line 667  void MeshAdapter::setToIntegrals(std::ve
667          Finley_Assemble_integrate(mesh->Nodes,mesh->FaceElements,&(arg.getDataC()),&integrals[0]);          Finley_Assemble_integrate(mesh->Nodes,mesh->FaceElements,&(arg.getDataC()),&integrals[0]);
668          break;          break;
669       case(Points):       case(Points):
670          Finley_ErrorCode=TYPE_ERROR;          throw FinleyAdapterException("Error - Integral of data on points is not supported.");
         sprintf(Finley_ErrorMsg,"Integral of data on points is not supported.");  
671          break;          break;
672       case(ContactElementsZero):       case(ContactElementsZero):
673          Finley_Assemble_integrate(mesh->Nodes,mesh->ContactElements,&(arg.getDataC()),&integrals[0]);          Finley_Assemble_integrate(mesh->Nodes,mesh->ContactElements,&(arg.getDataC()),&integrals[0]);
# Line 627  void MeshAdapter::setToIntegrals(std::ve Line 676  void MeshAdapter::setToIntegrals(std::ve
676          Finley_Assemble_integrate(mesh->Nodes,mesh->ContactElements,&(arg.getDataC()),&integrals[0]);          Finley_Assemble_integrate(mesh->Nodes,mesh->ContactElements,&(arg.getDataC()),&integrals[0]);
677          break;          break;
678       case(DegreesOfFreedom):       case(DegreesOfFreedom):
679          Finley_ErrorCode=TYPE_ERROR;          throw FinleyAdapterException("Error - Integral of data on degrees of freedom is not supported.");
         sprintf(Finley_ErrorMsg,"Integral of data on degrees of freedom is not supported.");  
680          break;          break;
681       case(ReducedDegreesOfFreedom):       case(ReducedDegreesOfFreedom):
682          Finley_ErrorCode=TYPE_ERROR;          throw FinleyAdapterException("Error - Integral of data on reduced degrees of freedom is not supported.");
         sprintf(Finley_ErrorMsg,"Integral of data on reduced degrees of freedom is not supported.");  
683          break;          break;
684       default:       default:
685          Finley_ErrorCode=TYPE_ERROR;          stringstream temp;
686          sprintf(Finley_ErrorMsg,"Integrals: Finley does not know anything about function space type %d",arg.getFunctionSpace().getTypeCode());          temp << "Error - Integrals: Finley does not know anything about function space type " << arg.getFunctionSpace().getTypeCode();
687            throw FinleyAdapterException(temp.str());
688          break;          break;
689    }    }
690    checkFinleyError();    checkFinleyError();
691  }  }
692    
693  //  //
694  // calculates the gradient of arg:  // calculates the gradient of arg:
695  //  //
# Line 656  void MeshAdapter::setToGradient(Data& gr Line 705  void MeshAdapter::setToGradient(Data& gr
705    Finley_Mesh* mesh=m_finleyMesh.get();    Finley_Mesh* mesh=m_finleyMesh.get();
706    switch(grad.getFunctionSpace().getTypeCode()) {    switch(grad.getFunctionSpace().getTypeCode()) {
707         case(Nodes):         case(Nodes):
708            Finley_ErrorCode=TYPE_ERROR;            throw FinleyAdapterException("Error - Gradient at nodes is not supported.");
           sprintf(Finley_ErrorMsg,"Gradient at nodes is not supported.");  
709            break;            break;
710         case(Elements):         case(Elements):
711            Finley_Assemble_gradient(mesh->Nodes,mesh->Elements,&(grad.getDataC()),&(arg.getDataC()));            Finley_Assemble_gradient(mesh->Nodes,mesh->Elements,&(grad.getDataC()),&(arg.getDataC()));
# Line 666  void MeshAdapter::setToGradient(Data& gr Line 714  void MeshAdapter::setToGradient(Data& gr
714            Finley_Assemble_gradient(mesh->Nodes,mesh->FaceElements,&(grad.getDataC()),&(arg.getDataC()));            Finley_Assemble_gradient(mesh->Nodes,mesh->FaceElements,&(grad.getDataC()),&(arg.getDataC()));
715            break;            break;
716         case(Points):         case(Points):
717            Finley_ErrorCode=TYPE_ERROR;            throw FinleyAdapterException("Error - Gradient at points is not supported.");
           sprintf(Finley_ErrorMsg,"Gradient at points is not supported.");  
718            break;            break;
719         case(ContactElementsZero):         case(ContactElementsZero):
720            Finley_Assemble_gradient(mesh->Nodes,mesh->ContactElements,&(grad.getDataC()),&(arg.getDataC()));            Finley_Assemble_gradient(mesh->Nodes,mesh->ContactElements,&(grad.getDataC()),&(arg.getDataC()));
# Line 676  void MeshAdapter::setToGradient(Data& gr Line 723  void MeshAdapter::setToGradient(Data& gr
723            Finley_Assemble_gradient(mesh->Nodes,mesh->ContactElements,&(grad.getDataC()),&(arg.getDataC()));            Finley_Assemble_gradient(mesh->Nodes,mesh->ContactElements,&(grad.getDataC()),&(arg.getDataC()));
724            break;            break;
725         case(DegreesOfFreedom):         case(DegreesOfFreedom):
726            Finley_ErrorCode=TYPE_ERROR;            throw FinleyAdapterException("Error - Gradient at degrees of freedom is not supported.");
           sprintf(Finley_ErrorMsg,"Gradient at degrees of freedom is not supported.");  
727            break;            break;
728         case(ReducedDegreesOfFreedom):         case(ReducedDegreesOfFreedom):
729            Finley_ErrorCode=TYPE_ERROR;            throw FinleyAdapterException("Error - Gradient at reduced degrees of freedom is not supported.");
           sprintf(Finley_ErrorMsg,"Gradient at reduced degrees of freedom is not supported.");  
730            break;            break;
731         default:         default:
732            Finley_ErrorCode=TYPE_ERROR;            stringstream temp;
733            sprintf(Finley_ErrorMsg,"Gradient: Finley does not know anything about function space type %d",arg.getFunctionSpace().getTypeCode());            temp << "Error - Gradient: Finley does not know anything about function space type " << arg.getFunctionSpace().getTypeCode();
734              throw FinleyAdapterException(temp.str());
735            break;            break;
736    }    }
737    checkFinleyError();    checkFinleyError();
738  }  }
739    
740  //  //
741  // returns the size of elements:  // returns the size of elements:
742  //  //
# Line 699  void MeshAdapter::setToSize(Data& size) Line 746  void MeshAdapter::setToSize(Data& size)
746    escriptDataC tmp=size.getDataC();    escriptDataC tmp=size.getDataC();
747    switch(size.getFunctionSpace().getTypeCode()) {    switch(size.getFunctionSpace().getTypeCode()) {
748         case(Nodes):         case(Nodes):
749            Finley_ErrorCode=TYPE_ERROR;            throw FinleyAdapterException("Error - Size of nodes is not supported.");
           sprintf(Finley_ErrorMsg,"Size of nodes is not supported.");  
750            break;            break;
751         case(Elements):         case(Elements):
752            Finley_Assemble_getSize(mesh->Nodes,mesh->Elements,&tmp);            Finley_Assemble_getSize(mesh->Nodes,mesh->Elements,&tmp);
# Line 709  void MeshAdapter::setToSize(Data& size) Line 755  void MeshAdapter::setToSize(Data& size)
755            Finley_Assemble_getSize(mesh->Nodes,mesh->FaceElements,&tmp);            Finley_Assemble_getSize(mesh->Nodes,mesh->FaceElements,&tmp);
756            break;            break;
757         case(Points):         case(Points):
758            Finley_ErrorCode=TYPE_ERROR;            throw FinleyAdapterException("Error - Size of point elements is not supported.");
           sprintf(Finley_ErrorMsg,"Size of point elements is not supported.");  
759            break;            break;
760         case(ContactElementsZero):         case(ContactElementsZero):
761         case(ContactElementsOne):         case(ContactElementsOne):
762            Finley_Assemble_getSize(mesh->Nodes,mesh->ContactElements,&tmp);            Finley_Assemble_getSize(mesh->Nodes,mesh->ContactElements,&tmp);
763            break;            break;
764         case(DegreesOfFreedom):         case(DegreesOfFreedom):
765            Finley_ErrorCode=TYPE_ERROR;            throw FinleyAdapterException("Error - Size of degrees of freedom is not supported.");
           sprintf(Finley_ErrorMsg,"Size of degrees of freedom is not supported.");  
766            break;            break;
767         case(ReducedDegreesOfFreedom):         case(ReducedDegreesOfFreedom):
768            Finley_ErrorCode=TYPE_ERROR;            throw FinleyAdapterException("Error - Size of reduced degrees of freedom is not supported.");
           sprintf(Finley_ErrorMsg,"Size of reduced degrees of freedom is not supported.");  
769            break;            break;
770         default:         default:
771            Finley_ErrorCode=TYPE_ERROR;            stringstream temp;
772            sprintf(Finley_ErrorMsg,"Element size: Finley does not know anything about function space type %d",size.getFunctionSpace().getTypeCode());            temp << "Error - Element size: Finley does not know anything about function space type " << size.getFunctionSpace().getTypeCode();
773              throw FinleyAdapterException(temp.str());
774            break;            break;
775    }    }
776    checkFinleyError();    checkFinleyError();
777  }  }
778    
779  // sets the location of nodes:  // sets the location of nodes:
780  void MeshAdapter::setNewX(const Data& new_x)  void MeshAdapter::setNewX(const Data& new_x)
781  {  {
# Line 741  void MeshAdapter::setNewX(const Data& ne Line 786  void MeshAdapter::setNewX(const Data& ne
786    Finley_NodeFile_setCoordinates(mesh->Nodes,&(new_x.getDataC()));    Finley_NodeFile_setCoordinates(mesh->Nodes,&(new_x.getDataC()));
787    checkFinleyError();    checkFinleyError();
788  }  }
789    
790  // saves a data array in openDX format:  // saves a data array in openDX format:
791  void MeshAdapter::saveDX(const std::string& filename,const Data& arg) const  void MeshAdapter::saveDX(const std::string& filename,const boost::python::dict& arg) const
792  {  {
793    Finley_Mesh_saveDX(filename.c_str(),m_finleyMesh.get(),&(arg.getDataC()));      int MAX_namelength=256;
794    checkFinleyError();      const int num_data=boost::python::extract<int>(arg.attr("__len__")());
795        char names[num_data][MAX_namelength];
796        char* c_names[num_data];
797        escriptDataC data[num_data];
798        escriptDataC* ptr_data[num_data];
799    
800        boost::python::list keys=arg.keys();
801        for (int i=0;i<num_data;++i) {
802             Data& d=boost::python::extract<Data&>(arg[keys[i]]);
803             if (dynamic_cast<const MeshAdapter&>(d.getFunctionSpace().getDomain()) !=*this)
804                 throw FinleyAdapterException("Error  in saveVTK: Data must be defined on same Domain");
805             data[i]=d.getDataC();
806             ptr_data[i]=&(data[i]);
807             std::string n=boost::python::extract<std::string>(keys[i]);
808             c_names[i]=&(names[i][0]);
809             if (n.length()>MAX_namelength-1) {
810                strncpy(c_names[i],n.c_str(),MAX_namelength-1);
811                c_names[i][MAX_namelength-1]='\0';
812             } else {
813                strcpy(c_names[i],n.c_str());
814             }
815        }
816        Finley_Mesh_saveDX(filename.c_str(),m_finleyMesh.get(),num_data,c_names,ptr_data);
817        checkFinleyError();
818        return;
819  }  }
820    
821    // saves a data array in openVTK format:
822    void MeshAdapter::saveVTK(const std::string& filename,const boost::python::dict& arg) const
823    {
824        int MAX_namelength=256;
825        const int num_data=boost::python::extract<int>(arg.attr("__len__")());
826        char names[num_data][MAX_namelength];
827        char* c_names[num_data];
828        escriptDataC data[num_data];
829        escriptDataC* ptr_data[num_data];
830    
831        boost::python::list keys=arg.keys();
832        for (int i=0;i<num_data;++i) {
833             Data& d=boost::python::extract<Data&>(arg[keys[i]]);
834             if (dynamic_cast<const MeshAdapter&>(d.getFunctionSpace().getDomain()) !=*this)
835                 throw FinleyAdapterException("Error  in saveVTK: Data must be defined on same Domain");
836             data[i]=d.getDataC();
837             ptr_data[i]=&(data[i]);
838             std::string n=boost::python::extract<std::string>(keys[i]);
839             c_names[i]=&(names[i][0]);
840             if (n.length()>MAX_namelength-1) {
841                strncpy(c_names[i],n.c_str(),MAX_namelength-1);
842                c_names[i][MAX_namelength-1]='\0';
843             } else {
844                strcpy(c_names[i],n.c_str());
845             }
846        }
847        Finley_Mesh_saveVTK(filename.c_str(),m_finleyMesh.get(),num_data,c_names,ptr_data);
848        checkFinleyError();
849        return;
850    }
851                                                                                                                                                                            
852                                                                                                                                                                            
853  // creates a SystemMatrixAdapter stiffness matrix an initializes it with zeros:  // creates a SystemMatrixAdapter stiffness matrix an initializes it with zeros:
854  SystemMatrixAdapter MeshAdapter::newSystemMatrix(  SystemMatrixAdapter MeshAdapter::newSystemMatrix(
855                        const int row_blocksize,                        const int row_blocksize,
# Line 781  SystemMatrixAdapter MeshAdapter::newSyst Line 884  SystemMatrixAdapter MeshAdapter::newSyst
884      }      }
885      // generate matrix:      // generate matrix:
886            
887      Finley_SystemMatrixPattern* fsystemMatrixPattern=Finley_getPattern(getFinley_Mesh(),reduceRowOrder,reduceColOrder);      Paso_SystemMatrixPattern* fsystemMatrixPattern=Finley_getPattern(getFinley_Mesh(),reduceRowOrder,reduceColOrder);
     checkFinleyError();  
     Finley_SystemMatrix* fsystemMatrix=Finley_SystemMatrix_alloc(type,fsystemMatrixPattern,row_blocksize,column_blocksize);  
888      checkFinleyError();      checkFinleyError();
889        Paso_SystemMatrix* fsystemMatrix=Paso_SystemMatrix_alloc(type,fsystemMatrixPattern,row_blocksize,column_blocksize);
890        checkPasoError();
891        Paso_SystemMatrixPattern_dealloc(fsystemMatrixPattern);
892      return SystemMatrixAdapter(fsystemMatrix,row_blocksize,row_functionspace,column_blocksize,column_functionspace);      return SystemMatrixAdapter(fsystemMatrix,row_blocksize,row_functionspace,column_blocksize,column_functionspace);
893  }  }
894    
895  //  //
896  // vtkObject MeshAdapter::createVtkObject() const  // vtkObject MeshAdapter::createVtkObject() const
897  // TODO:  // TODO:
898  //  //
899    
900  //  //
901  // returns true if data at the atom_type is considered as being cell centered:  // returns true if data at the atom_type is considered as being cell centered:
902  bool MeshAdapter::isCellOriented(int functionSpaceCode) const  bool MeshAdapter::isCellOriented(int functionSpaceCode) const
# Line 809  bool MeshAdapter::isCellOriented(int fun Line 915  bool MeshAdapter::isCellOriented(int fun
915            return true;            return true;
916            break;            break;
917         default:         default:
918            Finley_ErrorCode=TYPE_ERROR;            stringstream temp;
919            sprintf(Finley_ErrorMsg,"Cell: Finley does not know anything about function space type %d",functionSpaceCode);            temp << "Error - Cell: Finley does not know anything about function space type " << functionSpaceCode;
920              throw FinleyAdapterException(temp.str());
921            break;            break;
922    }    }
923    checkFinleyError();    checkFinleyError();
924    return false;    return false;
925  }  }
926    
927  bool MeshAdapter::probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const  bool MeshAdapter::probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const
928  {  {
929    switch(functionSpaceType_source) {    switch(functionSpaceType_source) {
# Line 831  bool MeshAdapter::probeInterpolationOnDo Line 939  bool MeshAdapter::probeInterpolationOnDo
939             case(ContactElementsOne):             case(ContactElementsOne):
940                 return true;                 return true;
941             default:             default:
942                 Finley_ErrorCode=TYPE_ERROR;                 stringstream temp;
943                 sprintf(Finley_ErrorMsg,"Interpolation On Domain: Finley does not know anything about function space type %d",functionSpaceType_target);                 temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_target;
944                   throw FinleyAdapterException(temp.str());
945          }          }
946          break;          break;
947       case(Elements):       case(Elements):
# Line 872  bool MeshAdapter::probeInterpolationOnDo Line 981  bool MeshAdapter::probeInterpolationOnDo
981             case(ContactElementsOne):             case(ContactElementsOne):
982                return true;                return true;
983             default:             default:
984               Finley_ErrorCode=TYPE_ERROR;               stringstream temp;
985               sprintf(Finley_ErrorMsg,"Interpolation On Domain: Finley does not know anything about function space type %d",functionSpaceType_target);               temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_target;
986                 throw FinleyAdapterException(temp.str());
987          }          }
988          break;          break;
989       case(ReducedDegreesOfFreedom):       case(ReducedDegreesOfFreedom):
990         switch(functionSpaceType_target) {         switch(functionSpaceType_target) {
991            case(ReducedDegreesOfFreedom):            case(ReducedDegreesOfFreedom):
           case(Nodes):  
992            case(Elements):            case(Elements):
993            case(FaceElements):            case(FaceElements):
994            case(Points):            case(Points):
995            case(ContactElementsZero):            case(ContactElementsZero):
996            case(ContactElementsOne):            case(ContactElementsOne):
997                return true;                return true;
998              case(Nodes):
999            case(DegreesOfFreedom):            case(DegreesOfFreedom):
1000               return false;               return false;
1001            default:            default:
1002               Finley_ErrorCode=TYPE_ERROR;               stringstream temp;
1003               sprintf(Finley_ErrorMsg,"Interpolation On Domain: Finley does not know anything about function space type %d",functionSpaceType_target);               temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_target;
1004                 throw FinleyAdapterException(temp.str());
1005         }         }
1006         break;         break;
1007       default:       default:
1008          Finley_ErrorCode=TYPE_ERROR;          stringstream temp;
1009          sprintf(Finley_ErrorMsg,"Interpolation On Domain: Finley does not know anything about function space type %d",functionSpaceType_source);          temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_source;
1010            throw FinleyAdapterException(temp.str());
1011          break;          break;
1012    }    }
1013    checkFinleyError();    checkFinleyError();
1014    return false;    return false;
1015  }  }
1016    
1017  bool MeshAdapter::probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const  bool MeshAdapter::probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const
1018  {  {
1019      return false;      return false;
1020  }  }
1021  bool MeshAdapter::operator==(const MeshAdapter& other) const  
1022    bool MeshAdapter::operator==(const AbstractDomain& other) const
1023  {  {
1024    return (m_finleyMesh==other.m_finleyMesh);    const MeshAdapter* temp=dynamic_cast<const MeshAdapter*>(&other);
1025      if (temp!=0) {
1026        return (m_finleyMesh==temp->m_finleyMesh);
1027      } else {
1028        return false;
1029      }
1030  }  }
1031    
1032  int MeshAdapter::getSystemMatrixTypeId(const int solver, const bool symmetry) const  bool MeshAdapter::operator!=(const AbstractDomain& other) const
1033  {  {
1034     int out=Finley_SystemMatrix_getSystemMatrixTypeId(solver,symmetry?1:0);    return !(operator==(other));
1035     checkFinleyError();  }
1036    
1037    int MeshAdapter::getSystemMatrixTypeId(const int solver, const int package, const bool symmetry) const
1038    {
1039       int out=Paso_SystemMatrix_getSystemMatrixTypeId(SystemMatrixAdapter::mapOptionToPaso(solver),SystemMatrixAdapter::mapOptionToPaso(package),symmetry?1:0);
1040       checkPasoError();
1041     return out;     return out;
1042  }  }
1043    
1044  Data MeshAdapter::getX() const  Data MeshAdapter::getX() const
1045  {  {
1046    return continuousFunction(asAbstractContinuousDomain()).getX();    return continuousFunction(asAbstractContinuousDomain()).getX();
1047  }  }
1048    
1049  Data MeshAdapter::getNormal() const  Data MeshAdapter::getNormal() const
1050  {  {
1051    return functionOnBoundary(asAbstractContinuousDomain()).getNormal();    return functionOnBoundary(asAbstractContinuousDomain()).getNormal();
1052  }  }
1053    
1054  Data MeshAdapter::getSize() const  Data MeshAdapter::getSize() const
1055  {  {
1056    return function(asAbstractContinuousDomain()).getSize();    return function(asAbstractContinuousDomain()).getSize();
1057  }  }
1058    
1059    int MeshAdapter::getTagFromSampleNo(int functionSpaceType, int sampleNo) const
1060    {
1061      int* tagList;
1062      int numTags;
1063      getTagList(functionSpaceType, &tagList, &numTags);
1064      return tagList[sampleNo];
1065    }
1066    
1067  bool MeshAdapter::operator!=(const MeshAdapter& other) const  int MeshAdapter::getReferenceNoFromSampleNo(int functionSpaceType, int sampleNo) const
1068  {  {
1069    return !operator==(other);    int* referenceNoList;
1070      int numReferenceNo;
1071      getReferenceNoList(functionSpaceType, &referenceNoList, &numReferenceNo);
1072      return referenceNoList[sampleNo];
1073  }  }
1074  // bool MeshAdapter::operator==(const AbstractDomain& other) const  
 // {  
   // try {  
     // const MeshAdapter& ref = dynamic_cast<const MeshAdapter&>(other);  
     // return (operator==(ref));  
   // }  
   // catch (bad_cast) {  
     // return false;  
   // }  
 // }  
1075  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.97  
changed lines
  Added in v.472

  ViewVC Help
Powered by ViewVC 1.1.26