/[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 2385 by gross, Wed Apr 15 03:52:38 2009 UTC revision 2748 by gross, Tue Nov 17 07:32:59 2009 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*******************************************************
3  *  *
4  * Copyright (c) 2003-2008 by University of Queensland  * Copyright (c) 2003-2009 by University of Queensland
5  * Earth Systems Science Computational Center (ESSCC)  * Earth Systems Science Computational Center (ESSCC)
6  * http://www.uq.edu.au/esscc  * http://www.uq.edu.au/esscc
7  *  *
# Line 96  bool MeshAdapter::onMasterProcessor() co Line 96  bool MeshAdapter::onMasterProcessor() co
96  }  }
97    
98    
99    #ifdef PASO_MPI
100      MPI_Comm
101    #else
102      unsigned int
103    #endif
104    MeshAdapter::getMPIComm() const
105    {
106    #ifdef PASO_MPI
107        return m_finleyMesh->MPIInfo->comm;
108    #else
109        return 0;
110    #endif
111    }
112    
113    
114  Finley_Mesh* MeshAdapter::getFinley_Mesh() const {  Finley_Mesh* MeshAdapter::getFinley_Mesh() const {
115     return m_finleyMesh.get();     return m_finleyMesh.get();
116  }  }
# Line 109  void MeshAdapter::write(const std::strin Line 124  void MeshAdapter::write(const std::strin
124     TMPMEMFREE(fName);     TMPMEMFREE(fName);
125  }  }
126    
127  void MeshAdapter::Print_Mesh_Info(const bool full=false) const  void MeshAdapter::Print_Mesh_Info(const bool full) const
128  {  {
129     Finley_PrintMesh_Info(m_finleyMesh.get(), full);     Finley_PrintMesh_Info(m_finleyMesh.get(), full);
130  }  }
# Line 225  void MeshAdapter::dump(const std::string Line 240  void MeshAdapter::dump(const std::string
240        throw DataException("Error - MeshAdapter::dump: appending num_FaceElements_numNodes to NetCDF file failed: " + *newFileName);        throw DataException("Error - MeshAdapter::dump: appending num_FaceElements_numNodes to NetCDF file failed: " + *newFileName);
241     if (!dataFile.add_att("num_ContactElements_numNodes",num_ContactElements_numNodes) )     if (!dataFile.add_att("num_ContactElements_numNodes",num_ContactElements_numNodes) )
242        throw DataException("Error - MeshAdapter::dump: appending num_ContactElements_numNodes to NetCDF file failed: " + *newFileName);        throw DataException("Error - MeshAdapter::dump: appending num_ContactElements_numNodes to NetCDF file failed: " + *newFileName);
243     if (!dataFile.add_att("Elements_TypeId", mesh->Elements->ReferenceElement->Type->TypeId) )     if (!dataFile.add_att("Elements_TypeId", mesh->Elements->referenceElementSet->referenceElement->Type->TypeId) )
244        throw DataException("Error - MeshAdapter::dump: appending Elements_TypeId to NetCDF file failed: " + *newFileName);        throw DataException("Error - MeshAdapter::dump: appending Elements_TypeId to NetCDF file failed: " + *newFileName);
245     if (!dataFile.add_att("FaceElements_TypeId", mesh->FaceElements->ReferenceElement->Type->TypeId) )     if (!dataFile.add_att("FaceElements_TypeId", mesh->FaceElements->referenceElementSet->referenceElement->Type->TypeId) )
246        throw DataException("Error - MeshAdapter::dump: appending FaceElements_TypeId to NetCDF file failed: " + *newFileName);        throw DataException("Error - MeshAdapter::dump: appending FaceElements_TypeId to NetCDF file failed: " + *newFileName);
247     if (!dataFile.add_att("ContactElements_TypeId", mesh->ContactElements->ReferenceElement->Type->TypeId) )     if (!dataFile.add_att("ContactElements_TypeId", mesh->ContactElements->referenceElementSet->referenceElement->Type->TypeId) )
248        throw DataException("Error - MeshAdapter::dump: appending ContactElements_TypeId to NetCDF file failed: " + *newFileName);        throw DataException("Error - MeshAdapter::dump: appending ContactElements_TypeId to NetCDF file failed: " + *newFileName);
249     if (!dataFile.add_att("Points_TypeId", mesh->Points->ReferenceElement->Type->TypeId) )     if (!dataFile.add_att("Points_TypeId", mesh->Points->referenceElementSet->referenceElement->Type->TypeId) )
250        throw DataException("Error - MeshAdapter::dump: appending Points_TypeId to NetCDF file failed: " + *newFileName);        throw DataException("Error - MeshAdapter::dump: appending Points_TypeId to NetCDF file failed: " + *newFileName);
251     if (!dataFile.add_att("num_Tags", num_Tags) )     if (!dataFile.add_att("num_Tags", num_Tags) )
252        throw DataException("Error - MeshAdapter::dump: appending num_Tags to NetCDF file failed: " + *newFileName);        throw DataException("Error - MeshAdapter::dump: appending num_Tags to NetCDF file failed: " + *newFileName);
# Line 678  pair<int,int> MeshAdapter::getDataShape( Line 693  pair<int,int> MeshAdapter::getDataShape(
693     case(Elements):     case(Elements):
694     if (mesh->Elements!=NULL) {     if (mesh->Elements!=NULL) {
695        numSamples=mesh->Elements->numElements;        numSamples=mesh->Elements->numElements;
696        numDataPointsPerSample=mesh->Elements->ReferenceElement->numQuadNodes;        numDataPointsPerSample=mesh->Elements->referenceElementSet->referenceElement->Parametrization->numQuadNodes;
697     }     }
698     break;     break;
699     case(ReducedElements):     case(ReducedElements):
700     if (mesh->Elements!=NULL) {     if (mesh->Elements!=NULL) {
701        numSamples=mesh->Elements->numElements;        numSamples=mesh->Elements->numElements;
702        numDataPointsPerSample=mesh->Elements->ReferenceElementReducedOrder->numQuadNodes;        numDataPointsPerSample=mesh->Elements->referenceElementSet->referenceElementReducedQuadrature->Parametrization->numQuadNodes;
703     }     }
704     break;     break;
705     case(FaceElements):     case(FaceElements):
706     if (mesh->FaceElements!=NULL) {     if (mesh->FaceElements!=NULL) {
707        numDataPointsPerSample=mesh->FaceElements->ReferenceElement->numQuadNodes;        numDataPointsPerSample=mesh->FaceElements->referenceElementSet->referenceElement->Parametrization->numQuadNodes;
708        numSamples=mesh->FaceElements->numElements;        numSamples=mesh->FaceElements->numElements;
709     }     }
710     break;     break;
711     case(ReducedFaceElements):     case(ReducedFaceElements):
712     if (mesh->FaceElements!=NULL) {     if (mesh->FaceElements!=NULL) {
713        numDataPointsPerSample=mesh->FaceElements->ReferenceElementReducedOrder->numQuadNodes;        numDataPointsPerSample=mesh->FaceElements->referenceElementSet->referenceElementReducedQuadrature->Parametrization->numQuadNodes;
714        numSamples=mesh->FaceElements->numElements;        numSamples=mesh->FaceElements->numElements;
715     }     }
716     break;     break;
# Line 707  pair<int,int> MeshAdapter::getDataShape( Line 722  pair<int,int> MeshAdapter::getDataShape(
722     break;     break;
723     case(ContactElementsZero):     case(ContactElementsZero):
724     if (mesh->ContactElements!=NULL) {     if (mesh->ContactElements!=NULL) {
725        numDataPointsPerSample=mesh->ContactElements->ReferenceElement->numQuadNodes;        numDataPointsPerSample=mesh->ContactElements->referenceElementSet->referenceElement->Parametrization->numQuadNodes;
726        numSamples=mesh->ContactElements->numElements;        numSamples=mesh->ContactElements->numElements;
727     }     }
728     break;     break;
729     case(ReducedContactElementsZero):     case(ReducedContactElementsZero):
730     if (mesh->ContactElements!=NULL) {     if (mesh->ContactElements!=NULL) {
731        numDataPointsPerSample=mesh->ContactElements->ReferenceElementReducedOrder->numQuadNodes;        numDataPointsPerSample=mesh->ContactElements->referenceElementSet->referenceElementReducedQuadrature->Parametrization->numQuadNodes;
732        numSamples=mesh->ContactElements->numElements;        numSamples=mesh->ContactElements->numElements;
733     }     }
734     break;     break;
735     case(ContactElementsOne):     case(ContactElementsOne):
736     if (mesh->ContactElements!=NULL) {     if (mesh->ContactElements!=NULL) {
737        numDataPointsPerSample=mesh->ContactElements->ReferenceElement->numQuadNodes;        numDataPointsPerSample=mesh->ContactElements->referenceElementSet->referenceElement->Parametrization->numQuadNodes;
738        numSamples=mesh->ContactElements->numElements;        numSamples=mesh->ContactElements->numElements;
739     }     }
740     break;     break;
741     case(ReducedContactElementsOne):     case(ReducedContactElementsOne):
742     if (mesh->ContactElements!=NULL) {     if (mesh->ContactElements!=NULL) {
743        numDataPointsPerSample=mesh->ContactElements->ReferenceElementReducedOrder->numQuadNodes;        numDataPointsPerSample=mesh->ContactElements->referenceElementSet->referenceElementReducedQuadrature->Parametrization->numQuadNodes;
744        numSamples=mesh->ContactElements->numElements;        numSamples=mesh->ContactElements->numElements;
745     }     }
746     break;     break;
# Line 1453  void MeshAdapter::setNewX(const escript: Line 1468  void MeshAdapter::setNewX(const escript:
1468     const MeshAdapter& newDomain=dynamic_cast<const MeshAdapter&>(*(new_x.getFunctionSpace().getDomain()));     const MeshAdapter& newDomain=dynamic_cast<const MeshAdapter&>(*(new_x.getFunctionSpace().getDomain()));
1469     if (newDomain!=*this)     if (newDomain!=*this)
1470        throw FinleyAdapterException("Error - Illegal domain of new point locations");        throw FinleyAdapterException("Error - Illegal domain of new point locations");
1471     tmp = new_x.getDataC();     if ( new_x.getFunctionSpace() == continuousFunction(asAbstractContinuousDomain()) ) {
1472     Finley_Mesh_setCoordinates(mesh,&tmp);         tmp = new_x.getDataC();
1473           Finley_Mesh_setCoordinates(mesh,&tmp);
1474       } else {
1475           escript::Data new_x_inter=escript::Data( new_x,  continuousFunction(asAbstractContinuousDomain()) );
1476           tmp = new_x_inter.getDataC();
1477           Finley_Mesh_setCoordinates(mesh,&tmp);
1478       }
1479     checkFinleyError();     checkFinleyError();
1480  }  }
1481    
# Line 1512  void MeshAdapter::saveDX(const std::stri Line 1533  void MeshAdapter::saveDX(const std::stri
1533  //  //
1534  // saves mesh and optionally data arrays in VTK format  // saves mesh and optionally data arrays in VTK format
1535  //  //
1536  void MeshAdapter::saveVTK(const std::string& filename,const boost::python::dict& arg) const  void MeshAdapter::saveVTK(const std::string& filename,const boost::python::dict& arg,  const std::string& metadata, const std::string& metadata_schema) const
1537  {  {
1538     int num_data;     int num_data;
1539     char **names;     char **names;
# Line 1520  void MeshAdapter::saveVTK(const std::str Line 1541  void MeshAdapter::saveVTK(const std::str
1541     escriptDataC **ptr_data;     escriptDataC **ptr_data;
1542    
1543     extractArgsFromDict(arg, num_data, names, data, ptr_data);     extractArgsFromDict(arg, num_data, names, data, ptr_data);
1544     Finley_Mesh_saveVTK(filename.c_str(), m_finleyMesh.get(), num_data, names, ptr_data);     Finley_Mesh_saveVTK(filename.c_str(), m_finleyMesh.get(), num_data, names, ptr_data, metadata.c_str(), metadata_schema.c_str());
1545     checkFinleyError();     checkFinleyError();
1546    
1547     /* win32 refactor */     /* win32 refactor */
# Line 1533  void MeshAdapter::saveVTK(const std::str Line 1554  void MeshAdapter::saveVTK(const std::str
1554     TMPMEMFREE(names);     TMPMEMFREE(names);
1555  }  }
1556    
1557    bool MeshAdapter::ownSample(int fs_code, index_t id) const
1558    {
1559    #ifdef PASO_MPI
1560        index_t myFirstNode=0, myLastNode=0, k=0;
1561        index_t* globalNodeIndex=0;
1562        Finley_Mesh* mesh_p=m_finleyMesh.get();
1563        if (fs_code == FINLEY_REDUCED_NODES)
1564        {
1565        myFirstNode = Finley_NodeFile_getFirstReducedNode(mesh_p->Nodes);
1566        myLastNode = Finley_NodeFile_getLastReducedNode(mesh_p->Nodes);
1567        globalNodeIndex = Finley_NodeFile_borrowGlobalReducedNodesIndex(mesh_p->Nodes);
1568        }
1569        else
1570        {
1571        myFirstNode = Finley_NodeFile_getFirstNode(mesh_p->Nodes);
1572        myLastNode = Finley_NodeFile_getLastNode(mesh_p->Nodes);
1573        globalNodeIndex = Finley_NodeFile_borrowGlobalNodesIndex(mesh_p->Nodes);
1574        }
1575        k=globalNodeIndex[id];
1576        return static_cast<bool>( (myFirstNode <= k) && (k < myLastNode) );
1577    #endif
1578        return true;
1579    }
1580    
1581    
1582    
1583  //  //
1584  // creates a SystemMatrixAdapter stiffness matrix an initializes it with zeros  // creates a SystemMatrixAdapter stiffness matrix an initializes it with zeros
1585  //  //
# Line 1579  SystemMatrixAdapter MeshAdapter::newSyst Line 1626  SystemMatrixAdapter MeshAdapter::newSyst
1626  #endif  #endif
1627     }     }
1628     else {     else {
1629        fsystemMatrix=Paso_SystemMatrix_alloc(type,fsystemMatrixPattern,row_blocksize,column_blocksize);        fsystemMatrix=Paso_SystemMatrix_alloc(type,fsystemMatrixPattern,row_blocksize,column_blocksize,FALSE);
1630     }     }
1631     checkPasoError();     checkPasoError();
1632     Paso_SystemMatrixPattern_free(fsystemMatrixPattern);     Paso_SystemMatrixPattern_free(fsystemMatrixPattern);
# Line 1655  bool MeshAdapter::isCellOriented(int fun Line 1702  bool MeshAdapter::isCellOriented(int fun
1702     return false;     return false;
1703  }  }
1704    
1705    bool
1706    MeshAdapter::commonFunctionSpace(const std::vector<int>& fs, int& resultcode) const
1707    {
1708       /* The idea is to use equivalence classes. [Types which can be interpolated back and forth]
1709        class 1: DOF <-> Nodes
1710        class 2: ReducedDOF <-> ReducedNodes
1711        class 3: Points
1712        class 4: Elements
1713        class 5: ReducedElements
1714        class 6: FaceElements
1715        class 7: ReducedFaceElements
1716        class 8: ContactElementZero <-> ContactElementOne
1717        class 9: ReducedContactElementZero <-> ReducedContactElementOne
1718    
1719       There is also a set of lines. Interpolation is possible down a line but not between lines.
1720       class 1 and 2 belong to all lines so aren't considered.
1721        line 0: class 3
1722        line 1: class 4,5
1723        line 2: class 6,7
1724        line 3: class 8,9
1725    
1726       For classes with multiple members (eg class 2) we have vars to record if there is at least one instance.
1727       eg hasnodes is true if we have at least one instance of Nodes.
1728       */
1729        if (fs.size()==0)
1730        {
1731        return false;
1732        }
1733        std::vector<int> hasclass(10);
1734        std::vector<int> hasline(4);    
1735        bool hasnodes=false;
1736        bool hasrednodes=false;
1737        bool hascez=false;
1738        bool hasrcez=false;
1739        for (int i=0;i<fs.size();++i)
1740        {
1741        switch(fs[i])
1742        {
1743        case(Nodes):   hasnodes=true;   // no break is deliberate
1744        case(DegreesOfFreedom):
1745            hasclass[1]=1;
1746            break;
1747        case(ReducedNodes):    hasrednodes=true;    // no break is deliberate
1748        case(ReducedDegreesOfFreedom):
1749            hasclass[2]=1;
1750            break;
1751        case(Points):
1752            hasline[0]=1;
1753            hasclass[3]=1;
1754            break;
1755        case(Elements):
1756            hasclass[4]=1;
1757            hasline[1]=1;
1758            break;
1759        case(ReducedElements):
1760            hasclass[5]=1;
1761            hasline[1]=1;
1762            break;
1763        case(FaceElements):
1764            hasclass[6]=1;
1765            hasline[2]=1;
1766            break;
1767        case(ReducedFaceElements):
1768            hasclass[7]=1;
1769            hasline[2]=1;
1770            break;
1771        case(ContactElementsZero):  hascez=true;    // no break is deliberate
1772        case(ContactElementsOne):
1773            hasclass[8]=1;
1774            hasline[3]=1;
1775            break;
1776        case(ReducedContactElementsZero):   hasrcez=true;   // no break is deliberate
1777        case(ReducedContactElementsOne):
1778            hasclass[9]=1;
1779            hasline[3]=1;
1780            break;
1781        default:
1782            return false;
1783        }
1784        }
1785        int totlines=hasline[0]+hasline[1]+hasline[2]+hasline[3];
1786        // fail if we have more than one leaf group
1787    
1788        if (totlines>1)
1789        {
1790        return false;   // there are at least two branches we can't interpolate between
1791        }
1792        else if (totlines==1)
1793        {
1794        if (hasline[0]==1)      // we have points
1795        {
1796            resultcode=Points;
1797        }
1798        else if (hasline[1]==1)
1799        {
1800            if (hasclass[5]==1)
1801            {
1802            resultcode=ReducedElements;
1803            }
1804            else
1805            {
1806            resultcode=Elements;
1807            }
1808        }
1809        else if (hasline[2]==1)
1810        {
1811            if (hasclass[7]==1)
1812            {
1813            resultcode=ReducedFaceElements;
1814            }
1815            else
1816            {
1817            resultcode=FaceElements;
1818            }
1819        }
1820        else    // so we must be in line3
1821        {
1822            if (hasclass[9]==1)
1823            {
1824            // need something from class 9
1825            resultcode=(hasrcez?ReducedContactElementsZero:ReducedContactElementsOne);
1826            }
1827            else
1828            {
1829            // something from class 8
1830            resultcode=(hascez?ContactElementsZero:ContactElementsOne);
1831            }
1832        }
1833        }
1834        else    // totlines==0
1835        {
1836        if (hasclass[2]==1)
1837        {
1838            // something from class 2
1839            resultcode=(hasrednodes?ReducedNodes:ReducedDegreesOfFreedom);
1840        }
1841        else
1842        {   // something from class 1
1843            resultcode=(hasnodes?Nodes:DegreesOfFreedom);
1844        }
1845        }
1846        return true;
1847    }
1848    
1849  bool MeshAdapter::probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const  bool MeshAdapter::probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const
1850  {  {
1851     switch(functionSpaceType_source) {     switch(functionSpaceType_source) {
1852     case(Nodes):     case(Nodes):
1853     switch(functionSpaceType_target) {      switch(functionSpaceType_target) {
1854     case(Nodes):      case(Nodes):
1855     case(ReducedNodes):      case(ReducedNodes):
1856     case(ReducedDegreesOfFreedom):      case(ReducedDegreesOfFreedom):
1857     case(DegreesOfFreedom):      case(DegreesOfFreedom):
1858     case(Elements):      case(Elements):
1859     case(ReducedElements):      case(ReducedElements):
1860     case(FaceElements):      case(FaceElements):
1861     case(ReducedFaceElements):      case(ReducedFaceElements):
1862     case(Points):      case(Points):
1863     case(ContactElementsZero):      case(ContactElementsZero):
1864     case(ReducedContactElementsZero):      case(ReducedContactElementsZero):
1865     case(ContactElementsOne):      case(ContactElementsOne):
1866     case(ReducedContactElementsOne):      case(ReducedContactElementsOne):
1867     return true;      return true;
1868     default:      default:
1869        stringstream temp;            stringstream temp;
1870        temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_target;            temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_target;
1871        throw FinleyAdapterException(temp.str());            throw FinleyAdapterException(temp.str());
1872     }     }
1873     break;     break;
1874     case(ReducedNodes):     case(ReducedNodes):
1875     switch(functionSpaceType_target) {      switch(functionSpaceType_target) {
1876     case(ReducedNodes):      case(ReducedNodes):
1877     case(ReducedDegreesOfFreedom):      case(ReducedDegreesOfFreedom):
1878     case(Elements):      case(Elements):
1879     case(ReducedElements):      case(ReducedElements):
1880     case(FaceElements):      case(FaceElements):
1881     case(ReducedFaceElements):      case(ReducedFaceElements):
1882     case(Points):      case(Points):
1883     case(ContactElementsZero):      case(ContactElementsZero):
1884     case(ReducedContactElementsZero):      case(ReducedContactElementsZero):
1885     case(ContactElementsOne):      case(ContactElementsOne):
1886     case(ReducedContactElementsOne):      case(ReducedContactElementsOne):
1887     return true;      return true;
1888     case(Nodes):      case(Nodes):
1889     case(DegreesOfFreedom):      case(DegreesOfFreedom):
1890     return false;      return false;
1891     default:      default:
1892        stringstream temp;          stringstream temp;
1893        temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_target;          temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_target;
1894        throw FinleyAdapterException(temp.str());          throw FinleyAdapterException(temp.str());
1895     }     }
1896     break;     break;
1897     case(Elements):     case(Elements):
1898     if (functionSpaceType_target==Elements) {      if (functionSpaceType_target==Elements) {
1899        return true;        return true;
1900     } else if (functionSpaceType_target==ReducedElements) {      } else if (functionSpaceType_target==ReducedElements) {
1901        return true;        return true;
1902     } else {          } else {
1903        return false;            return false;
1904     }          }
1905     case(ReducedElements):     case(ReducedElements):
1906     if (functionSpaceType_target==ReducedElements) {      if (functionSpaceType_target==ReducedElements) {
1907        return true;        return true;
1908     } else {      } else {
1909        return false;            return false;
1910     }      }
1911     case(FaceElements):     case(FaceElements):
1912     if (functionSpaceType_target==FaceElements) {      if (functionSpaceType_target==FaceElements) {
1913        return true;              return true;
1914     } else if (functionSpaceType_target==ReducedFaceElements) {      } else if (functionSpaceType_target==ReducedFaceElements) {
1915        return true;              return true;
1916     } else {      } else {
1917        return false;              return false;
1918     }      }
1919     case(ReducedFaceElements):     case(ReducedFaceElements):
1920     if (functionSpaceType_target==ReducedFaceElements) {      if (functionSpaceType_target==ReducedFaceElements) {
1921        return true;              return true;
1922     } else {      } else {
1923        return false;          return false;
1924     }      }
1925     case(Points):     case(Points):
1926     if (functionSpaceType_target==Points) {      if (functionSpaceType_target==Points) {
1927        return true;              return true;
1928     } else {      } else {
1929        return false;              return false;
1930     }      }
1931     case(ContactElementsZero):     case(ContactElementsZero):
1932     case(ContactElementsOne):     case(ContactElementsOne):
1933     if (functionSpaceType_target==ContactElementsZero || functionSpaceType_target==ContactElementsOne) {      if (functionSpaceType_target==ContactElementsZero || functionSpaceType_target==ContactElementsOne) {
1934        return true;              return true;
1935     } else if (functionSpaceType_target==ReducedContactElementsZero || functionSpaceType_target==ReducedContactElementsOne) {      } else if (functionSpaceType_target==ReducedContactElementsZero || functionSpaceType_target==ReducedContactElementsOne) {
1936        return true;              return true;
1937     } else {      } else {
1938        return false;              return false;
1939     }      }
1940     case(ReducedContactElementsZero):     case(ReducedContactElementsZero):
1941     case(ReducedContactElementsOne):     case(ReducedContactElementsOne):
1942     if (functionSpaceType_target==ReducedContactElementsZero || functionSpaceType_target==ReducedContactElementsOne) {      if (functionSpaceType_target==ReducedContactElementsZero || functionSpaceType_target==ReducedContactElementsOne) {
1943        return true;              return true;
1944     } else {      } else {
1945        return false;              return false;
1946     }      }
    case(DegreesOfFreedom):  
    switch(functionSpaceType_target) {  
    case(ReducedDegreesOfFreedom):  
1947     case(DegreesOfFreedom):     case(DegreesOfFreedom):
1948     case(Nodes):      switch(functionSpaceType_target) {
1949     case(ReducedNodes):      case(ReducedDegreesOfFreedom):
1950     case(Elements):      case(DegreesOfFreedom):
1951     case(ReducedElements):      case(Nodes):
1952     case(Points):      case(ReducedNodes):
1953     case(FaceElements):      case(Elements):
1954     case(ReducedFaceElements):      case(ReducedElements):
1955     case(ContactElementsZero):      case(Points):
1956     case(ReducedContactElementsZero):      case(FaceElements):
1957     case(ContactElementsOne):      case(ReducedFaceElements):
1958     case(ReducedContactElementsOne):      case(ContactElementsZero):
1959     return true;      case(ReducedContactElementsZero):
1960     default:      case(ContactElementsOne):
1961        stringstream temp;      case(ReducedContactElementsOne):
1962        temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_target;      return true;
1963        throw FinleyAdapterException(temp.str());      default:
1964     }          stringstream temp;
1965     break;          temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_target;
1966            throw FinleyAdapterException(temp.str());
1967        }
1968        break;
1969     case(ReducedDegreesOfFreedom):     case(ReducedDegreesOfFreedom):
1970     switch(functionSpaceType_target) {     switch(functionSpaceType_target) {
1971     case(ReducedDegreesOfFreedom):      case(ReducedDegreesOfFreedom):
1972     case(ReducedNodes):      case(ReducedNodes):
1973     case(Elements):      case(Elements):
1974     case(ReducedElements):      case(ReducedElements):
1975     case(FaceElements):      case(FaceElements):
1976     case(ReducedFaceElements):      case(ReducedFaceElements):
1977     case(Points):      case(Points):
1978     case(ContactElementsZero):      case(ContactElementsZero):
1979     case(ReducedContactElementsZero):      case(ReducedContactElementsZero):
1980     case(ContactElementsOne):      case(ContactElementsOne):
1981     case(ReducedContactElementsOne):      case(ReducedContactElementsOne):
1982     return true;      return true;
1983     case(Nodes):      case(Nodes):
1984     case(DegreesOfFreedom):      case(DegreesOfFreedom):
1985     return false;      return false;
1986     default:      default:
1987        stringstream temp;          stringstream temp;
1988        temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_target;          temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_target;
1989        throw FinleyAdapterException(temp.str());          throw FinleyAdapterException(temp.str());
1990     }      }
1991     break;      break;
1992     default:     default:
1993        stringstream temp;        stringstream temp;
1994        temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_source;        temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << functionSpaceType_source;
# Line 1858  escript::Data MeshAdapter::getSize() con Line 2049  escript::Data MeshAdapter::getSize() con
2049     return escript::function(asAbstractContinuousDomain()).getSize();     return escript::function(asAbstractContinuousDomain()).getSize();
2050  }  }
2051    
2052  int* MeshAdapter::borrowSampleReferenceIDs(int functionSpaceType) const  const int* MeshAdapter::borrowSampleReferenceIDs(int functionSpaceType) const
2053  {  {
2054     int *out = NULL;     int *out = NULL;
2055     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
# Line 2095  int MeshAdapter::getNumberOfTagsInUse(in Line 2286  int MeshAdapter::getNumberOfTagsInUse(in
2286    }    }
2287    return numTags;    return numTags;
2288  }  }
2289  int* MeshAdapter::borrowListOfTagsInUse(int functionSpaceCode) const  
2290    const int* MeshAdapter::borrowListOfTagsInUse(int functionSpaceCode) const
2291  {  {
2292    Finley_Mesh* mesh=m_finleyMesh.get();    Finley_Mesh* mesh=m_finleyMesh.get();
2293    index_t* tags=NULL;    index_t* tags=NULL;
# Line 2161  bool MeshAdapter::canTag(int functionSpa Line 2353  bool MeshAdapter::canTag(int functionSpa
2353    }    }
2354  }  }
2355    
2356    AbstractDomain::StatusType MeshAdapter::getStatus() const
2357    {
2358      Finley_Mesh* mesh=m_finleyMesh.get();
2359      return Finley_Mesh_getStatus(mesh);
2360    }
2361    
2362    
2363    
2364  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.2385  
changed lines
  Added in v.2748

  ViewVC Help
Powered by ViewVC 1.1.26