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

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

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

revision 2315 by gross, Wed Mar 18 00:38:48 2009 UTC revision 2548 by jfenwick, Mon Jul 20 06:20:06 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 109  void MeshAdapter::write(const std::strin Line 109  void MeshAdapter::write(const std::strin
109     TMPMEMFREE(fName);     TMPMEMFREE(fName);
110  }  }
111    
112  void MeshAdapter::Print_Mesh_Info(const bool full=false) const  void MeshAdapter::Print_Mesh_Info(const bool full) const
113  {  {
114     Finley_PrintMesh_Info(m_finleyMesh.get(), full);     Finley_PrintMesh_Info(m_finleyMesh.get(), full);
115  }  }
# Line 881  void MeshAdapter::interpolateOnDomain(es Line 881  void MeshAdapter::interpolateOnDomain(es
881     escriptDataC _in=in.getDataC();     escriptDataC _in=in.getDataC();
882     switch(in.getFunctionSpace().getTypeCode()) {     switch(in.getFunctionSpace().getTypeCode()) {
883     case(Nodes):     case(Nodes):
884     switch(target.getFunctionSpace().getTypeCode()) {        switch(target.getFunctionSpace().getTypeCode()) {
885     case(Nodes):        case(Nodes):
886     case(ReducedNodes):        case(ReducedNodes):
887     case(DegreesOfFreedom):        case(DegreesOfFreedom):
888     case(ReducedDegreesOfFreedom):        case(ReducedDegreesOfFreedom):
889     Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);        Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);
    break;  
    case(Elements):  
    case(ReducedElements):  
    Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);  
    break;  
    case(FaceElements):  
    case(ReducedFaceElements):  
    Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);  
    break;  
    case(Points):  
    Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);  
    break;  
    case(ContactElementsZero):  
    case(ReducedContactElementsZero):  
    Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);  
    break;  
    case(ContactElementsOne):  
    case(ReducedContactElementsOne):  
    Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);  
    break;  
    default:  
       stringstream temp;  
       temp << "Error - Interpolation on Domain: Finley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();  
       throw FinleyAdapterException(temp.str());  
890        break;        break;
891     }        case(Elements):
892     break;        case(ReducedElements):
893     case(ReducedNodes):        Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);
894     switch(target.getFunctionSpace().getTypeCode()) {        break;
895     case(Nodes):        case(FaceElements):
896     case(ReducedNodes):        case(ReducedFaceElements):
897     case(DegreesOfFreedom):        Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);
898     case(ReducedDegreesOfFreedom):        break;
899     Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);        case(Points):
900     break;        Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);
901     case(Elements):        break;
902     case(ReducedElements):        case(ContactElementsZero):
903     Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);        case(ReducedContactElementsZero):
904     break;        Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);
905     case(FaceElements):        break;
906     case(ReducedFaceElements):        case(ContactElementsOne):
907     Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);        case(ReducedContactElementsOne):
908     break;        Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);
909     case(Points):        break;
910     Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);        default:
911     break;           stringstream temp;
912     case(ContactElementsZero):           temp << "Error - Interpolation on Domain: Finley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();
913     case(ReducedContactElementsZero):           throw FinleyAdapterException(temp.str());
914     Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);           break;
915     break;        }
    case(ContactElementsOne):  
    case(ReducedContactElementsOne):  
    Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);  
    break;  
    default:  
       stringstream temp;  
       temp << "Error - Interpolation on Domain: Finley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();  
       throw FinleyAdapterException(temp.str());  
916        break;        break;
    }  
    break;  
    case(Elements):  
    if (target.getFunctionSpace().getTypeCode()==Elements) {  
       Finley_Assemble_CopyElementData(mesh->Elements,&_target,&_in);  
    } else if (target.getFunctionSpace().getTypeCode()==ReducedElements) {  
       Finley_Assemble_AverageElementData(mesh->Elements,&_target,&_in);  
    } else {  
       throw FinleyAdapterException("Error - No interpolation with data on elements possible.");  
    }  
    break;  
    case(ReducedElements):  
    if (target.getFunctionSpace().getTypeCode()==ReducedElements) {  
       Finley_Assemble_CopyElementData(mesh->Elements,&_target,&_in);  
    } else {  
       throw FinleyAdapterException("Error - No interpolation with data on elements with reduced integration order possible.");  
    }  
    break;  
    case(FaceElements):  
    if (target.getFunctionSpace().getTypeCode()==FaceElements) {  
       Finley_Assemble_CopyElementData(mesh->FaceElements,&_target,&_in);  
    } else if (target.getFunctionSpace().getTypeCode()==ReducedFaceElements) {  
       Finley_Assemble_AverageElementData(mesh->FaceElements,&_target,&_in);  
    } else {  
       throw FinleyAdapterException("Error - No interpolation with data on face elements possible.");  
    }  
    break;  
    case(ReducedFaceElements):  
    if (target.getFunctionSpace().getTypeCode()==ReducedFaceElements) {  
       Finley_Assemble_CopyElementData(mesh->FaceElements,&_target,&_in);  
    } else {  
       throw FinleyAdapterException("Error - No interpolation with data on face elements with reduced integration order possible.");  
    }  
    break;  
    case(Points):  
    if (target.getFunctionSpace().getTypeCode()==Points) {  
       Finley_Assemble_CopyElementData(mesh->Points,&_target,&_in);  
    } else {  
       throw FinleyAdapterException("Error - No interpolation with data on points possible.");  
    }  
    break;  
    case(ContactElementsZero):  
    case(ContactElementsOne):  
    if (target.getFunctionSpace().getTypeCode()==ContactElementsZero || target.getFunctionSpace().getTypeCode()==ContactElementsOne) {  
       Finley_Assemble_CopyElementData(mesh->ContactElements,&_target,&_in);  
    } else if (target.getFunctionSpace().getTypeCode()==ReducedContactElementsZero || target.getFunctionSpace().getTypeCode()==ReducedContactElementsOne) {  
       Finley_Assemble_AverageElementData(mesh->ContactElements,&_target,&_in);  
    } else {  
       throw FinleyAdapterException("Error - No interpolation with data on contact elements possible.");  
    }  
    break;  
    case(ReducedContactElementsZero):  
    case(ReducedContactElementsOne):  
    if (target.getFunctionSpace().getTypeCode()==ReducedContactElementsZero || target.getFunctionSpace().getTypeCode()==ReducedContactElementsOne) {  
       Finley_Assemble_CopyElementData(mesh->ContactElements,&_target,&_in);  
    } else {  
       throw FinleyAdapterException("Error - No interpolation with data on contact elements with reduced integration order possible.");  
    }  
    break;  
    case(DegreesOfFreedom):        
    switch(target.getFunctionSpace().getTypeCode()) {  
    case(ReducedDegreesOfFreedom):  
    case(DegreesOfFreedom):  
    Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);  
    break;  
   
    case(Nodes):  
917     case(ReducedNodes):     case(ReducedNodes):
918     if (getMPISize()>1) {        switch(target.getFunctionSpace().getTypeCode()) {
919        escript::Data temp=escript::Data(in);        case(Nodes):
920        temp.expand();        case(ReducedNodes):
921        escriptDataC _in2 = temp.getDataC();        case(DegreesOfFreedom):
922        Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in2);        case(ReducedDegreesOfFreedom):
    } else {  
923        Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);        Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);
924     }        break;
925     break;        case(Elements):
926     case(Elements):        case(ReducedElements):
    case(ReducedElements):  
    if (getMPISize()>1) {  
       escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );  
       escriptDataC _in2 = temp.getDataC();  
       Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in2,&_target);  
    } else {  
927        Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);        Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);
928     }        break;
929     break;        case(FaceElements):
930     case(FaceElements):        case(ReducedFaceElements):
    case(ReducedFaceElements):  
    if (getMPISize()>1) {  
       escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );  
       escriptDataC _in2 = temp.getDataC();  
       Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in2,&_target);  
   
    } else {  
931        Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);        Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);
932     }        break;
933     break;        case(Points):
    case(Points):  
    if (getMPISize()>1) {  
       escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );  
       escriptDataC _in2 = temp.getDataC();  
    } else {  
934        Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);        Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);
935     }        break;
936     break;        case(ContactElementsZero):
937     case(ContactElementsZero):        case(ReducedContactElementsZero):
    case(ContactElementsOne):  
    case(ReducedContactElementsZero):  
    case(ReducedContactElementsOne):  
    if (getMPISize()>1) {  
       escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );  
       escriptDataC _in2 = temp.getDataC();  
       Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in2,&_target);  
    } else {  
938        Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);        Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);
    }  
    break;  
    default:  
       stringstream temp;  
       temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();  
       throw FinleyAdapterException(temp.str());  
939        break;        break;
940     }        case(ContactElementsOne):
941     break;        case(ReducedContactElementsOne):
942     case(ReducedDegreesOfFreedom):        Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);
943     switch(target.getFunctionSpace().getTypeCode()) {        break;
944     case(Nodes):        default:
945     throw FinleyAdapterException("Error - Finley does not support interpolation from reduced degrees of freedom to mesh nodes.");           stringstream temp;
946     break;           temp << "Error - Interpolation on Domain: Finley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();
947     case(ReducedNodes):           throw FinleyAdapterException(temp.str());
948     if (getMPISize()>1) {           break;
949        escript::Data temp=escript::Data(in);        }
950        temp.expand();        break;
       escriptDataC _in2 = temp.getDataC();  
       Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in2);  
    } else {  
       Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);  
    }  
    break;  
    case(DegreesOfFreedom):  
    throw FinleyAdapterException("Error - Finley does not support interpolation from reduced degrees of freedom to degrees of freedom");  
    break;  
    case(ReducedDegreesOfFreedom):  
    Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);  
    break;  
951     case(Elements):     case(Elements):
952          if (target.getFunctionSpace().getTypeCode()==Elements) {
953             Finley_Assemble_CopyElementData(mesh->Elements,&_target,&_in);
954          } else if (target.getFunctionSpace().getTypeCode()==ReducedElements) {
955             Finley_Assemble_AverageElementData(mesh->Elements,&_target,&_in);
956          } else {
957             throw FinleyAdapterException("Error - No interpolation with data on elements possible.");
958          }
959          break;
960     case(ReducedElements):     case(ReducedElements):
961     if (getMPISize()>1) {        if (target.getFunctionSpace().getTypeCode()==ReducedElements) {
962        escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );           Finley_Assemble_CopyElementData(mesh->Elements,&_target,&_in);
963        escriptDataC _in2 = temp.getDataC();        } else {
964        Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in2,&_target);           throw FinleyAdapterException("Error - No interpolation with data on elements with reduced integration order possible.");
965     } else {        }
966        Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);        break;
    }  
    break;  
967     case(FaceElements):     case(FaceElements):
968          if (target.getFunctionSpace().getTypeCode()==FaceElements) {
969             Finley_Assemble_CopyElementData(mesh->FaceElements,&_target,&_in);
970          } else if (target.getFunctionSpace().getTypeCode()==ReducedFaceElements) {
971             Finley_Assemble_AverageElementData(mesh->FaceElements,&_target,&_in);
972          } else {
973             throw FinleyAdapterException("Error - No interpolation with data on face elements possible.");
974          }
975          break;
976     case(ReducedFaceElements):     case(ReducedFaceElements):
977     if (getMPISize()>1) {        if (target.getFunctionSpace().getTypeCode()==ReducedFaceElements) {
978        escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );           Finley_Assemble_CopyElementData(mesh->FaceElements,&_target,&_in);
979        escriptDataC _in2 = temp.getDataC();        } else {
980        Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in2,&_target);           throw FinleyAdapterException("Error - No interpolation with data on face elements with reduced integration order possible.");
981     } else {        }
982        Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);        break;
    }  
    break;  
983     case(Points):     case(Points):
984     if (getMPISize()>1) {        if (target.getFunctionSpace().getTypeCode()==Points) {
985        escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );           Finley_Assemble_CopyElementData(mesh->Points,&_target,&_in);
986        escriptDataC _in2 = temp.getDataC();        } else {
987        Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in2,&_target);           throw FinleyAdapterException("Error - No interpolation with data on points possible.");
988     } else {        }
989        Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);        break;
    }  
    break;  
990     case(ContactElementsZero):     case(ContactElementsZero):
991     case(ContactElementsOne):     case(ContactElementsOne):
992          if (target.getFunctionSpace().getTypeCode()==ContactElementsZero || target.getFunctionSpace().getTypeCode()==ContactElementsOne) {
993             Finley_Assemble_CopyElementData(mesh->ContactElements,&_target,&_in);
994          } else if (target.getFunctionSpace().getTypeCode()==ReducedContactElementsZero || target.getFunctionSpace().getTypeCode()==ReducedContactElementsOne) {
995             Finley_Assemble_AverageElementData(mesh->ContactElements,&_target,&_in);
996          } else {
997             throw FinleyAdapterException("Error - No interpolation with data on contact elements possible.");
998          }
999          break;
1000     case(ReducedContactElementsZero):     case(ReducedContactElementsZero):
1001     case(ReducedContactElementsOne):     case(ReducedContactElementsOne):
1002     if (getMPISize()>1) {        if (target.getFunctionSpace().getTypeCode()==ReducedContactElementsZero || target.getFunctionSpace().getTypeCode()==ReducedContactElementsOne) {
1003        escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );           Finley_Assemble_CopyElementData(mesh->ContactElements,&_target,&_in);
1004        escriptDataC _in2 = temp.getDataC();        } else {
1005        Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in2,&_target);           throw FinleyAdapterException("Error - No interpolation with data on contact elements with reduced integration order possible.");
1006     } else {        }
1007        Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);        break;
1008     }     case(DegreesOfFreedom):      
1009     break;        switch(target.getFunctionSpace().getTypeCode()) {
1010     default:        case(ReducedDegreesOfFreedom):
1011        stringstream temp;        case(DegreesOfFreedom):
1012        temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();        Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);
1013        throw FinleyAdapterException(temp.str());        break;
1014      
1015          case(Nodes):
1016          case(ReducedNodes):
1017          if (getMPISize()>1) {
1018             escript::Data temp=escript::Data(in);
1019             temp.expand();
1020             escriptDataC _in2 = temp.getDataC();
1021             Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in2);
1022          } else {
1023             Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);
1024          }
1025          break;
1026          case(Elements):
1027          case(ReducedElements):
1028          if (getMPISize()>1) {
1029             escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );
1030             escriptDataC _in2 = temp.getDataC();
1031             Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in2,&_target);
1032          } else {
1033             Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);
1034          }
1035          break;
1036          case(FaceElements):
1037          case(ReducedFaceElements):
1038          if (getMPISize()>1) {
1039             escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );
1040             escriptDataC _in2 = temp.getDataC();
1041             Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in2,&_target);
1042      
1043          } else {
1044             Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);
1045          }
1046          break;
1047          case(Points):
1048          if (getMPISize()>1) {
1049             escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );
1050             escriptDataC _in2 = temp.getDataC();
1051          } else {
1052             Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);
1053          }
1054          break;
1055          case(ContactElementsZero):
1056          case(ContactElementsOne):
1057          case(ReducedContactElementsZero):
1058          case(ReducedContactElementsOne):
1059          if (getMPISize()>1) {
1060             escript::Data temp=escript::Data( in,  continuousFunction(asAbstractContinuousDomain()) );
1061             escriptDataC _in2 = temp.getDataC();
1062             Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in2,&_target);
1063          } else {
1064             Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);
1065          }
1066          break;
1067          default:
1068             stringstream temp;
1069             temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();
1070             throw FinleyAdapterException(temp.str());
1071             break;
1072          }
1073          break;
1074       case(ReducedDegreesOfFreedom):
1075          switch(target.getFunctionSpace().getTypeCode()) {
1076          case(Nodes):
1077          throw FinleyAdapterException("Error - Finley does not support interpolation from reduced degrees of freedom to mesh nodes.");
1078          break;
1079          case(ReducedNodes):
1080          if (getMPISize()>1) {
1081             escript::Data temp=escript::Data(in);
1082             temp.expand();
1083             escriptDataC _in2 = temp.getDataC();
1084             Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in2);
1085          } else {
1086             Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);
1087          }
1088          break;
1089          case(DegreesOfFreedom):
1090          throw FinleyAdapterException("Error - Finley does not support interpolation from reduced degrees of freedom to degrees of freedom");
1091          break;
1092          case(ReducedDegreesOfFreedom):
1093          Finley_Assemble_CopyNodalData(mesh->Nodes,&_target,&_in);
1094          break;
1095          case(Elements):
1096          case(ReducedElements):
1097          if (getMPISize()>1) {
1098             escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );
1099             escriptDataC _in2 = temp.getDataC();
1100             Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in2,&_target);
1101          } else {
1102             Finley_Assemble_interpolate(mesh->Nodes,mesh->Elements,&_in,&_target);
1103          }
1104          break;
1105          case(FaceElements):
1106          case(ReducedFaceElements):
1107          if (getMPISize()>1) {
1108             escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );
1109             escriptDataC _in2 = temp.getDataC();
1110             Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in2,&_target);
1111          } else {
1112             Finley_Assemble_interpolate(mesh->Nodes,mesh->FaceElements,&_in,&_target);
1113          }
1114          break;
1115          case(Points):
1116          if (getMPISize()>1) {
1117             escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );
1118             escriptDataC _in2 = temp.getDataC();
1119             Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in2,&_target);
1120          } else {
1121             Finley_Assemble_interpolate(mesh->Nodes,mesh->Points,&_in,&_target);
1122          }
1123          break;
1124          case(ContactElementsZero):
1125          case(ContactElementsOne):
1126          case(ReducedContactElementsZero):
1127          case(ReducedContactElementsOne):
1128          if (getMPISize()>1) {
1129             escript::Data temp=escript::Data( in,  reducedContinuousFunction(asAbstractContinuousDomain()) );
1130             escriptDataC _in2 = temp.getDataC();
1131             Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in2,&_target);
1132          } else {
1133             Finley_Assemble_interpolate(mesh->Nodes,mesh->ContactElements,&_in,&_target);
1134          }
1135          break;
1136          default:
1137             stringstream temp;
1138             temp << "Error - Interpolation On Domain: Finley does not know anything about function space type " << target.getFunctionSpace().getTypeCode();
1139             throw FinleyAdapterException(temp.str());
1140             break;
1141          }
1142        break;        break;
    }  
    break;  
1143     default:     default:
1144        stringstream temp;        stringstream temp;
1145        temp << "Error - 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();
# Line 1453  void MeshAdapter::setNewX(const escript: Line 1453  void MeshAdapter::setNewX(const escript:
1453     const MeshAdapter& newDomain=dynamic_cast<const MeshAdapter&>(*(new_x.getFunctionSpace().getDomain()));     const MeshAdapter& newDomain=dynamic_cast<const MeshAdapter&>(*(new_x.getFunctionSpace().getDomain()));
1454     if (newDomain!=*this)     if (newDomain!=*this)
1455        throw FinleyAdapterException("Error - Illegal domain of new point locations");        throw FinleyAdapterException("Error - Illegal domain of new point locations");
1456     tmp = new_x.getDataC();     if ( new_x.getFunctionSpace() == continuousFunction(asAbstractContinuousDomain()) ) {
1457     Finley_Mesh_setCoordinates(mesh,&tmp);         tmp = new_x.getDataC();
1458           Finley_Mesh_setCoordinates(mesh,&tmp);
1459       } else {
1460           escript::Data new_x_inter=escript::Data( new_x,  continuousFunction(asAbstractContinuousDomain()) );
1461           tmp = new_x_inter.getDataC();
1462           Finley_Mesh_setCoordinates(mesh,&tmp);
1463       }
1464     checkFinleyError();     checkFinleyError();
1465  }  }
1466    
# Line 1512  void MeshAdapter::saveDX(const std::stri Line 1518  void MeshAdapter::saveDX(const std::stri
1518  //  //
1519  // saves mesh and optionally data arrays in VTK format  // saves mesh and optionally data arrays in VTK format
1520  //  //
1521  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
1522  {  {
1523     int num_data;     int num_data;
1524     char **names;     char **names;
# Line 1520  void MeshAdapter::saveVTK(const std::str Line 1526  void MeshAdapter::saveVTK(const std::str
1526     escriptDataC **ptr_data;     escriptDataC **ptr_data;
1527    
1528     extractArgsFromDict(arg, num_data, names, data, ptr_data);     extractArgsFromDict(arg, num_data, names, data, ptr_data);
1529     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());
1530     checkFinleyError();     checkFinleyError();
1531    
1532     /* win32 refactor */     /* win32 refactor */
# Line 1858  escript::Data MeshAdapter::getSize() con Line 1864  escript::Data MeshAdapter::getSize() con
1864     return escript::function(asAbstractContinuousDomain()).getSize();     return escript::function(asAbstractContinuousDomain()).getSize();
1865  }  }
1866    
1867  int* MeshAdapter::borrowSampleReferenceIDs(int functionSpaceType) const  const int* MeshAdapter::borrowSampleReferenceIDs(int functionSpaceType) const
1868  {  {
1869     int *out = NULL;     int *out = NULL;
1870     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
# Line 2095  int MeshAdapter::getNumberOfTagsInUse(in Line 2101  int MeshAdapter::getNumberOfTagsInUse(in
2101    }    }
2102    return numTags;    return numTags;
2103  }  }
2104  int* MeshAdapter::borrowListOfTagsInUse(int functionSpaceCode) const  
2105    const int* MeshAdapter::borrowListOfTagsInUse(int functionSpaceCode) const
2106  {  {
2107    Finley_Mesh* mesh=m_finleyMesh.get();    Finley_Mesh* mesh=m_finleyMesh.get();
2108    index_t* tags=NULL;    index_t* tags=NULL;
# Line 2161  bool MeshAdapter::canTag(int functionSpa Line 2168  bool MeshAdapter::canTag(int functionSpa
2168    }    }
2169  }  }
2170    
2171    AbstractDomain::StatusType MeshAdapter::getStatus() const
2172    {
2173      Finley_Mesh* mesh=m_finleyMesh.get();
2174      return Finley_Mesh_getStatus(mesh);
2175    }
2176    
2177    
2178    
2179  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.2315  
changed lines
  Added in v.2548

  ViewVC Help
Powered by ViewVC 1.1.26