/[escript]/trunk/finley/src/NodeFile.cpp
ViewVC logotype

Diff of /trunk/finley/src/NodeFile.cpp

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

revision 4813 by caltinay, Wed Mar 26 03:26:58 2014 UTC revision 4814 by caltinay, Fri Mar 28 04:31:02 2014 UTC
# Line 90  NodeFile::NodeFile(int nDim, Esys_MPIInf Line 90  NodeFile::NodeFile(int nDim, Esys_MPIInf
90      globalReducedDOFIndex(NULL),      globalReducedDOFIndex(NULL),
91      globalReducedNodesIndex(NULL),      globalReducedNodesIndex(NULL),
92      globalNodesIndex(NULL),      globalNodesIndex(NULL),
     nodesDistribution(NULL),  
     reducedNodesDistribution(NULL),  
     degreesOfFreedomDistribution(NULL),  
     reducedDegreesOfFreedomDistribution(NULL),  
93      degreesOfFreedomConnector(NULL),      degreesOfFreedomConnector(NULL),
94      reducedDegreesOfFreedomConnector(NULL),      reducedDegreesOfFreedomConnector(NULL),
95      reducedNodesId(NULL),      reducedNodesId(NULL),
# Line 165  void NodeFile::freeTable() Line 161  void NodeFile::freeTable()
161      reducedNodesMapping.clear();      reducedNodesMapping.clear();
162      degreesOfFreedomMapping.clear();      degreesOfFreedomMapping.clear();
163      reducedDegreesOfFreedomMapping.clear();      reducedDegreesOfFreedomMapping.clear();
164      Paso_Distribution_free(nodesDistribution);      nodesDistribution.reset();
165      nodesDistribution=NULL;      reducedNodesDistribution.reset();
166      Paso_Distribution_free(reducedNodesDistribution);      degreesOfFreedomDistribution.reset();
167      nodesDistribution=NULL;      reducedDegreesOfFreedomDistribution.reset();
     Paso_Distribution_free(degreesOfFreedomDistribution);  
     degreesOfFreedomDistribution=NULL;  
     Paso_Distribution_free(reducedDegreesOfFreedomDistribution);  
     reducedDegreesOfFreedomDistribution=NULL;  
168      paso::Connector_free(degreesOfFreedomConnector);      paso::Connector_free(degreesOfFreedomConnector);
169      degreesOfFreedomConnector=NULL;      degreesOfFreedomConnector=NULL;
170      paso::Connector_free(reducedDegreesOfFreedomConnector);      paso::Connector_free(reducedDegreesOfFreedomConnector);
# Line 797  int NodeFile::createDenseReducedLabeling Line 789  int NodeFile::createDenseReducedLabeling
789    
790  void NodeFile::createDOFMappingAndCoupling(bool use_reduced_elements)  void NodeFile::createDOFMappingAndCoupling(bool use_reduced_elements)
791  {  {
792      Paso_Distribution* dof_distribution;      paso::Distribution_ptr dof_distribution;
793      const int* globalDOFIndex;      const int* globalDOFIndex;
794      if (use_reduced_elements) {      if (use_reduced_elements) {
795          dof_distribution=reducedDegreesOfFreedomDistribution;          dof_distribution=reducedDegreesOfFreedomDistribution;
# Line 806  void NodeFile::createDOFMappingAndCoupli Line 798  void NodeFile::createDOFMappingAndCoupli
798          dof_distribution=degreesOfFreedomDistribution;          dof_distribution=degreesOfFreedomDistribution;
799          globalDOFIndex=globalDegreesOfFreedom;          globalDOFIndex=globalDegreesOfFreedom;
800      }      }
801      const int myFirstDOF=Paso_Distribution_getFirstComponent(dof_distribution);      const int myFirstDOF=dof_distribution->getFirstComponent();
802      const int myLastDOF=Paso_Distribution_getLastComponent(dof_distribution);      const int myLastDOF=dof_distribution->getLastComponent();
803      const int mpiSize=MPIInfo->size;      const int mpiSize=MPIInfo->size;
804      const int myRank=MPIInfo->rank;      const int myRank=MPIInfo->rank;
805    
# Line 1071  void NodeFile::createNodeMappings(const Line 1063  void NodeFile::createNodeMappings(const
1063      rdofDist[mpiSize]=globalNumReducedDOF;      rdofDist[mpiSize]=globalNumReducedDOF;
1064    
1065      // ==== distribution of Nodes ===============================      // ==== distribution of Nodes ===============================
1066      nodesDistribution=Paso_Distribution_alloc(MPIInfo, &nodeDist[0], 1, 0);      nodesDistribution.reset(new paso::Distribution(MPIInfo, &nodeDist[0], 1, 0));
1067      // ==== distribution of DOFs ================================      // ==== distribution of DOFs ================================
1068      degreesOfFreedomDistribution=Paso_Distribution_alloc(MPIInfo, &dofDist[0], 1,0);      degreesOfFreedomDistribution.reset(new paso::Distribution(MPIInfo, &dofDist[0], 1, 0));
1069      // ==== distribution of reduced Nodes =======================      // ==== distribution of reduced Nodes =======================
1070      reducedNodesDistribution=Paso_Distribution_alloc(MPIInfo, &rnodeDist[0], 1, 0);      reducedNodesDistribution.reset(new paso::Distribution(MPIInfo, &rnodeDist[0], 1, 0));
1071      // ==== distribution of reduced DOF =========================      // ==== distribution of reduced DOF =========================
1072      reducedDegreesOfFreedomDistribution=Paso_Distribution_alloc(MPIInfo, &rdofDist[0], 1, 0);      reducedDegreesOfFreedomDistribution.reset(new paso::Distribution(
1073                                                    MPIInfo, &rdofDist[0], 1, 0));
1074    
1075      std::vector<int> nodeMask(numNodes);      std::vector<int> nodeMask(numNodes);
1076    
# Line 1120  void NodeFile::createNodeMappings(const Line 1113  void NodeFile::createNodeMappings(const
1113               reducedDegreesOfFreedomId[i]=Id[reducedDegreesOfFreedomMapping.map[i]];               reducedDegreesOfFreedomId[i]=Id[reducedDegreesOfFreedomMapping.map[i]];
1114          }          }
1115      } else {      } else {
1116          Paso_Distribution_free(nodesDistribution);          nodesDistribution.reset();
1117          Paso_Distribution_free(reducedNodesDistribution);          reducedNodesDistribution.reset();
1118          Paso_Distribution_free(degreesOfFreedomDistribution);          degreesOfFreedomDistribution.reset();
1119          Paso_Distribution_free(reducedDegreesOfFreedomDistribution);          reducedDegreesOfFreedomDistribution.reset();
1120          paso::Connector_free(degreesOfFreedomConnector);          paso::Connector_free(degreesOfFreedomConnector);
1121          paso::Connector_free(reducedDegreesOfFreedomConnector);          paso::Connector_free(reducedDegreesOfFreedomConnector);
         nodesDistribution=NULL;  
         reducedNodesDistribution=NULL;  
         degreesOfFreedomDistribution=NULL;  
         reducedDegreesOfFreedomDistribution=NULL;  
1122          degreesOfFreedomConnector=NULL;          degreesOfFreedomConnector=NULL;
1123          reducedDegreesOfFreedomConnector=NULL;          reducedDegreesOfFreedomConnector=NULL;
1124      }      }

Legend:
Removed from v.4813  
changed lines
  Added in v.4814

  ViewVC Help
Powered by ViewVC 1.1.26