From 9ec7f6079adfce1d0db663db1612ab7d01ca70d0 Mon Sep 17 00:00:00 2001 From: Thomas Witkowski <thomas.witkowski@gmx.de> Date: Wed, 29 Apr 2009 11:12:57 +0000 Subject: [PATCH] This and that. --- AMDiS/src/BoundaryManager.cc | 9 +++------ AMDiS/src/Lagrange.cc | 9 ++++----- AMDiS/src/PeriodicBC.cc | 11 +++++------ AMDiS/src/ProblemScal.cc | 16 ++++++---------- AMDiS/src/StandardProblemIteration.cc | 18 ++++++------------ 5 files changed, 24 insertions(+), 39 deletions(-) diff --git a/AMDiS/src/BoundaryManager.cc b/AMDiS/src/BoundaryManager.cc index 8b7298b8..e8045734 100644 --- a/AMDiS/src/BoundaryManager.cc +++ b/AMDiS/src/BoundaryManager.cc @@ -14,9 +14,8 @@ namespace AMDiS { localBounds.resize(omp_get_overall_max_threads()); dofIndices.resize(omp_get_overall_max_threads()); allocatedMemoryLocalBounds = feSpace->getBasisFcts()->getNumber(); - for (int i = 0; i < static_cast<int>(localBounds.size()); i++) { + for (int i = 0; i < static_cast<int>(localBounds.size()); i++) localBounds[i] = GET_MEMORY(BoundaryType, allocatedMemoryLocalBounds); - } } BoundaryManager::BoundaryManager(BoundaryManager &bm) @@ -25,16 +24,14 @@ namespace AMDiS { allocatedMemoryLocalBounds = bm.allocatedMemoryLocalBounds; localBounds.resize(bm.localBounds.size()); dofIndices.resize(bm.localBounds.size()); - for (int i = 0; i < static_cast<int>(localBounds.size()); i++) { + for (int i = 0; i < static_cast<int>(localBounds.size()); i++) localBounds[i] = GET_MEMORY(BoundaryType, allocatedMemoryLocalBounds); - } } BoundaryManager::~BoundaryManager() { - for (int i = 0; i < static_cast<int>(localBounds.size()); i++) { + for (int i = 0; i < static_cast<int>(localBounds.size()); i++) FREE_MEMORY(localBounds[i], BoundaryType, allocatedMemoryLocalBounds); - } } double BoundaryManager::boundResidual(ElInfo *elInfo, diff --git a/AMDiS/src/Lagrange.cc b/AMDiS/src/Lagrange.cc index 39006e79..642e4204 100644 --- a/AMDiS/src/Lagrange.cc +++ b/AMDiS/src/Lagrange.cc @@ -919,12 +919,11 @@ namespace AMDiS { static int localVecSize = 0; const DegreeOfFreedom **dof = el->getDOF(); - const int *indi; + int nrDOFs, n0, node0, num = 0; GeoIndex posIndex; - DegreeOfFreedom* result; - + if (indices) { result = indices; } else { @@ -934,7 +933,7 @@ namespace AMDiS { localVecSize = nBasFcts; result = localVec; } - + for (int pos = 0, j = 0; pos <= dim; pos++) { posIndex = INDEX_OF_DIM(pos, dim); nrDOFs = admin->getNumberOfDOFs(posIndex); @@ -945,7 +944,7 @@ namespace AMDiS { num = Global::getGeo(posIndex, dim); for (int i = 0; i < num; node0++, i++) { - indi = orderOfPositionIndices(el, posIndex, i); + const int *indi = orderOfPositionIndices(el, posIndex, i); for (int k = 0; k < nrDOFs; k++) { result[j++] = dof[node0][n0 + indi[k]]; diff --git a/AMDiS/src/PeriodicBC.cc b/AMDiS/src/PeriodicBC.cc index 1e0dd5ed..3fd4f9de 100644 --- a/AMDiS/src/PeriodicBC.cc +++ b/AMDiS/src/PeriodicBC.cc @@ -131,10 +131,10 @@ namespace AMDiS { const BoundaryType *localBound, int nBasFcts) { - if(matrix == masterMatrix_) { + if (matrix == masterMatrix_) { int dim = rowFESpace->getMesh()->getDim(); - if(dim > 1) { + if (dim > 1) { int i, j; DOFAdmin *admin = rowFESpace->getAdmin(); @@ -153,11 +153,11 @@ namespace AMDiS { GeoIndex sideGeoIndex = INDEX_OF_DIM(dim-1, dim); - for(side = 0; side < dim + 1; side++) { + for (side = 0; side < dim + 1; side++) { - if(elInfo->getBoundary(sideGeoIndex, side) == boundaryType) { + if (elInfo->getBoundary(sideGeoIndex, side) == boundaryType) { - for(vertex = 0; vertex < dim; vertex++) { + for (vertex = 0; vertex < dim; vertex++) { index = element->getVertexOfPosition(sideGeoIndex, side, vertex); @@ -165,7 +165,6 @@ namespace AMDiS { } Element *neigh = elInfo->getNeighbour(side); - basFcts->getLocalIndices(neigh, admin, neighIndices_); int oppVertex = 0; diff --git a/AMDiS/src/ProblemScal.cc b/AMDiS/src/ProblemScal.cc index 6eed0b19..a91f5985 100644 --- a/AMDiS/src/ProblemScal.cc +++ b/AMDiS/src/ProblemScal.cc @@ -545,15 +545,6 @@ namespace AMDiS { MSG("%d DOFs for %s\n", feSpace->getAdmin()->getUsedDOFs(), feSpace->getName().c_str()); - Flag assembleFlag = - flag | - systemMatrix->getAssembleFlag() | - rhs->getAssembleFlag(); - - if (useGetBound) - assembleFlag |= Mesh::FILL_BOUND; - - // systemMatrix->clear(); rhs->set(0.0); DOFMatrix::base_matrix_type& base_matrix= systemMatrix->getBaseMatrix(); @@ -581,7 +572,12 @@ namespace AMDiS { BoundaryType *bound; TraverseStack stack; - ElInfo *elInfo = stack.traverseFirst(mesh, -1, assembleFlag); + ElInfo *elInfo = stack.traverseFirst(mesh, -1, Mesh::CALL_LEAF_EL | + Mesh::FILL_BOUND | + Mesh::FILL_COORDS | + Mesh::FILL_DET | + Mesh::FILL_GRD_LAMBDA | + Mesh::FILL_NEIGH); while (elInfo) { if (useGetBound) { diff --git a/AMDiS/src/StandardProblemIteration.cc b/AMDiS/src/StandardProblemIteration.cc index 5cf5785a..030e3d98 100644 --- a/AMDiS/src/StandardProblemIteration.cc +++ b/AMDiS/src/StandardProblemIteration.cc @@ -56,31 +56,25 @@ namespace AMDiS { markFlag = 3; } - if (toDo.isSet(BUILD)) { + if (toDo.isSet(BUILD)) problem_->buildBeforeRefine(adaptInfo, markFlag); - } // refine - if (toDo.isSet(ADAPT) && markFlag.isSet(MESH_REFINED)) { + if (toDo.isSet(ADAPT) && markFlag.isSet(MESH_REFINED)) flag = problem_->refineMesh(adaptInfo); - } - if (toDo.isSet(BUILD)) { + if (toDo.isSet(BUILD)) problem_->buildBeforeCoarsen(adaptInfo, markFlag); - } // coarsen - if (toDo.isSet(ADAPT) && markFlag.isSet(MESH_COARSENED)) { + if (toDo.isSet(ADAPT) && markFlag.isSet(MESH_COARSENED)) flag |= problem_->coarsenMesh(adaptInfo); - } - if (toDo.isSet(BUILD)) { + if (toDo.isSet(BUILD)) problem_->buildAfterCoarsen(adaptInfo, markFlag, true, true); - } - if (toDo.isSet(BUILD_RHS)) { + if (toDo.isSet(BUILD_RHS)) problem_->buildAfterCoarsen(adaptInfo, markFlag, false, true); - } return flag; } -- GitLab