diff --git a/AMDiS/src/CoarseningManager3d.cc b/AMDiS/src/CoarseningManager3d.cc index 85bd84e0e8cb20a2f819d7465df99b9b7cbd9a00..acd78fefd0facb2209147f1c27a48d03e9bd3589 100644 --- a/AMDiS/src/CoarseningManager3d.cc +++ b/AMDiS/src/CoarseningManager3d.cc @@ -129,8 +129,7 @@ namespace AMDiS { int edgeNo1 = el->getEdgeOfChild(1, i, elInfo2->getType()); bool refineChildFirst = - !(i > 0 && - (edgeNo0 >= 0 && !el2->getChild(0)->isLeaf()) || + !((i > 0 && (edgeNo0 >= 0 && !el2->getChild(0)->isLeaf())) || (edgeNo1 >= 0 && !el2->getChild(1)->isLeaf())); if (refineChildFirst) { diff --git a/AMDiS/src/ElInfo.cc b/AMDiS/src/ElInfo.cc index ce3212bb509eb67d7bcb4ba4bcd3483cf4c4f57d..e594269fa50fa8b8e1f04a247b9df4831b079168 100644 --- a/AMDiS/src/ElInfo.cc +++ b/AMDiS/src/ElInfo.cc @@ -218,7 +218,7 @@ namespace AMDiS { int i = 0; for (; i < refinementPathLength; i++) { - elInfo[(i+1)%2]->fillElInfo(static_cast<int>((refinementPath & (1<<i)) == (1<<i)), elInfo[i%2]); + elInfo[(i+1)%2]->fillElInfo(static_cast<int>((refinementPath & (1<<i)) == static_cast<unsigned long>(1<<i)), elInfo[i%2]); } if (i%2 == 0) *this = *elInfo[0]; diff --git a/AMDiS/src/ProblemStatDbg.cc b/AMDiS/src/ProblemStatDbg.cc index 18d453ed2823c53ff5cd197b051f644a111edfca..3009b78bfaaa5d04284d7bdb0d0a7913b1b27cf4 100644 --- a/AMDiS/src/ProblemStatDbg.cc +++ b/AMDiS/src/ProblemStatDbg.cc @@ -128,9 +128,9 @@ namespace AMDiS { { using mtl::tag::major; using mtl::tag::nz; using mtl::begin; using mtl::end; namespace traits = mtl::traits; - typedef DOFMatrix::base_matrix_type Matrix; - typedef traits::range_generator<major, Matrix>::type cursor_type; - typedef traits::range_generator<nz, cursor_type>::type icursor_type; +// typedef DOFMatrix::base_matrix_type Matrix; +// typedef traits::range_generator<major, Matrix>::type cursor_type; +// typedef traits::range_generator<nz, cursor_type>::type icursor_type; // Create a map from coords of all DOFs, to the DOF indices in this problem. CoordToDof coordToDof; diff --git a/AMDiS/src/RefinementManager3d.cc b/AMDiS/src/RefinementManager3d.cc index c7081aa863acfcc140ae1e71daaf12572a1954ea..c11e9e14dad72214734106a46b2b63c8ef66599f 100644 --- a/AMDiS/src/RefinementManager3d.cc +++ b/AMDiS/src/RefinementManager3d.cc @@ -686,7 +686,7 @@ namespace AMDiS { // === of this edge to the refinement patch. === for (int edgeIndex = 0; - edgeIndex < static_cast<unsigned int>(refineEdges.size()); edgeIndex++) { + edgeIndex < static_cast<int>(refineEdges.size()); edgeIndex++) { Element *otherEl = refineEdges[edgeIndex].first; TraverseStack stack2; ElInfo *elInfo2 = diff --git a/AMDiS/src/ZeroOrderTerm.h b/AMDiS/src/ZeroOrderTerm.h index a1dfa8ec1b830bad32dfc074297eff69ff703518..5c0dc44632e62ab1030972839218b6c835a84bbf 100644 --- a/AMDiS/src/ZeroOrderTerm.h +++ b/AMDiS/src/ZeroOrderTerm.h @@ -129,14 +129,15 @@ namespace AMDiS { /// DOFVector to be evaluated at quadrature points. DOFVectorBase<double>* vec; + /// Function for c. + AbstractFunction<double, double> *f; + /// Constant factor of zero order term. double factor; /// Vector v at quadrature points. mtl::dense_vector<double> vecAtQPs; - /// Function for c. - AbstractFunction<double, double> *f; }; @@ -176,6 +177,10 @@ namespace AMDiS { /// DOFVectorBase to be evaluated at quadrature points. DOFVectorBase<double>* vec1; DOFVectorBase<double>* vec2; + + /// Function for c. + AbstractFunction<double, double> *f1; + AbstractFunction<double, double> *f2; /// Constant factor of zero order term. double factor; @@ -183,10 +188,6 @@ namespace AMDiS { /// Vector v at quadrature points. mtl::dense_vector<double> vecAtQPs1; mtl::dense_vector<double> vecAtQPs2; - - /// Function for c. - AbstractFunction<double, double> *f1; - AbstractFunction<double, double> *f2; }; @@ -232,6 +233,9 @@ namespace AMDiS { DOFVectorBase<double>* vec1; /// Second DOFVector to be evaluated at quadrature points. DOFVectorBase<double>* vec2; + + /// Function for c. + BinaryAbstractFunction<double, double, double> *f; /// Constant factor of zero order term. double factor; @@ -240,9 +244,6 @@ namespace AMDiS { mtl::dense_vector<double> vecAtQPs1; /// Values of the second DOFVector at the quadrature points. mtl::dense_vector<double> vecAtQPs2; - - /// Function for c. - BinaryAbstractFunction<double, double, double> *f; }; @@ -281,15 +282,15 @@ namespace AMDiS { protected: /// DOFVectors to be evaluated at quadrature points. DOFVectorBase<double> *vec1, *vec2, *vec3; + + /// Function for c. + TertiaryAbstractFunction<double, double, double, double> *f; /// Constant factor of zero order term. double factor; /// Vectors at quadrature points. mtl::dense_vector<double> vecAtQPs1, vecAtQPs2, vecAtQPs3; - - /// Function for c. - TertiaryAbstractFunction<double, double, double, double> *f; }; diff --git a/AMDiS/src/parallel/CheckerPartitioner.cc b/AMDiS/src/parallel/CheckerPartitioner.cc index f70a08a2521b97e0eb59027b29a7238410da8af1..1d2ec582f9b1b1e3dd2e2302a79844f6ef061e13 100644 --- a/AMDiS/src/parallel/CheckerPartitioner.cc +++ b/AMDiS/src/parallel/CheckerPartitioner.cc @@ -68,15 +68,17 @@ namespace AMDiS { namespace Parallel { elInfo = stack.traverseNext(elInfo); } - if (mesh->getDim() == 2) + if (mesh->getDim() == 2) { TEST_EXIT(elCounter == 2 * mpiSize * mpiSize) ("The number of macro elements is %d, but must be %d for %d number of nodes!", elCounter, 2 * mpiSize * mpiSize, mpiSize); + } - if (mesh->getDim() == 3) + if (mesh->getDim() == 3) { TEST_EXIT(elCounter == 6 * static_cast<int>(pow(mpiSize, 1.5))) ("The number of macro elements is %d, but must be %d for %d number of nodes!", elCounter, 6 * static_cast<int>(pow(mpiSize, 1.5)), mpiSize); + } } @@ -225,8 +227,8 @@ namespace AMDiS { namespace Parallel { while (elInfo) { TEST_EXIT(elInfo->getLevel() == 0)("Should not happen!\n"); - Element *el = elInfo->getElement(); - int elIndex = el->getIndex(); +// Element *el = elInfo->getElement(); +// int elIndex = el->getIndex(); int zeroCoordCounter = 0; for (int i = 0; i < mesh->getGeo(VERTEX); i++) @@ -252,7 +254,7 @@ namespace AMDiS { namespace Parallel { mpiSize, stripes.size()); int testElementCounter = 0; - for (int stripe = 0; stripe < stripes.size(); stripe++) { + for (size_t stripe = 0; stripe < stripes.size(); stripe++) { MacroElement *mel = stripes[stripe][0]; set<int> localDofs; @@ -321,8 +323,8 @@ namespace AMDiS { namespace Parallel { TEST_EXIT(testElementCounter == nElements)("Should not happen!\n"); - int elsPerStripe = stripes[0].size(); - for (int i = 0; i < stripes.size(); i++) { + size_t elsPerStripe = stripes[0].size(); + for (size_t i = 0; i < stripes.size(); i++) { TEST_EXIT(stripes[i].size() == elsPerStripe) ("Should not happen!\n"); } @@ -330,18 +332,18 @@ namespace AMDiS { namespace Parallel { // === Computing mapping from macro element indices to ranks === - int nStripes = elInStripe.size(); - int procPerStripe = mpiSize / nStripes; - int elsPerRank = elsPerStripe / procPerStripe; + size_t nStripes = elInStripe.size(); + size_t procPerStripe = mpiSize / nStripes; + size_t elsPerRank = elsPerStripe / procPerStripe; TEST_EXIT(mpiSize % nStripes == 0)("Should not happen!\n"); TEST_EXIT(elsPerStripe % procPerStripe == 0)("Should not happen!\n"); elStripeInRank.clear(); int rankCount = 0; - for (int i = 0; i < nStripes; i++) { - for (int j = 0; j < procPerStripe; j++) { - for (int k = 0; k < elsPerRank; k++) + for (size_t i = 0; i < nStripes; i++) { + for (size_t j = 0; j < procPerStripe; j++) { + for (size_t k = 0; k < elsPerRank; k++) elStripeInRank[elInStripe[i][j * elsPerRank + k]] = rankCount; rankCount++; } diff --git a/AMDiS/src/parallel/DofComm.cc b/AMDiS/src/parallel/DofComm.cc index 84505221e846403a992802b2a5f4685e15e6cb40..550adde7cfd91d40bed3bb16549098b442d4569a 100644 --- a/AMDiS/src/parallel/DofComm.cc +++ b/AMDiS/src/parallel/DofComm.cc @@ -105,14 +105,18 @@ namespace AMDiS { namespace Parallel { DofContainerSet dofSet; DofContainer dofVec; - for (DataIter rankIt = data.begin(); rankIt != data.end(); ++rankIt) + for (DataIter rankIt = data.begin(); rankIt != data.end(); ++rankIt) { for (FeMapIter feIt = rankIt->second.begin(); - feIt != rankIt->second.end(); ++feIt) - if (feIt->first == feSpace) - if (countDouble) + feIt != rankIt->second.end(); ++feIt) { + if (feIt->first == feSpace) { + if (countDouble) { dofVec.insert(dofVec.end(), feIt->second.begin(), feIt->second.end()); - else + } else { dofSet.insert(feIt->second.begin(), feIt->second.end()); + } + } + } + } if (countDouble) return static_cast<int>(dofVec.size()); diff --git a/AMDiS/src/parallel/ElementObjectDatabase.cc b/AMDiS/src/parallel/ElementObjectDatabase.cc index 50a4fe8c66447b6097ee5e0701454f6785f37c76..a1f4b9f8f6bced0b80a85e610e2980e8a02aea05 100644 --- a/AMDiS/src/parallel/ElementObjectDatabase.cc +++ b/AMDiS/src/parallel/ElementObjectDatabase.cc @@ -703,9 +703,11 @@ namespace AMDiS { namespace Parallel { case FACE: return getOwner(faceElements[faceIter->first], level); break; + default: + ERROR_EXIT("There is something reallllly wrong!\n"); + return -1; } - ERROR_EXIT("There is something reallllly wrong!\n"); return -1; } @@ -1134,7 +1136,7 @@ namespace AMDiS { namespace Parallel { const unsigned int vectorOverhead = sizeof(vector<int>); const unsigned int mapOverhead = 48; //sizeof(_Rb_tree<int, int>); const unsigned int flatMapOverhead = 24; - const unsigned int mapEntryOverhead = 40; // sizeof(_Rb_tree_node_base); +// const unsigned int mapEntryOverhead = 40; // sizeof(_Rb_tree_node_base); const unsigned int setOverhead = 48; const unsigned int setEntryOverhead = 40; diff --git a/AMDiS/src/parallel/InteriorBoundary.cc b/AMDiS/src/parallel/InteriorBoundary.cc index 6e38a4abac712db6af70880f562d3265c984c6d1..bfdfc94da8ca14f5ae86975234840b835e7f3a08 100644 --- a/AMDiS/src/parallel/InteriorBoundary.cc +++ b/AMDiS/src/parallel/InteriorBoundary.cc @@ -52,7 +52,7 @@ namespace AMDiS { namespace Parallel { if (mpiComm == MPI::COMM_SELF) return; - int levelMpiRank = mpiComm.Get_rank(); +// int levelMpiRank = mpiComm.Get_rank(); int globalMpiRank = MPI::COMM_WORLD.Get_rank(); std::set<int> levelRanks = levelData.getLevelRanks(level); diff --git a/AMDiS/src/parallel/MatrixNnzStructure.cc b/AMDiS/src/parallel/MatrixNnzStructure.cc index 38e42dd6d26b49c7678ac2bd247a8c979e6904dc..0310af5ea1596301b31561863eddc32c18f628f6 100644 --- a/AMDiS/src/parallel/MatrixNnzStructure.cc +++ b/AMDiS/src/parallel/MatrixNnzStructure.cc @@ -72,7 +72,7 @@ namespace AMDiS { namespace Parallel { typedef traits::range_generator<nz, cursor_type>::type icursor_type; typedef vector<pair<int, int> > MatrixNnzEntry; - typedef map<int, DofContainer> RankToDofContainer; +// typedef map<int, DofContainer> RankToDofContainer; // Stores to each rank a list of nnz entries (i.e. pairs of row and column // index) that this rank will send to. These nnz entries will be assembled @@ -229,7 +229,7 @@ namespace AMDiS { namespace Parallel { vector<int> newCols; perMap->mapDof(colFeSpace, colDofIndex.global, perColAsc, newCols); - for (int aa = 0; aa < newCols.size(); aa++) { + for (size_t aa = 0; aa < newCols.size(); aa++) { int petscColIdx = colDofMap.getMatIndex(colComp, newCols[aa]); // The row DOF is a rank DOF, if also the column is a rank DOF, diff --git a/AMDiS/src/parallel/MeshDistributor.cc b/AMDiS/src/parallel/MeshDistributor.cc index 1e73523451abbdb85c8aeb8900352b7cee4dbae3..3ecb9a43b6e9adeb118e3bc87f61aa2a824a637e 100644 --- a/AMDiS/src/parallel/MeshDistributor.cc +++ b/AMDiS/src/parallel/MeshDistributor.cc @@ -445,7 +445,7 @@ namespace AMDiS { namespace Parallel { map<int, int> arhElInRank; map<int, int> arhElCodeSize; - int nProc = ArhReader::readMetaData(filename, arhElInRank, arhElCodeSize); + /*int nProc = */ArhReader::readMetaData(filename, arhElInRank, arhElCodeSize); for (map<int, int>::iterator it = arhElCodeSize.begin(); it != arhElCodeSize.end(); ++it) elemWeights[it->first] = it->second; @@ -1117,7 +1117,9 @@ namespace AMDiS { namespace Parallel { bool meshChanged = false; // === Check the boundaries and adapt mesh if necessary. === - MSG_DBG("Run checkAndAdaptBoundary ...\n"); +#if (DEBUG != 0) + MSG("Run checkAndAdaptBoundary ...\n"); +#endif // Check for periodic boundaries within rank's subdomain. for (InteriorBoundary::iterator it(intBoundary[0].getPeriodic()); @@ -1170,7 +1172,9 @@ namespace AMDiS { namespace Parallel { if (repartitioningFailed > 0) { - MSG_DBG("Repartitioning not tried because it has failed in the past!\n"); +#if (DEBUG != 0) + MSG("Repartitioning not tried because it has failed in the past!\n"); +#endif repartitioningFailed--; } else if (tryRepartition && diff --git a/AMDiS/src/parallel/MeshManipulation.cc b/AMDiS/src/parallel/MeshManipulation.cc index c2abfdbe7c4ad36ea7edc8a82baa07a6ae37020e..edbb27e25cddaf8f402f726f542335cf3093c109 100644 --- a/AMDiS/src/parallel/MeshManipulation.cc +++ b/AMDiS/src/parallel/MeshManipulation.cc @@ -315,8 +315,10 @@ namespace AMDiS { namespace Parallel { // Create traverse stack and traverse within the mesh until the element, // which should be fitted to the mesh structure code, is reached. TraverseStack stack; +#if (DEBUG != 0) ElInfo *elInfo = stack.traverseFirstOneMacro(mesh, boundEl.elIndex, -1, traverseFlag); +#endif TEST_EXIT_DBG(elInfo->getElement() == boundEl.el) ("This should not happen!\n"); diff --git a/AMDiS/src/parallel/ParMetisPartitioner.cc b/AMDiS/src/parallel/ParMetisPartitioner.cc index db622883f47b33226a53d7c0e38b27f44593e931..fd85f60c4471ec4533660b5cfb8610075bd38531 100644 --- a/AMDiS/src/parallel/ParMetisPartitioner.cc +++ b/AMDiS/src/parallel/ParMetisPartitioner.cc @@ -307,7 +307,7 @@ namespace AMDiS { namespace Parallel { for (int i = 0; i < mpiSize; i++) tpwgts[i] = 1.0 / static_cast<double>(nparts); - float scale = 10000.0 / maxWgt; +// float scale = 10000.0 / maxWgt; for (int i = 0; i < nElements; i++) wgts[i] = floatWgts[i]; // wgts[i] = static_cast<int>(floatWgts[i] * scale); diff --git a/AMDiS/src/parallel/ParallelCoarseSpaceSolver.cc b/AMDiS/src/parallel/ParallelCoarseSpaceSolver.cc index fbaf02880c8b3eddc2b2ecddc1341b1ffb690d74..88cb0def56bc98903f707de65338d8632955d26a 100644 --- a/AMDiS/src/parallel/ParallelCoarseSpaceSolver.cc +++ b/AMDiS/src/parallel/ParallelCoarseSpaceSolver.cc @@ -29,11 +29,11 @@ namespace AMDiS { namespace Parallel { ParallelCoarseSpaceSolver::ParallelCoarseSpaceSolver(string name) : ParallelSolver(name, true), - initFileStr(name), lastMeshNnz(-1), alwaysCreateNnzStructure(false), rStartInterior(0), - nGlobalOverallInterior(0) + nGlobalOverallInterior(0), + initFileStr(name) { Parameters::get("parallel->always create nnz structure", alwaysCreateNnzStructure); diff --git a/AMDiS/src/parallel/ParallelDebug.cc b/AMDiS/src/parallel/ParallelDebug.cc index ea10b7f8af3c734dd12f821a67e165172ebc3373..66d5ee7e7085d48e30af807ee0104f90973e9404 100644 --- a/AMDiS/src/parallel/ParallelDebug.cc +++ b/AMDiS/src/parallel/ParallelDebug.cc @@ -45,7 +45,7 @@ namespace AMDiS { namespace Parallel { MPI::Intracomm &mpiComm = pdb.levelData.getMpiComm(0); int mpiRank = mpiComm.Get_rank(); - MPI::Request request[pdb.intBoundary[0].own.size() + + MPI::Request *request = new MPI::Request[pdb.intBoundary[0].own.size() + pdb.intBoundary[0].other.size() + pdb.intBoundary[0].periodic.size() * 2]; int requestCounter = 0; @@ -152,6 +152,8 @@ namespace AMDiS { namespace Parallel { delete [] recvBuffers[bufCounter++]; } + + delete[] request; } @@ -179,7 +181,6 @@ namespace AMDiS { namespace Parallel { it != perMap.periodicDofAssociations[feSpace].end(); ++it) { WorldVector<double> c; pdb.mesh->getDofIndexCoords(it->first, pdb.feSpaces[0], c); - int nAssoc = it->second.size(); } @@ -366,12 +367,12 @@ namespace AMDiS { namespace Parallel { int mpiSize = mpiComm.Get_size(); std::set<int> &ranks = pdb.levelData.getLevelRanks(level); - TEST_EXIT(mpiSize == ranks.size()) + TEST_EXIT(mpiSize == static_cast<int>(ranks.size())) ("Wrong mpi sizes: Get_size() = %d ranks.size() = %d\n", mpiSize, ranks.size()); /// Defines a mapping type from rank numbers to sets of DOFs. - typedef map<int, DofContainer> RankToDofContainer; +// typedef map<int, DofContainer> RankToDofContainer; // Maps to each neighbour rank an array of WorldVectors. This array contains the // coordinates of all DOFs this rank shares on the interior boundary with the @@ -400,7 +401,7 @@ namespace AMDiS { namespace Parallel { map<int, int> sendSize; map<int, int> recvSize; map<int, int> recvSizeBuffer; - MPI::Request request[(mpiSize - 1) * 2]; + MPI::Request *request = new MPI::Request[(mpiSize - 1) * 2]; int requestCounter = 0; for (RankToCoords::iterator it = sendCoords.begin(); it != sendCoords.end(); ++it) @@ -441,6 +442,8 @@ namespace AMDiS { namespace Parallel { mpi::globalAdd(foundError); TEST_EXIT(foundError == 0)("Error found on at least on rank!\n"); + delete[] request; + // === Now we know that the number of send and received DOFs fits together. === // === So we can check if also the coordinates of the communicated DOFs are === // === the same on both corresponding ranks. === @@ -514,8 +517,8 @@ namespace AMDiS { namespace Parallel { if (mpiComm == MPI::COMM_SELF) continue; - int mpiRank = mpiComm.Get_rank(); - int mpiSize = mpiComm.Get_size(); +// int mpiRank = mpiComm.Get_rank(); +// int mpiSize = mpiComm.Get_size(); typedef map<int, WorldVector<double> > CoordsIndexMap; CoordsIndexMap coordsToIndex; diff --git a/AMDiS/src/parallel/ParallelDofMapping.cc b/AMDiS/src/parallel/ParallelDofMapping.cc index 5017d17e2127b192cd78149013ffe915dec5f4ae..6ae8be433a06ee95f26f680a1e54bf8307e8b536 100644 --- a/AMDiS/src/parallel/ParallelDofMapping.cc +++ b/AMDiS/src/parallel/ParallelDofMapping.cc @@ -108,8 +108,6 @@ namespace AMDiS { namespace Parallel { TEST_EXIT_DBG(dofComm)("No DOF communicator defined!\n"); - typedef map<int, map<const FiniteElemSpace*, DofContainer> >::iterator it_type; - // === Send all global indices of DOFs that are owned by the rank to all === // === other ranks that also include this DOF. === diff --git a/AMDiS/src/parallel/PetscHelper.cc b/AMDiS/src/parallel/PetscHelper.cc index 500f9393e0d3cd5201a4e7b68aa623deb2f204c6..36461460088a49f784f5156fd82c98ac1947298a 100644 --- a/AMDiS/src/parallel/PetscHelper.cc +++ b/AMDiS/src/parallel/PetscHelper.cc @@ -177,7 +177,9 @@ namespace AMDiS int firstRow = firstRow0 + firstRow1; int mpiSize = MPI::COMM_WORLD.Get_size(); +#if (DEBUG != 0) int mpiRank = MPI::COMM_WORLD.Get_rank(); +#endif vector<int> allFirstRow0(mpiSize + 1, 0); vector<int> allFirstRow1(mpiSize + 1, 0); MPI::COMM_WORLD.Allgather(&nRankRows0, 1, MPI_INT, &(allFirstRow0[1]), 1, MPI_INT); diff --git a/AMDiS/src/parallel/PetscSolverCahnHilliard.cc b/AMDiS/src/parallel/PetscSolverCahnHilliard.cc index afae5aba3d2927c15dfd5de9548765594fdc360a..02c0c6efe6c6f8f15e9dcc695fbb6eae36badecf 100644 --- a/AMDiS/src/parallel/PetscSolverCahnHilliard.cc +++ b/AMDiS/src/parallel/PetscSolverCahnHilliard.cc @@ -78,6 +78,7 @@ namespace AMDiS { namespace Parallel { VecDestroy(&y1); VecDestroy(&y2); + PetscFunctionReturn(0); } diff --git a/AMDiS/src/parallel/PetscSolverCahnHilliard2.cc b/AMDiS/src/parallel/PetscSolverCahnHilliard2.cc index 2e132d87866aacef8947512cb9ce05f124007db1..70d4b3b92375ffd0d7762fce5fca692940eb78eb 100644 --- a/AMDiS/src/parallel/PetscSolverCahnHilliard2.cc +++ b/AMDiS/src/parallel/PetscSolverCahnHilliard2.cc @@ -43,6 +43,8 @@ namespace AMDiS { namespace Parallel { KSPSolve(data->kspMplusK, b, y1); MatMult(data->matMass, y1, y2); KSPSolve(data->kspMplusK, y2, x); + + PetscFunctionReturn(0); } /// solve Cahn-Hilliard Preconditioner @@ -79,6 +81,8 @@ namespace AMDiS { namespace Parallel { MatDestroy(&S); MatDestroy(&K); KSPDestroy(&kspS); + + PetscFunctionReturn(0); } @@ -139,8 +143,6 @@ namespace AMDiS { namespace Parallel { MPI::COMM_WORLD.Barrier(); double wtime = MPI::Wtime(); - int dim = componentSpaces[0]->getMesh()->getDim(); - vector<int> chPotentialComponent; chPotentialComponent.push_back(0); vector<int> chSchurComponent; diff --git a/AMDiS/src/parallel/PetscSolverFeti.cc b/AMDiS/src/parallel/PetscSolverFeti.cc index e51a9819eed422988a3bf80e87c54c03ac9f7b79..83991b7e58e84f9e8797261171aab4bebc044a3a 100644 --- a/AMDiS/src/parallel/PetscSolverFeti.cc +++ b/AMDiS/src/parallel/PetscSolverFeti.cc @@ -49,15 +49,15 @@ namespace AMDiS { namespace Parallel { schurPrimalSolver(0), levelMode(1), subDomainIsLocal(true), + subdomain(NULL), + massMatrixSolver(NULL), printTimings(false), augmentedLagrange(false), nRankEdges(0), nOverallEdges(0), dirichletMode(0), stokesMode(false), - pressureComponent(-1), - subdomain(NULL), - massMatrixSolver(NULL) + pressureComponent(-1) { FUNCNAME("PetscSolverFeti::PetscSolverFeti()"); @@ -147,7 +147,9 @@ namespace AMDiS { namespace Parallel { { FUNCNAME("PetscSolverFeti::initialize()"); - MSG_DBG("Init FETI-DP on mesh level %d\n", meshLevel); +#if (DEBUG != 0) + MSG("Init FETI-DP on mesh level %d\n", meshLevel); +#endif TEST_EXIT_DBG(meshLevel + 2 <= meshDistributor->getMeshLevelData().getNumberOfLevels()) @@ -301,7 +303,7 @@ namespace AMDiS { namespace Parallel { } - for (unsigned int i = 0; i < componentSpaces.size(); i++) { + for (int i = 0; i < static_cast<int>(componentSpaces.size()); i++) { const FiniteElemSpace *feSpace = componentSpaces[i]; MSG("FETI-DP data for %d-ith component (FE space %p):\n", i, feSpace); @@ -572,14 +574,16 @@ namespace AMDiS { namespace Parallel { for (DofComm::Iterator it(meshDistributor->getDofComm(meshLevel).getRecvDofs(), feSpace); !it.end(); it.nextRank()) { int i = 0; - for (; !it.endDofIter(); it.nextDof()) - if (!isPrimal(component, it.getDofIndex())) - if (subDomainIsLocal || dofMapSubDomain[feSpace].isRankDof(it.getDofIndex())) + for (; !it.endDofIter(); it.nextDof()) { + if (!isPrimal(component, it.getDofIndex())) { + if (subDomainIsLocal || dofMapSubDomain[feSpace].isRankDof(it.getDofIndex())) { boundaryDofRanks[feSpace][it.getDofIndex()] = stdMpi.getRecvData(it.getRank())[i++]; - else { + } else { lagrangeMap[component].insertNonRankDof(it.getDofIndex()); } + } + } } @@ -957,7 +961,7 @@ namespace AMDiS { namespace Parallel { int rowCounter = rStartEdges; for (vector<vector<BoundaryObject> >::iterator it = allEdges.begin(); it != allEdges.end(); ++it) { - for (int component = 0; component < componentSpaces.size(); component++) { + for (int component = 0; component < static_cast<int>(componentSpaces.size()); component++) { for (vector<BoundaryObject>::iterator edgeIt = it->begin(); edgeIt != it->end(); ++edgeIt) { @@ -1488,7 +1492,7 @@ namespace AMDiS { namespace Parallel { MatGetVecs(mat_duals_duals, PETSC_NULL, &(lumpedData->tmp_vec_duals1)); - for (unsigned int component = 0; component < componentSpaces.size(); + for (int component = 0; component < static_cast<int>(componentSpaces.size()); component++) { if (stokesMode && component == pressureComponent) continue; @@ -1967,7 +1971,7 @@ namespace AMDiS { namespace Parallel { // === Create scatter to get solutions of all primal nodes that are === // === contained in rank's domain. === - int nComponents = vec.getSize(); + unsigned int nComponents = vec.getSize(); vector<PetscInt> globalIsIndex, localIsIndex; globalIsIndex.reserve(primalDofMap.getLocalDofs()); @@ -2020,7 +2024,7 @@ namespace AMDiS { namespace Parallel { // === And copy from PETSc local vectors to the DOF vectors. === int cnt = 0; - for (int component = 0; component < nComponents; component++) { + for (unsigned int component = 0; component < nComponents; component++) { DOFVector<double>& dofVec = *(vec.getDOFVector(component)); for (DofMap::iterator it = localDofMap[component].getMap().begin(); @@ -2277,8 +2281,8 @@ namespace AMDiS { namespace Parallel { colComponent == pressureComponent)) continue; - const FiniteElemSpace *rowFeSpace = dofMat->getRowFeSpace(); - const FiniteElemSpace *colFeSpace = dofMat->getColFeSpace(); +// const FiniteElemSpace *rowFeSpace = dofMat->getRowFeSpace(); +// const FiniteElemSpace *colFeSpace = dofMat->getColFeSpace(); traits::col<Matrix>::type col(dofMat->getBaseMatrix()); traits::const_value<Matrix>::type value(dofMat->getBaseMatrix()); diff --git a/AMDiS/src/parallel/PetscSolverFetiDebug.cc b/AMDiS/src/parallel/PetscSolverFetiDebug.cc index 7c2682e214801a9f1e1195d61a64d28094d1502f..155c58043c94e051e517a3f99aa736e32f981945 100644 --- a/AMDiS/src/parallel/PetscSolverFetiDebug.cc +++ b/AMDiS/src/parallel/PetscSolverFetiDebug.cc @@ -227,7 +227,7 @@ namespace AMDiS { namespace Parallel { nestMat[14] = PETSC_NULL; nestMat[15] = PETSC_NULL; - Mat nestFetiMat; +// Mat nestFetiMat; MatCreateNest(feti.domainComm, 4, PETSC_NULL, 4, PETSC_NULL, &(nestMat[0]), &mat); } else { @@ -244,7 +244,7 @@ namespace AMDiS { namespace Parallel { nestMat[7] = PETSC_NULL; nestMat[8] = PETSC_NULL; - Mat nestFetiMat; +// Mat nestFetiMat; MatCreateNest(feti.domainComm, 3, PETSC_NULL, 3, PETSC_NULL, &(nestMat[0]), &mat); } diff --git a/AMDiS/src/parallel/PetscSolverFetiOperators.cc b/AMDiS/src/parallel/PetscSolverFetiOperators.cc index 7afcb85bd08c4bbddf9d9d4f8322741284ba1ed5..d247e3d2e17eb875037f9e6e128176f7bfb42d8a 100644 --- a/AMDiS/src/parallel/PetscSolverFetiOperators.cc +++ b/AMDiS/src/parallel/PetscSolverFetiOperators.cc @@ -387,6 +387,8 @@ namespace AMDiS { namespace Parallel { VecDestroy(&tmpPrimal); VecDestroy(&tmpInterior0); VecDestroy(&tmpInterior1); + + PetscFunctionReturn(0); } diff --git a/AMDiS/src/parallel/PetscSolverGlobalBlockMatrix.cc b/AMDiS/src/parallel/PetscSolverGlobalBlockMatrix.cc index 81bdf891eee4ead4a684c8ca329129bac003d298..2fffedff6626d7bba3ac98e4cc546d0e6b167610 100644 --- a/AMDiS/src/parallel/PetscSolverGlobalBlockMatrix.cc +++ b/AMDiS/src/parallel/PetscSolverGlobalBlockMatrix.cc @@ -204,7 +204,7 @@ namespace AMDiS { namespace Parallel { Vec tmp; VecNestGetSubVec(petscSolVec, i, &tmp); - int nRankDofs = (*interiorMap)[feSpace].nRankDofs; +// int nRankDofs = (*interiorMap)[feSpace].nRankDofs; PetscScalar *vecPointer; VecGetArray(tmp, &vecPointer); diff --git a/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc b/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc index 92216eb5e641c1754774d72746ef17b9d9b18cf5..ce2e722ad1072e967bcf907392826e7b49f5317b 100644 --- a/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc +++ b/AMDiS/src/parallel/PetscSolverGlobalMatrix.cc @@ -92,7 +92,9 @@ namespace AMDiS { namespace Parallel { TEST_EXIT_DBG(interiorMap)("No parallel mapping object defined!\n"); TEST_EXIT_DBG(seqMat)("No DOF matrix defined!\n"); +#if (DEBUG != 0) double wtime = MPI::Wtime(); +#endif createMatVec(*seqMat); diff --git a/AMDiS/src/parallel/PetscSolverNSCH.cc b/AMDiS/src/parallel/PetscSolverNSCH.cc index b3549fa345bffdb394bf0db752204046b880f743..ce0c75c9383c8e5f9eaeb0141bbefcfee5702520 100644 --- a/AMDiS/src/parallel/PetscSolverNSCH.cc +++ b/AMDiS/src/parallel/PetscSolverNSCH.cc @@ -116,23 +116,25 @@ namespace AMDiS { namespace Parallel { VecDestroy(&x34); VecDestroy(&x5); + PetscFunctionReturn(0); } PetscSolverNSCH::PetscSolverNSCH(string name) : PetscSolverGlobalMatrix(name), + pressureNullSpace(true), useOldInitialGuess(false), + velocitySolutionMode(0), + massSolutionMode(0), laplaceSolutionMode(0), + regularizeLaplace(0), massMatrixSolverCH(NULL), laplaceMatrixSolverCH(NULL), deltaKMatrixSolver(NULL), - pressureNullSpace(true), - velocitySolutionMode(0), - regularizeLaplace(0), - massSolutionMode(0), massMatrixSolver(NULL), laplaceMatrixSolver(NULL), + conDifMatrixSolver(NULL), nu(NULL), invTau(NULL), solution(NULL), @@ -198,7 +200,7 @@ namespace AMDiS { namespace Parallel { int dim = componentSpaces[0]->getMesh()->getDim(); pressureComponent=dim; const FiniteElemSpace *cahnHilliardFeSpace = componentSpaces[dim+1]; - const FiniteElemSpace *velocityFeSpace= componentSpaces[0]; +// const FiniteElemSpace *velocityFeSpace= componentSpaces[0]; const FiniteElemSpace *pressureFeSpace = componentSpaces[pressureComponent]; PCSetType(pc, PCSHELL); diff --git a/AMDiS/src/parallel/PetscSolverNavierStokes.cc b/AMDiS/src/parallel/PetscSolverNavierStokes.cc index 16c9459cc065ba651147aa60dbe3772f79d124ad..34d4a21494ee9109fd9d7d80d4d68d30d0bcb3eb 100644 --- a/AMDiS/src/parallel/PetscSolverNavierStokes.cc +++ b/AMDiS/src/parallel/PetscSolverNavierStokes.cc @@ -48,6 +48,8 @@ namespace AMDiS { namespace Parallel { KSPSolve(data->kspLaplace, x, y); MatMult(data->matConDif, y, x); KSPSolve(data->kspMass, x, y); + + PetscFunctionReturn(0); } diff --git a/AMDiS/src/parallel/PetscSolverSchur.cc b/AMDiS/src/parallel/PetscSolverSchur.cc index ff16d08432fd6510ce08b051f8572e2bca492fa0..ea6ff64c96e178cc15e116b6d51daecd6e10e506 100644 --- a/AMDiS/src/parallel/PetscSolverSchur.cc +++ b/AMDiS/src/parallel/PetscSolverSchur.cc @@ -35,8 +35,10 @@ namespace AMDiS { namespace Parallel { TEST_EXIT_DBG(interiorMap)("No parallel DOF map defined!\n"); const FiniteElemSpace *feSpace = componentSpaces[0]; - typedef map<int, DofContainer> RankToDofContainer; +// typedef map<int, DofContainer> RankToDofContainer; +#if 0 typedef map<DegreeOfFreedom, bool> DofIndexToBool; +#endif boundaryDofs.clear(); std::set<DegreeOfFreedom> boundaryLocalDofs; @@ -187,7 +189,7 @@ namespace AMDiS { namespace Parallel { void PetscSolverSchur::fillPetscMatrix(Matrix<DOFMatrix*> *seqMat) { - FUNCNAME("PetscSolverSchur::fillPetscMatrix()"); +// FUNCNAME("PetscSolverSchur::fillPetscMatrix()"); createMatVec(*seqMat); @@ -264,7 +266,7 @@ namespace AMDiS { namespace Parallel { void PetscSolverSchur::fillPetscRhs(SystemVector *vec) { - FUNCNAME("PetscSolverSchur::fillPetscRhs()"); +// FUNCNAME("PetscSolverSchur::fillPetscRhs()"); const FiniteElemSpace *feSpace = componentSpaces[0]; int nComponents = vec->getSize(); @@ -283,7 +285,7 @@ namespace AMDiS { namespace Parallel { void PetscSolverSchur::solvePetscMatrix(SystemVector &vec, AdaptInfo *adaptInfo) { - FUNCNAME("PetscSolverSchur::solvePetscMatrix()"); +// FUNCNAME("PetscSolverSchur::solvePetscMatrix()"); const FiniteElemSpace *feSpace = componentSpaces[0]; int nComponents = vec.getSize(); @@ -440,6 +442,8 @@ namespace AMDiS { namespace Parallel { void PetscSolverSchur::setDofVector(Vec& petscVec, DOFVector<double>* vec, int dispMult, int dispAdd, bool rankOnly) { + FUNCNAME_DBG("PetscSolverSchur::setDofVector()"); + const FiniteElemSpace *feSpace = componentSpaces[0]; DOFVector<double>::Iterator dofIt(vec, USED_DOFS); diff --git a/AMDiS/src/parallel/StdMpi.cc b/AMDiS/src/parallel/StdMpi.cc index b721fac0b1bf89f9e1a80efc48d4dc93f7914ffe..b4f6e6996fbc95c68204c93b24f22eba1bde4e6f 100644 --- a/AMDiS/src/parallel/StdMpi.cc +++ b/AMDiS/src/parallel/StdMpi.cc @@ -536,7 +536,7 @@ namespace AMDiS { namespace Parallel { for (unsigned int i = 0; i < data.size(); i++) { buf[counter++] = data[i].size(); for (unsigned int j = 0; j < data[i].size(); j++) - for (unsigned int k = 0; k < Global::getGeo(WORLD); k++) + for (int k = 0; k < Global::getGeo(WORLD); k++) buf[counter++] = data[i][j][k]; } } @@ -550,7 +550,7 @@ namespace AMDiS { namespace Parallel { for (unsigned int i = 0; i < data.size(); i++) { data[i].resize(static_cast<int>(buf[counter++])); for (unsigned int j = 0; j < data[i].size(); j++) - for (unsigned int k = 0; k < Global::getGeo(WORLD); k++) + for (int k = 0; k < Global::getGeo(WORLD); k++) data[i][j][k] = buf[counter++]; } diff --git a/AMDiS/src/parallel/StdMpi.h b/AMDiS/src/parallel/StdMpi.h index dcce5317a33ecf458a5ff42a2f4cd8c83f83dddd..3fc0325bfcf5ff89ed85db69863d5f83412d53bd 100644 --- a/AMDiS/src/parallel/StdMpi.h +++ b/AMDiS/src/parallel/StdMpi.h @@ -496,7 +496,7 @@ namespace AMDiS { namespace Parallel { // === Start communication. === - MPI::Request request[sendData.size() + recvDataSize.size()]; + MPI::Request *request = new MPI::Request[sendData.size() + recvDataSize.size()]; int requestCounter = 0; vector<cppDataType*> sendBuffers, recvBuffers; @@ -549,7 +549,7 @@ namespace AMDiS { namespace Parallel { delete [] recvBuffers[i]; i++; } - + delete[] request; commPrepared = false; } diff --git a/AMDiS/src/solver/itl/minres.hpp b/AMDiS/src/solver/itl/minres.hpp index 01a8e3315d1908b1c677a981e8cbfef78d0f18f2..24dc13be74d4df01ac6b2658f78efae1330812bd 100644 --- a/AMDiS/src/solver/itl/minres.hpp +++ b/AMDiS/src/solver/itl/minres.hpp @@ -38,7 +38,6 @@ namespace itl { { using std::abs; using math::reciprocal; typedef typename mtl::Collection<Vector>::value_type Scalar; - typedef typename mtl::Collection<Vector>::size_type Size; if (size(b) == 0) throw mtl::logic_error("empty rhs vector"); diff --git a/extensions/BackgroundMesh.cc b/extensions/BackgroundMesh.cc index e019d9c338d4cb33375d10793a757d8ee1278585..b2fc2b6d15872c57db2f98bc7ac19607225eb228 100644 --- a/extensions/BackgroundMesh.cc +++ b/extensions/BackgroundMesh.cc @@ -37,10 +37,10 @@ namespace experimental { Box::Box(int DOW_, PointType min_corner_, PointType max_corner_, std::vector<int> N_) - : DOW(DOW_), + : DOW(DOW_), N(N_), + boxFilled(false), min_corner(min_corner_), - max_corner(max_corner_), - N(N_), boxFilled(false) + max_corner(max_corner_) { init(); } @@ -150,7 +150,6 @@ namespace experimental { double boxBoundaryDist = getBoxBoundaryDist(center_box, x); std::vector<double> distances; std::set<int>::iterator nrIter; - int level = 0; for (int level = 0; static_cast<int>(data.size()) < nData && nrs.size() > 0; level++) { int oldDataSize = data.size(); for (nrIter = nrs.begin(); nrIter != nrs.end(); nrIter++) { diff --git a/extensions/ExtendedProblemStat.h b/extensions/ExtendedProblemStat.h index bb42c7872ef4d0d388f9e0212e1c4f0aa8d76967..7ccfdd24fec5dcffc5e0f0de11a5ae7f48f1c786 100644 --- a/extensions/ExtendedProblemStat.h +++ b/extensions/ExtendedProblemStat.h @@ -309,7 +309,7 @@ protected: c_type cursor(begin<tag::row>(m)+idx_); for (ic_type icursor(begin<tag::nz>(cursor)), icend(end<tag::nz>(cursor)); icursor != icend; ++icursor) { - value1set = value1set || r(*icursor) == c(*icursor) && col == col_; + value1set = value1set || (r(*icursor) == c(*icursor) && col == col_); v(*icursor, (r(*icursor) == c(*icursor) && col == col_ ? 1.0 : 0.0)); } } diff --git a/extensions/GeometryTools.cc b/extensions/GeometryTools.cc index 328db740562a8c160997517a0fb998e9112fb0b3..2d174bf24f24984a7b5a16c2555c22ed7861cd9b 100644 --- a/extensions/GeometryTools.cc +++ b/extensions/GeometryTools.cc @@ -74,8 +74,8 @@ void centroid_of_box_2d(double min_corner[], double max_corner[], double c[]){ //----------------------------------------< centroid_of_triangle_2d > void centroid_of_triangle_2d(double tri0[], double tri1[], double tri2[], double c[]){ - c[0] = (tri0[0]+tri1[0],tri2[0])/3.0; - c[1] = (tri0[1]+tri1[1],tri2[1])/3.0; + c[0] = (tri0[0]+tri1[0]+tri2[0])/3.0; + c[1] = (tri0[1]+tri1[1]+tri2[1])/3.0; } //----------------------------------------< point_in_triangle_2d > @@ -570,9 +570,9 @@ void centroid_of_box_3d(double min_corner[], double max_corner[], double c[]){ //----------------------------------------< centroid_of_triangle_3d > void centroid_of_triangle_3d(double tri0[], double tri1[], double tri2[], double c[]){ - c[0] = (tri0[0]+tri1[0],tri2[0])/3.0; - c[1] = (tri0[1]+tri1[1],tri2[1])/3.0; - c[2] = (tri0[2]+tri1[2],tri2[2])/3.0; + c[0] = (tri0[0]+tri1[0]+tri2[0])/3.0; + c[1] = (tri0[1]+tri1[1]+tri2[1])/3.0; + c[2] = (tri0[2]+tri1[2]+tri2[2])/3.0; } //----------------------------------------< point_in_box_3d > diff --git a/extensions/Helpers.cc b/extensions/Helpers.cc index 082b314b086aa45bc816ccd28433edf89d1ec559..59bc9f5fb9088482dcedd51539838a888bd348e1 100644 --- a/extensions/Helpers.cc +++ b/extensions/Helpers.cc @@ -127,7 +127,6 @@ namespace Helpers { { FUNCNAME("Helpers::scaleMesh()"); deque<MacroElement*>::iterator macro; - int dim = Global::getGeo(WORLD); for(macro = mesh->firstMacroElement(); macro != mesh->endOfMacroElements(); macro++) { for (int i = 0; i < mesh->getDim()+1; ++i) { diff --git a/extensions/Helpers.h b/extensions/Helpers.h index 7aa2c750e0660196585586fef56d3376575c7f33..d0fd0303b0d2e997d2c2299941e3715d3045e8a8 100644 --- a/extensions/Helpers.h +++ b/extensions/Helpers.h @@ -374,19 +374,19 @@ namespace Helpers { /// calculate maxima of DOFVector along x-axis, using interpolOverLine - static void calcMaxOnXAxis(DOFVector<double> *rho, std::vector<std::pair<WorldVector<double>, double> > &maxima); + void calcMaxOnXAxis(DOFVector<double> *rho, std::vector<std::pair<WorldVector<double>, double> > &maxima); /// calculate maxima of DOFVector along y-axis, using interpolOverLine - static void calcMaxOnYAxis(DOFVector<double> *rho, std::vector<std::pair<WorldVector<double>, double> > &maxima); + void calcMaxOnYAxis(DOFVector<double> *rho, std::vector<std::pair<WorldVector<double>, double> > &maxima); /// calc normal vectors of surface from element normals by averaging - static void getNormalsWeighted(FiniteElemSpace *feSpace, DOFVector<WorldVector<double> > *normals); + void getNormalsWeighted(FiniteElemSpace *feSpace, DOFVector<WorldVector<double> > *normals); /// calc normal vectors of surface from element normals by local approximation by quartic - static void getNormals(FiniteElemSpace *feSpace, DOFVector<WorldVector<double> > *normals, DOFVector<WorldMatrix<double> > *gradNormals = NULL); + void getNormals(FiniteElemSpace *feSpace, DOFVector<WorldVector<double> > *normals, DOFVector<WorldMatrix<double> > *gradNormals = NULL); /// calc curvature from given normal vectors - static void getCurvature(DOFVector<WorldVector<double> >* normals, DOFVector<double>* curvature); + void getCurvature(DOFVector<WorldVector<double> >* normals, DOFVector<double>* curvature); // misc routines // ============= diff --git a/extensions/MeshFunction_Level.h b/extensions/MeshFunction_Level.h index 7827313b231465b3ab6d8521b22e541d1d808df0..09ccf2ec6edd835c1df8a0820031086cda74c442 100644 --- a/extensions/MeshFunction_Level.h +++ b/extensions/MeshFunction_Level.h @@ -114,9 +114,9 @@ class PhaseFieldCoordsRefinement : public PhaseFieldRefinementBase< std::pair<Wo public: PhaseFieldCoordsRefinement(Mesh* mesh_, std::vector<WorldVector<double> > points_, double radius_) : PhaseFieldRefinementBase< std::pair<WorldVector<double>, double> >(mesh_), + lPoints(14), points(points_), - radius(radius_), - lPoints(14) + radius(radius_) { Parameters::get("mesh->refinement->level on points",lPoints); lPoints-= mesh->getMacroElementLevel(); diff --git a/extensions/POperators_ZOT.h b/extensions/POperators_ZOT.h index 69262086f3227ea24e50335baac866cbf030c2a9..7bb59067dacc24004d60214cb34deccafe7cc763 100644 --- a/extensions/POperators_ZOT.h +++ b/extensions/POperators_ZOT.h @@ -161,11 +161,12 @@ struct VecAndPartialDerivative_ZOT : ZeroOrderTerm private: DOFVectorBase<double> *vecDV, *gradDV; - mtl::dense_vector<double> vec; + int component; AbstractFunction<double, double>* fct; double fac; + + mtl::dense_vector<double> vec; mtl::dense_vector<WorldVector<double> > grad; - int component; }; /* -------------------------------------------------------------- */ diff --git a/extensions/Refinement.h b/extensions/Refinement.h index a3ed19eb677f0ce39c064939690f7800fcc5dd4b..5a1f0905e48a80eaf9fd34b54bb92a8dfed14cc5 100644 --- a/extensions/Refinement.h +++ b/extensions/Refinement.h @@ -131,7 +131,7 @@ public: FUNCNAME("RefinementLevel::refine()"); if (!globalRefined) { - MSG_DBG("nr of global refinements: %d\n", refineFct->getGlobalSize()); + MSG("nr of global refinements: %d\n", refineFct->getGlobalSize()); refinementManager->globalRefine(mesh, refineFct->getGlobalSize()); globalRefined = true; } @@ -151,7 +151,7 @@ public: int nr = mesh->getNumberOfVertices(); meshChanged = meshChanged && oldOldNr!=nr && oldNr!=nr; if (meshChanged) { - MSG_DBG("Mesh sizes: [%f, %f], Vs: %d, ELs: %d\n", + MSG("Mesh sizes: [%f, %f], Vs: %d, ELs: %d\n", minH, maxH, nr, mesh->getNumberOfElements()); } i++; diff --git a/extensions/Refinement_Level.h b/extensions/Refinement_Level.h index 8ed6bb59611a18e64cbb310a5f66456d25a1a515..1567fb0c7295ca8fe971fd9267f79cbf1cdd8d53 100644 --- a/extensions/Refinement_Level.h +++ b/extensions/Refinement_Level.h @@ -217,8 +217,7 @@ public: center += coords[i]; } center *= 1.0 / static_cast<double>(coords.size()); - std::pair<WorldVector<double>, double> swap(center, meanValue); - int refineLevel = (*refineFct)(swap); + int refineLevel = (*refineFct)(std::make_pair(center, meanValue)); int oldLevel = elInfo->getLevel(); elInfo->getElement()->setMark( calcMark(refineLevel, oldLevel) ); @@ -333,13 +332,11 @@ public: { FUNCNAME("RefinementLevelDOF::markElements()"); - const DOFAdmin* admin = feSpace->getAdmin(); const BasisFunction *basFcts = feSpace->getBasisFcts(); int numBasFcts = basFcts->getNumber(); DegreeOfFreedom *localIndices = new DegreeOfFreedom[numBasFcts]; FixVec<WorldVector<double>, VERTEX> coords(mesh->getDim(), NO_INIT); - double meanValue; bool elMarkRefine = false, elMarkCoarsen = false; diff --git a/extensions/Refinement_MeshSize.h b/extensions/Refinement_MeshSize.h index dae1e69d0ef608f3e527b2f276b2e4fbdf180ada..e9a2adb73454460846335fa40db6f343079149cc 100644 --- a/extensions/Refinement_MeshSize.h +++ b/extensions/Refinement_MeshSize.h @@ -166,8 +166,7 @@ public: } center *= 1.0 / static_cast<double>(coords.size()); - std::pair<WorldVector<double>, double> swap(center, meanValue); - int refineH = (*refineFct)(swap); + int refineH = (*refineFct)(std::make_pair(center, meanValue)); double oldH = calcMeshSize(elInfo); elInfo->getElement()->setMark( calcMark(refineH, oldH) ); diff --git a/extensions/SingularDirichletBC.h b/extensions/SingularDirichletBC.h index 645d298aeb039679e296c43dd811d291fca14e41..2d546339b48cebadb5a3897555d0f23b9bfe6886 100644 --- a/extensions/SingularDirichletBC.h +++ b/extensions/SingularDirichletBC.h @@ -245,120 +245,123 @@ namespace details { * of (singular/implicit) dirichlet boundary condition. **/ struct DirichletBcData { + + // init order: + // row, col, posType, valueType, pos, idx, + // signedDistFct, signedDistDOF, boundary_nr, meshIndicator, val0, val1, val2 // pos = WorldVector DirichletBcData(int i_, int j_, WorldVector<double> pos_, double val_) - : row(i_), col(j_), pos(pos_), val0(val_), val1(NULL), val2(NULL), - posType(0), valueType(0), - idx(0), SignedDistFct(NULL), SignedDistDOF(NULL), - boundary_nr(0), meshIndicator(NULL) {} + : row(i_), col(j_), posType(0), valueType(0), + pos(pos_), idx(0), SignedDistFct(NULL), SignedDistDOF(NULL), + boundary_nr(0), meshIndicator(NULL), + val0(val_), val1(NULL), val2(NULL) {} DirichletBcData(int i_, int j_, WorldVector<double> pos_, DOFVector<double> &val_) - : row(i_), col(j_), pos(pos_), val1(&val_), val0(0.0), val2(NULL), - posType(0), valueType(1), - idx(0), SignedDistFct(NULL), SignedDistDOF(NULL), - boundary_nr(0), meshIndicator(NULL) {} + : row(i_), col(j_), posType(0), valueType(1), + pos(pos_), idx(0), SignedDistFct(NULL), SignedDistDOF(NULL), + boundary_nr(0), meshIndicator(NULL), + val0(0.0), val1(&val_), val2(NULL) {} DirichletBcData(int i_, int j_, WorldVector<double> pos_, AbstractFunction<double, WorldVector<double> > &val_) - : row(i_), col(j_), pos(pos_), val0(0.0), val1(NULL), val2(&val_), - posType(0), valueType(2), - idx(0), SignedDistFct(NULL), SignedDistDOF(NULL), - boundary_nr(0), meshIndicator(NULL) {} + : row(i_), col(j_), posType(0), valueType(2), + pos(pos_), idx(0), SignedDistFct(NULL), SignedDistDOF(NULL), + boundary_nr(0), meshIndicator(NULL), + val0(0.0), val1(NULL), val2(&val_) {} // pos = idx DirichletBcData(int i_, int j_, DegreeOfFreedom idx_, double val_) - : row(i_), col(j_), idx(idx_), val0(val_), val1(NULL), val2(NULL), - posType(1), valueType(0), - SignedDistFct(NULL), SignedDistDOF(NULL), - boundary_nr(0), meshIndicator(NULL) { pos.set(0.0); } + : row(i_), col(j_), posType(1), valueType(0), + idx(idx_), SignedDistFct(NULL), SignedDistDOF(NULL), + boundary_nr(0), meshIndicator(NULL), + val0(val_), val1(NULL), val2(NULL) { pos.set(0.0); } DirichletBcData(int i_, int j_, DegreeOfFreedom idx_, DOFVector<double> &val_) - : row(i_), col(j_), idx(idx_), val0(0.0), val1(&val_), val2(NULL), - posType(1), valueType(1), - SignedDistFct(NULL), SignedDistDOF(NULL), - boundary_nr(0), meshIndicator(NULL) { pos.set(0.0); } + : row(i_), col(j_), posType(1), valueType(1), + idx(idx_), SignedDistFct(NULL), SignedDistDOF(NULL), + boundary_nr(0), meshIndicator(NULL), + val0(0.0), val1(&val_), val2(NULL) { pos.set(0.0); } DirichletBcData(int i_, int j_, DegreeOfFreedom idx_, AbstractFunction<double, WorldVector<double> > &val_) - : row(i_), col(j_), idx(idx_), val0(0.0), val1(NULL), val2(&val_), - posType(1), valueType(2), - SignedDistFct(NULL), SignedDistDOF(NULL), - boundary_nr(0), meshIndicator(NULL) { pos.set(0.0); } + : row(i_), col(j_), posType(1), valueType(2), + idx(idx_), SignedDistFct(NULL), SignedDistDOF(NULL), + boundary_nr(0), meshIndicator(NULL), + val0(0.0), val1(NULL), val2(&val_) { pos.set(0.0); } // pos = SignedDistFct DirichletBcData(int i_, int j_, AbstractFunction<double, WorldVector<double> > *SignedDistFct_, double val_) - : row(i_), col(j_), SignedDistFct(SignedDistFct_), val0(val_), val1(NULL), val2(NULL), - posType(2), valueType(0), - idx(0), SignedDistDOF(NULL), - boundary_nr(0), meshIndicator(NULL) { pos.set(0.0); } + : row(i_), col(j_), posType(2), valueType(0), + idx(0), SignedDistFct(SignedDistFct_), SignedDistDOF(NULL), + boundary_nr(0), meshIndicator(NULL), + val0(val_), val1(NULL), val2(NULL) { pos.set(0.0); } DirichletBcData(int i_, int j_, AbstractFunction<double, WorldVector<double> > *SignedDistFct_, DOFVector<double> &val_) - : row(i_), col(j_), SignedDistFct(SignedDistFct_), val0(0.0), val1(&val_), val2(NULL), - posType(2), valueType(1), - idx(0), SignedDistDOF(NULL), - boundary_nr(0), meshIndicator(NULL) { pos.set(0.0); } + : row(i_), col(j_), posType(2), valueType(1), + idx(0), SignedDistFct(SignedDistFct_), SignedDistDOF(NULL), + boundary_nr(0), meshIndicator(NULL), + val0(0.0), val1(&val_), val2(NULL) { pos.set(0.0); } DirichletBcData(int i_, int j_, AbstractFunction<double, WorldVector<double> > *SignedDistFct_, AbstractFunction<double, WorldVector<double> > &val_) - : row(i_), col(j_), SignedDistFct(SignedDistFct_), val0(0.0), val1(NULL), val2(&val_), - posType(2), valueType(2), - idx(0), SignedDistDOF(NULL), - boundary_nr(0), meshIndicator(NULL) { pos.set(0.0); } + : row(i_), col(j_), posType(2), valueType(2), + idx(0), SignedDistFct(SignedDistFct_), SignedDistDOF(NULL), + boundary_nr(0), meshIndicator(NULL), + val0(0.0), val1(NULL), val2(&val_) { pos.set(0.0); } // pos = SignedDistDOF DirichletBcData(int i_, int j_, DOFVector<double> *SignedDistDOF_, double val_) - : row(i_), col(j_), SignedDistDOF(SignedDistDOF_), val0(val_), val1(NULL), val2(NULL), - posType(3), valueType(0), - idx(0), SignedDistFct(NULL), - boundary_nr(0), meshIndicator(NULL) { pos.set(0.0); } + : row(i_), col(j_), posType(3), valueType(0), + idx(0), SignedDistFct(NULL), SignedDistDOF(SignedDistDOF_), + boundary_nr(0), meshIndicator(NULL), + val0(val_), val1(NULL), val2(NULL) { pos.set(0.0); } DirichletBcData(int i_, int j_, DOFVector<double> *SignedDistDOF_, DOFVector<double> &val_) - : row(i_), col(j_), SignedDistDOF(SignedDistDOF_), val0(0.0), val1(&val_), val2(NULL), - posType(3), valueType(1), - idx(0), SignedDistFct(NULL), - boundary_nr(0), meshIndicator(NULL) { pos.set(0.0); } + : row(i_), col(j_), posType(3), valueType(1), + idx(0), SignedDistFct(NULL), SignedDistDOF(SignedDistDOF_), + boundary_nr(0), meshIndicator(NULL), val0(0.0), val1(&val_), val2(NULL) { pos.set(0.0); } DirichletBcData(int i_, int j_, DOFVector<double> *SignedDistDOF_, AbstractFunction<double, WorldVector<double> > &val_) - : row(i_), col(j_), SignedDistDOF(SignedDistDOF_), val0(0.0), val1(NULL), val2(&val_), - posType(3), valueType(2), - idx(0), SignedDistFct(NULL), - boundary_nr(0), meshIndicator(NULL) { pos.set(0.0); } + : row(i_), col(j_), posType(3), valueType(2), + idx(0), SignedDistFct(NULL), SignedDistDOF(SignedDistDOF_), + boundary_nr(0), meshIndicator(NULL), + val0(0.0), val1(NULL), val2(&val_) { pos.set(0.0); } // pos = meshindicator + boundary_nr DirichletBcData(int i_, int j_, BoundaryType nr, AbstractFunction<bool, WorldVector<double> > *meshIndicator_, double val_) - : row(i_), col(j_), SignedDistDOF(NULL), val0(val_), val1(NULL), val2(NULL), - posType(4), valueType(0), - idx(0), SignedDistFct(NULL), - boundary_nr(nr), meshIndicator(meshIndicator_) { pos.set(0.0); } + : row(i_), col(j_), posType(4), valueType(0), + idx(0), SignedDistFct(NULL), SignedDistDOF(NULL), + boundary_nr(nr), meshIndicator(meshIndicator_), + val0(val_), val1(NULL), val2(NULL) { pos.set(0.0); } DirichletBcData(int i_, int j_, BoundaryType nr, AbstractFunction<bool, WorldVector<double> > *meshIndicator_, DOFVector<double> &val_) - : row(i_), col(j_), SignedDistDOF(NULL), val0(0.0), val1(&val_), val2(NULL), - posType(4), valueType(1), - idx(0), SignedDistFct(NULL), - boundary_nr(nr), meshIndicator(meshIndicator_) { pos.set(0.0); } + : row(i_), col(j_), posType(4), valueType(1), + idx(0), SignedDistFct(NULL), SignedDistDOF(NULL), + boundary_nr(nr), meshIndicator(meshIndicator_), + val0(0.0), val1(&val_), val2(NULL) { pos.set(0.0); } DirichletBcData(int i_, int j_, BoundaryType nr, AbstractFunction<bool, WorldVector<double> > *meshIndicator_, AbstractFunction<double, WorldVector<double> > &val_) - : row(i_), col(j_), SignedDistDOF(NULL), val0(0.0), val1(NULL), val2(&val_), - posType(4), valueType(2), - idx(0), SignedDistFct(NULL), - boundary_nr(nr), meshIndicator(meshIndicator_) { pos.set(0.0); } + : row(i_), col(j_), posType(4), valueType(2), + idx(0), SignedDistFct(NULL), SignedDistDOF(NULL), + boundary_nr(nr), meshIndicator(meshIndicator_), + val0(0.0), val1(NULL), val2(&val_) { pos.set(0.0); } // pos = meshindicator DirichletBcData(int i_, int j_, AbstractFunction<bool, WorldVector<double> > *meshIndicator_, double val_) - : row(i_), col(j_), SignedDistDOF(NULL), val0(val_), val1(NULL), val2(NULL), - posType(4), valueType(0), - idx(0), SignedDistFct(NULL), - boundary_nr(0), meshIndicator(meshIndicator_) { pos.set(0.0); } + : row(i_), col(j_), posType(4), valueType(0), + idx(0), SignedDistFct(NULL), SignedDistDOF(NULL), + boundary_nr(0), meshIndicator(meshIndicator_), + val0(val_), val1(NULL), val2(NULL) { pos.set(0.0); } DirichletBcData(int i_, int j_, AbstractFunction<bool, WorldVector<double> > *meshIndicator_, DOFVector<double> &val_) - : row(i_), col(j_), SignedDistDOF(NULL), val0(0.0), val1(&val_), val2(NULL), - posType(4), valueType(1), - idx(0), SignedDistFct(NULL), - boundary_nr(0), meshIndicator(meshIndicator_) { pos.set(0.0); } + : row(i_), col(j_), posType(4), valueType(1), + idx(0), SignedDistFct(NULL), SignedDistDOF(NULL), + boundary_nr(0), meshIndicator(meshIndicator_), + val0(0.0), val1(&val_), val2(NULL) { pos.set(0.0); } DirichletBcData(int i_, int j_, AbstractFunction<bool, WorldVector<double> > *meshIndicator_, AbstractFunction<double, WorldVector<double> > &val_) - : row(i_), col(j_), SignedDistDOF(NULL), val0(0.0), val1(NULL), val2(&val_), - posType(4), valueType(2), - idx(0), SignedDistFct(NULL), - boundary_nr(0), meshIndicator(meshIndicator_) { pos.set(0.0); } + : row(i_), col(j_), posType(4), valueType(2), + idx(0), SignedDistFct(NULL), SignedDistDOF(NULL), + boundary_nr(0), meshIndicator(meshIndicator_), + val0(0.0), val1(NULL), val2(&val_) { pos.set(0.0); } void addToList(const FiniteElemSpace *feSpace, std::vector<SingularDirichletBC> &list) { diff --git a/extensions/VectorOperations.h b/extensions/VectorOperations.h index cae58df988f9da1467a03549b0b405309aa73e86..45c9a6713f8e19aca34af2aaae73637234f19cdb 100644 --- a/extensions/VectorOperations.h +++ b/extensions/VectorOperations.h @@ -497,7 +497,6 @@ namespace vector_operations { template<typename Vector> void getMin(const Vector &v, typename ValueType<Vector>::type &minVal, size_t &minIdx) { - typedef typename ValueType<Vector>::type T; TEST_EXIT(num_rows(v) > 0)("getMin of empty vector!\n"); minVal = v[0]; @@ -513,7 +512,6 @@ namespace vector_operations { template<typename Vector> void getMax(const Vector &v, typename ValueType<Vector>::type &maxVal, size_t &maxIdx) { - typedef typename ValueType<Vector>::type T; TEST_EXIT(num_rows(v) > 0)("getMax of empty vector!\n"); maxVal = v[0]; diff --git a/extensions/base_problems/CahnHilliard_RB.cc b/extensions/base_problems/CahnHilliard_RB.cc index f9d9cab240427b1d9937c924fd0c5eb5f8c55b61..ffa6646fc84541493a2131df26ca56c5aa011970 100644 --- a/extensions/base_problems/CahnHilliard_RB.cc +++ b/extensions/base_problems/CahnHilliard_RB.cc @@ -24,6 +24,7 @@ using namespace AMDiS; CahnHilliard_RB::CahnHilliard_RB(const std::string &name_) : super(name_), + reinit(NULL), useMobility(false), doubleWell(0), gamma(1.0), @@ -32,8 +33,7 @@ CahnHilliard_RB::CahnHilliard_RB(const std::string &name_) : epsInv(10.0), minusEpsInv(-10.0), epsSqr(0.01), - minusEpsSqr(-0.01), - reinit(NULL) + minusEpsSqr(-0.01) { // parameters for CH Parameters::get(name + "->use mobility", useMobility); // mobility diff --git a/extensions/base_problems/LinearElasticityPhase.cc b/extensions/base_problems/LinearElasticityPhase.cc index 378c9d25e2c748e7f45444544572306f6a8c256a..4e3e053fbfd52e5eb0baadc34bd51773785365ef 100644 --- a/extensions/base_problems/LinearElasticityPhase.cc +++ b/extensions/base_problems/LinearElasticityPhase.cc @@ -31,8 +31,8 @@ LinearElasticityPhase::LinearElasticityPhase(const std::string &name_) : displacement(NULL), phase(NULL), phaseOld(NULL), - dirichletPhase(NULL), - bcFct(NULL) + bcFct(NULL), + dirichletPhase(NULL) { for (int i = 0; i < bcDOF.getSize(); ++i) bcDOF[i] = NULL; @@ -70,7 +70,7 @@ void LinearElasticityPhase::initData() super::initData(); dbc_factor = beta/pow(epsilon, alpha); - MSG_DBG("dbc_factor = %f\n", dbc_factor); + MSG("dbc_factor = %f\n", dbc_factor); } diff --git a/extensions/base_problems/NavierStokesCahnHilliard.cc b/extensions/base_problems/NavierStokesCahnHilliard.cc index d0a0f426a8d324f9d79579fa28823c6803232025..3d20b045b0bd6eb4c47996982e2331ee2177508d 100644 --- a/extensions/base_problems/NavierStokesCahnHilliard.cc +++ b/extensions/base_problems/NavierStokesCahnHilliard.cc @@ -23,7 +23,20 @@ using namespace AMDiS; NavierStokesCahnHilliard::NavierStokesCahnHilliard(const std::string &name_, bool createProblem) : super(name_, createProblem), + viscosity1(1.0), + viscosity2(1.0), + density1(1.0), + density2(1.0), + densityPhase(NULL), + viscosityPhase(NULL), + multiPhase(NULL), + velocity(NULL), + fileWriter(NULL), useMobility(false), + refFunction(NULL), + refinement(NULL), + sigma(0.0), + surfaceTension(0.0), doubleWell(0), gamma(1.0), eps(0.1), @@ -31,18 +44,7 @@ NavierStokesCahnHilliard::NavierStokesCahnHilliard(const std::string &name_, boo epsInv(10.0), minusEpsInv(-10.0), epsSqr(0.01), - minusEpsSqr(-0.01), - multiPhase(NULL), - densityPhase(NULL), - viscosityPhase(NULL), - viscosity1(1.0), - viscosity2(1.0), - density1(1.0), - density2(1.0), - refFunction(NULL), - refinement(NULL), - sigma(0.0), - surfaceTension(0.0) + minusEpsSqr(-0.01) { dow = Global::getGeo(WORLD); Initfile::get(name + "->viscosity1", viscosity1); // viscosity of fluid 1 @@ -134,7 +136,7 @@ void NavierStokesCahnHilliard::initData() //fileWriter = new FileVectorWriter(name + "->velocity->output", getFeSpace()->getMesh(), velocity); super::initData(); -}; +} void NavierStokesCahnHilliard::closeTimestep(AdaptInfo *adaptInfo) @@ -151,7 +153,7 @@ void NavierStokesCahnHilliard::initTimestep(AdaptInfo *adaptInfo) LinearInterpolation1 vLI(viscosity1, viscosity2); transformDOF(prob->getSolution()->getDOFVector(dow+2), densityPhase, &dLI); transformDOF(prob->getSolution()->getDOFVector(dow+2), viscosityPhase, &vLI); -}; +} @@ -324,7 +326,7 @@ void NavierStokesCahnHilliard::fillOperators() /// Navier-Stokes part int degree_u = getFeSpace(0)->getBasisFcts()->getDegree(); - int degree_p = getFeSpace(dow)->getBasisFcts()->getDegree(); +// int degree_p = getFeSpace(dow)->getBasisFcts()->getDegree(); WorldVector<DOFVector<double>* > vel; for (unsigned i = 0; i < dow; i++){ @@ -416,7 +418,7 @@ void NavierStokesCahnHilliard::fillOperators() } /**/ -}; +} void NavierStokesCahnHilliard::addLaplaceTerm(int i) @@ -434,4 +436,4 @@ void NavierStokesCahnHilliard::addLaplaceTerm(int i) /// < alpha*grad(u'_i) , grad(psi) > -}; +} diff --git a/extensions/base_problems/NavierStokesPhase_TaylorHood.cc b/extensions/base_problems/NavierStokesPhase_TaylorHood.cc index 54638886254f5f0be0d0b85e95f34d5a26367450..cd58bebd673836b314e4d4451ddbdffdf8b08b2a 100644 --- a/extensions/base_problems/NavierStokesPhase_TaylorHood.cc +++ b/extensions/base_problems/NavierStokesPhase_TaylorHood.cc @@ -21,13 +21,13 @@ using namespace AMDiS; NavierStokesPhase_TaylorHood::NavierStokesPhase_TaylorHood(const std::string &name_) : super(name_), - phase(NULL), - bcFct(NULL), beta(1.0), epsilon(1.e-1), alpha(3.0), - fileWriterPhase(NULL), - phaseOld(NULL) + phase(NULL), + phaseOld(NULL), + bcFct(NULL), + fileWriterPhase(NULL) { for (int i = 0; i < bcDOF.getSize(); ++i) bcDOF[i] = NULL; @@ -58,7 +58,7 @@ void NavierStokesPhase_TaylorHood::initData() phaseOld = new DOFVector<double>(getFeSpace(0), "phaseOld"); dbc_factor = beta/pow(epsilon, alpha); - MSG_DBG("dbc_factor = %f\n", dbc_factor); + MSG("dbc_factor = %f\n", dbc_factor); } diff --git a/extensions/base_problems/NavierStokes_TH_MultiPhase.cc b/extensions/base_problems/NavierStokes_TH_MultiPhase.cc index 7deb3470e8d0de1c3aa9504aacab0830a4b7082d..5e8eb4400c8f8e57f615ef535a211a32441cee5b 100644 --- a/extensions/base_problems/NavierStokes_TH_MultiPhase.cc +++ b/extensions/base_problems/NavierStokes_TH_MultiPhase.cc @@ -20,13 +20,13 @@ using namespace AMDiS; NavierStokes_TH_MultiPhase::NavierStokes_TH_MultiPhase(const std::string &name_, bool createProblem) : super(name_, createProblem), - multiPhase(NULL), - densityPhase(NULL), - viscosityPhase(NULL), viscosity1(1.0), viscosity2(1.0), density1(1.0), - density2(1.0) + density2(1.0), + densityPhase(NULL), + viscosityPhase(NULL), + multiPhase(NULL) { FUNCNAME("NavierStokes_TH_MultiPhase::_constructor()"); Initfile::get(name + "->viscosity1", viscosity1); // viscosity of fluid 1 @@ -78,13 +78,13 @@ void NavierStokes_TH_MultiPhase::initTimestep(AdaptInfo *adaptInfo) transformDOF(multiPhase, viscosityPhase, &vLI); } } -}; +} void NavierStokes_TH_MultiPhase::fillOperators() { int degree_u = prob->getFeSpace(0)->getBasisFcts()->getDegree(); - int degree_p = prob->getFeSpace(dow)->getBasisFcts()->getDegree(); +// int degree_p = prob->getFeSpace(dow)->getBasisFcts()->getDegree(); WorldVector<DOFVector<double>* > vel; for (unsigned i = 0; i < dow; i++){ diff --git a/extensions/base_problems/NavierStokes_TH_MultiPhase_RB.cc b/extensions/base_problems/NavierStokes_TH_MultiPhase_RB.cc index 083ac09a8af6d3bcfabbf5ed8114a6bf22f050ef..cc58f14b2322d12b0ea4fd972cbcb291285f7ba8 100644 --- a/extensions/base_problems/NavierStokes_TH_MultiPhase_RB.cc +++ b/extensions/base_problems/NavierStokes_TH_MultiPhase_RB.cc @@ -21,13 +21,13 @@ using namespace AMDiS; NavierStokes_TH_MultiPhase_RB::NavierStokes_TH_MultiPhase_RB(const std::string &name_, bool createProblem) : super(name_, createProblem), - multiPhase(NULL), - densityPhase(NULL), - viscosityPhase(NULL), viscosity1(-1.0), viscosity2(1.0), density1(1.0), - density2(1.0) + density2(1.0), + densityPhase(NULL), + viscosityPhase(NULL), + multiPhase(NULL) { FUNCNAME("NavierStokes_TH_MultiPhase_RB::_constructor()"); Initfile::get(name + "->viscosity1", viscosity1); // viscosity of fluid 1 @@ -78,7 +78,7 @@ void NavierStokes_TH_MultiPhase_RB::initTimestep(AdaptInfo *adaptInfo) void NavierStokes_TH_MultiPhase_RB::fillOperators() { int degree_u = prob->getFeSpace(0)->getBasisFcts()->getDegree(); - int degree_p = prob->getFeSpace(dow)->getBasisFcts()->getDegree(); +// int degree_p = prob->getFeSpace(dow)->getBasisFcts()->getDegree(); WorldVector<DOFVector<double>* > vel; for (unsigned i = 0; i < dow; i++) diff --git a/extensions/base_problems/NavierStokes_TaylorHood.cc b/extensions/base_problems/NavierStokes_TaylorHood.cc index bbdd02261137e65c26e5970d1df2ce47abf0e094..5e5013111fee14126f4a441bdd140605c8d5a53a 100644 --- a/extensions/base_problems/NavierStokes_TaylorHood.cc +++ b/extensions/base_problems/NavierStokes_TaylorHood.cc @@ -20,6 +20,7 @@ using namespace AMDiS; NavierStokes_TaylorHood::NavierStokes_TaylorHood(const std::string &name_, bool createProblem) : super(name_, createProblem), + velocity(NULL), laplaceType(0), nonLinTerm(2), oldTimestep(0.0), @@ -29,7 +30,6 @@ NavierStokes_TaylorHood::NavierStokes_TaylorHood(const std::string &name_, bool theta(0.5+1.e-2), theta1(1-theta), minusTheta1(-theta1), - velocity(NULL), fileWriter(NULL) { // fluid viscosity diff --git a/extensions/base_problems/NavierStokes_TaylorHood_RB.cc b/extensions/base_problems/NavierStokes_TaylorHood_RB.cc index ded2a869c7903e6752bb84800619a5344f7ebe3e..b139415eafd908fccfc242de7dc5878c548474bd 100644 --- a/extensions/base_problems/NavierStokes_TaylorHood_RB.cc +++ b/extensions/base_problems/NavierStokes_TaylorHood_RB.cc @@ -20,10 +20,10 @@ using namespace AMDiS; NavierStokes_TaylorHood_RB::NavierStokes_TaylorHood_RB(const std::string &name_, bool createProblem) : super(name_, createProblem), + velocity(NULL), laplaceType(0), oldTimestep(0.0), viscosity(1.0), - velocity(NULL), fileWriter(NULL) { // fluid viscosity @@ -81,8 +81,8 @@ void NavierStokes_TaylorHood_RB::fillOperators() U[i] = prob->getStageSolution(i); U_old[i] = prob->getUnVec(i); } - DOFVector<double> *p = prob->getStageSolution(dow), - *p_old = prob->getUnVec(dow); + DOFVector<double> *p = prob->getStageSolution(dow); +// *p_old = prob->getUnVec(dow); // fill operators for prob for (unsigned i = 0; i < dow; ++i) { diff --git a/extensions/base_problems/PhaseFieldCrystal_Phase.cc b/extensions/base_problems/PhaseFieldCrystal_Phase.cc index 3173b494926c71fae89df9e048894dd5670b74fa..30c3a9a1f56f55c7a5304493430227f8743078bc 100644 --- a/extensions/base_problems/PhaseFieldCrystal_Phase.cc +++ b/extensions/base_problems/PhaseFieldCrystal_Phase.cc @@ -23,7 +23,7 @@ PhaseFieldCrystal_Phase::PhaseFieldCrystal_Phase(const std::string &name_) : PhaseFieldCrystal(name_), phase(NULL), phaseDisturbed(NULL) -{}; +{} PhaseFieldCrystal_Phase::~PhaseFieldCrystal_Phase() @@ -37,12 +37,11 @@ void PhaseFieldCrystal_Phase::initTimeInterface() { FUNCNAME("PhaseFieldCrystal_Phase::initTimeInterface()"); PhaseFieldCrystal::initTimeInterface(); -}; +} void PhaseFieldCrystal_Phase::fillOperators() { FUNCNAME("PhaseFieldCrystal_Phase::fillOperators()"); - MSG_DBG("PhaseFieldCrystal_Phase::fillOperators()\n"); int degree = prob->getFeSpace(0)->getBasisFcts()->getDegree(); @@ -98,4 +97,4 @@ void PhaseFieldCrystal_Phase::fillOperators() // prob.addMatrixOperator(opMnew,2,2,&minus2); // . . . vectorOperators . . . . . . . . . . . . . . . prob->addVectorOperator(opMPowExpl, 2); // -2*phi^old*rho_old^3 -}; +} diff --git a/extensions/base_problems/PhaseFieldCrystal_RB.cc b/extensions/base_problems/PhaseFieldCrystal_RB.cc index 3deac7acf1dba4006e17691516033b789adacd8a..36c02770b73042524055c55fd32c2f66c6ec7ecb 100644 --- a/extensions/base_problems/PhaseFieldCrystal_RB.cc +++ b/extensions/base_problems/PhaseFieldCrystal_RB.cc @@ -35,7 +35,7 @@ PhaseFieldCrystal_RB::PhaseFieldCrystal_RB(const std::string &name_, bool create Parameters::get(name + "->density", density); Parameters::get(name + "->use mobility", useMobility); tempParameter= -(1.0+r); -}; +} void PhaseFieldCrystal_RB::fillOperators() @@ -124,9 +124,9 @@ void PhaseFieldCrystal_RB::fillOperators() // . . . nonlinear terms . . . . . . . . . . . . . . . prob->addMatrixOperator(opMPowImpl, 2, 0); // 3*rho*rho_old^2 prob->addVectorOperator(opMPowExpl, 2); // -rho'^3 -}; +} void PhaseFieldCrystal_RB::fillBoundaryConditions() { FUNCNAME("PhaseFieldCrystal_RB::fillBoundaryConditions()"); -}; +} diff --git a/extensions/time/ExtendedRosenbrockStationary.h b/extensions/time/ExtendedRosenbrockStationary.h index 516198fc922182c6305c275edfbb399c2a5f978f..62344d016c290029b262113c8c01942c6d86cd33 100644 --- a/extensions/time/ExtendedRosenbrockStationary.h +++ b/extensions/time/ExtendedRosenbrockStationary.h @@ -62,10 +62,10 @@ using namespace AMDiS; ExtendedRosenbrockStationary(std::string name, int componentShift_ = 0) : super(name), componentShift(componentShift_), + order(0), first(true), fixedTimestep(false), enforceAsmMat(false), - order(0), minusOne(-1.0), invTauGamma(1.0), stageTime(0.0),