| 880 | |
| 881 | |
| 882 | int |
| 883 | Subdomain::buildMap(void) |
| 884 | { |
| 885 | if (mapBuilt == false) { |
| 886 | // determine the mapping between local dof and subdomain ana dof |
| 887 | int numDOF = this->getNumDOF(); |
| 888 | if (map == 0) |
| 889 | map = new ID(numDOF); |
| 890 | if (map->Size() != numDOF) { |
| 891 | delete map; |
| 892 | map = new ID(numDOF); |
| 893 | } |
| 894 | |
| 895 | // int numExt = theAnalysis->getNumExternalEqn(); |
| 896 | int numInt = theAnalysis->getNumInternalEqn(); |
| 897 | |
| 898 | const ID &theExtNodes = this->getExternalNodes(); |
| 899 | int numExtNodes = theExtNodes.Size(); |
| 900 | int locInMap =0; |
| 901 | for (int i=0; i<numExtNodes; i++) { |
| 902 | Node *nodePtr = this->getNode(theExtNodes(i)); |
| 903 | int numNodeDOF = nodePtr->getNumberDOF(); |
| 904 | DOF_Group *theDOF = nodePtr->getDOF_GroupPtr(); |
| 905 | const ID &theLocalID = theDOF->getID(); |
| 906 | for (int j=0; j<numNodeDOF; j++){ |
| 907 | int locInSubdomainExt = theLocalID(j)-numInt; |
| 908 | (*map)(locInMap)=locInSubdomainExt; |
| 909 | locInMap++; |
| 910 | } |
| 911 | } |
| 912 | mapBuilt = true; |
| 913 | |
| 914 | if (mappedVect == 0) |
| 915 | mappedVect = new Vector(numDOF); |
| 916 | if (mappedVect->Size() != numDOF) { |
| 917 | delete mappedVect; |
| 918 | mappedVect = new Vector(numDOF); |
| 919 | } |
| 920 | |
| 921 | if (mappedMatrix == 0) |
| 922 | mappedMatrix = new Matrix(numDOF,numDOF); |
| 923 | if (mappedMatrix->noRows() != numDOF) { |
| 924 | delete mappedMatrix; |
| 925 | mappedMatrix = new Matrix(numDOF,numDOF); |
| 926 | } |
| 927 | } |
| 928 | |
| 929 | return 0; |
| 930 | } |
| 931 | |
| 932 | |
| 933 | DomainDecompositionAnalysis * |
no test coverage detected