Am Montag, 13. Mai 2022, finden Wartungsarbeiten am Gitlab-Server (Update auf neue Version statt). Der Dienst wird daher am Montag für einige Zeit nicht verfügbar sein.
On Monday, May 13th 2022, the Gitlab server will be updated. The service will therefore not be accessible for some time on Monday.

Commit 80ce300b authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

some compiler warnings removed

parent f5c1cb21
......@@ -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);
}
......
......@@ -387,6 +387,8 @@ namespace AMDiS { namespace Parallel {
VecDestroy(&tmpPrimal);
VecDestroy(&tmpInterior0);
VecDestroy(&tmpInterior1);
PetscFunctionReturn(0);
}
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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++];
}
......
......@@ -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;
}
......
......@@ -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");
......
......@@ -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++) {
......
......@@ -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));
}
}
......
......@@ -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 >
......
......@@ -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) {
......
......@@ -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
// =============
......
......@@ -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();
......
......@@ -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;
};
/* -------------------------------------------------------------- */
......
......@@ -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++;
......
......@@ -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;
......
......@@ -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) );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment