Commit 7b38ea10 authored by Praetorius, Simon's avatar Praetorius, Simon

some changes in PetscSolverGlobalMatrix

parent 923b0774
......@@ -29,7 +29,7 @@ namespace AMDiS {
VecAtQP_FOT::VecAtQP_FOT(DOFVectorBase<double> *dv,
AbstractFunction<double, double> *af,
WorldVector<double> *wv)
: FirstOrderTerm(af->getDegree()), vec(dv), f(af), b(wv)
: FirstOrderTerm(af ? af->getDegree() : dv->getFeSpace()->getBasisFcts()->getDegree()), vec(dv), f(af), b(wv)
{
TEST_EXIT(dv)("No vector!\n");
......@@ -39,7 +39,7 @@ namespace AMDiS {
VecAtQP_FOT::VecAtQP_FOT(DOFVectorBase<double> *dv,
AbstractFunction<double, double> *af,
int bIdx)
: FirstOrderTerm(af->getDegree()), vec(dv), f(af)
: FirstOrderTerm(af ? af->getDegree() : dv->getFeSpace()->getBasisFcts()->getDegree()), vec(dv), f(af)
{
TEST_EXIT(dv)("No vector!\n");
......@@ -69,14 +69,29 @@ namespace AMDiS {
const int nPoints = static_cast<int>(Lb.size());
if (bOne > -1) {
for (int iq = 0; iq < nPoints; iq++)
lb_one(grdLambda, Lb[iq], (*f)(vecAtQPs[iq]));
if (f) {
for (int iq = 0; iq < nPoints; iq++)
lb_one(grdLambda, Lb[iq], (*f)(vecAtQPs[iq]));
} else {
for (int iq = 0; iq < nPoints; iq++)
lb_one(grdLambda, Lb[iq], vecAtQPs[iq]);
}
} else if (b) {
for (int iq = 0; iq < nPoints; iq++)
lb(grdLambda, *b, Lb[iq], (*f)(vecAtQPs[iq]));
if (f) {
for (int iq = 0; iq < nPoints; iq++)
lb(grdLambda, *b, Lb[iq], (*f)(vecAtQPs[iq]));
} else {
for (int iq = 0; iq < nPoints; iq++)
lb(grdLambda, *b, Lb[iq], vecAtQPs[iq]);
}
} else {
for (int iq = 0; iq < nPoints; iq++)
l1(grdLambda, Lb[iq], (*f)(vecAtQPs[iq]));
if (f) {
for (int iq = 0; iq < nPoints; iq++)
l1(grdLambda, Lb[iq], (*f)(vecAtQPs[iq]));
} else {
for (int iq = 0; iq < nPoints; iq++)
l1(grdLambda, Lb[iq], vecAtQPs[iq]);
}
}
}
......@@ -91,7 +106,7 @@ namespace AMDiS {
if (num_rows(grdUhAtQP) > 0) {
for (int iq = 0; iq < nPoints; iq++) {
double factor = (*f)(vecAtQPs[iq]);
double factor = (f ? (*f)(vecAtQPs[iq]) : vecAtQPs[iq]);
double resultQP = 0.0;
for (int i = 0; i < dow; i++)
resultQP += grdUhAtQP[iq][i];
......@@ -522,7 +537,11 @@ namespace AMDiS {
Vec2AtQP_FOT::Vec2AtQP_FOT(DOFVectorBase<double> *dv1, DOFVectorBase<double> *dv2,
BinaryAbstractFunction<double, double, double> *af,
WorldVector<double> *b_)
: FirstOrderTerm(af->getDegree()), vec1(dv1), vec2(dv2), f(af), b(b_)
: FirstOrderTerm(af ?
af->getDegree() :
dv1->getFeSpace()->getBasisFcts()->getDegree()
+ dv2->getFeSpace()->getBasisFcts()->getDegree()),
vec1(dv1), vec2(dv2), f(af), b(b_)
{
TEST_EXIT(dv1)("No first vector!\n");
TEST_EXIT(dv2)("No second vector!\n");
......@@ -534,7 +553,11 @@ namespace AMDiS {
Vec2AtQP_FOT::Vec2AtQP_FOT(DOFVectorBase<double> *dv1, DOFVectorBase<double> *dv2,
BinaryAbstractFunction<double, double, double> *af,
int bIdx)
: FirstOrderTerm(af->getDegree()), vec1(dv1), vec2(dv2), f(af)
: FirstOrderTerm(af ?
af->getDegree() :
dv1->getFeSpace()->getBasisFcts()->getDegree()
+ dv2->getFeSpace()->getBasisFcts()->getDegree()),
vec1(dv1), vec2(dv2), f(af)
{
TEST_EXIT(dv1)("No first vector!\n");
TEST_EXIT(dv2)("No second vector!\n");
......@@ -559,14 +582,29 @@ namespace AMDiS {
const int nPoints = static_cast<int>(Lb.size());
if (bOne > -1) {
for (int iq = 0; iq < nPoints; iq++)
lb_one(grdLambda, Lb[iq], (*f)(vec1AtQPs[iq], vec2AtQPs[iq]));
if (f) {
for (int iq = 0; iq < nPoints; iq++)
lb_one(grdLambda, Lb[iq], (*f)(vec1AtQPs[iq], vec2AtQPs[iq]));
} else {
for (int iq = 0; iq < nPoints; iq++)
lb_one(grdLambda, Lb[iq], vec1AtQPs[iq] * vec2AtQPs[iq]);
}
} else if (b) {
for (int iq = 0; iq < nPoints; iq++)
lb(grdLambda, *b, Lb[iq], (*f)(vec1AtQPs[iq], vec2AtQPs[iq]));
if (f) {
for (int iq = 0; iq < nPoints; iq++)
lb(grdLambda, *b, Lb[iq], (*f)(vec1AtQPs[iq], vec2AtQPs[iq]));
} else {
for (int iq = 0; iq < nPoints; iq++)
lb(grdLambda, *b, Lb[iq], vec1AtQPs[iq] * vec2AtQPs[iq]);
}
} else {
for (int iq = 0; iq < nPoints; iq++)
l1(grdLambda, Lb[iq], (*f)(vec1AtQPs[iq], vec2AtQPs[iq]));
if (f) {
for (int iq = 0; iq < nPoints; iq++)
l1(grdLambda, Lb[iq], (*f)(vec1AtQPs[iq], vec2AtQPs[iq]));
} else {
for (int iq = 0; iq < nPoints; iq++)
l1(grdLambda, Lb[iq], vec1AtQPs[iq] * vec2AtQPs[iq]);
}
}
}
......@@ -577,9 +615,15 @@ namespace AMDiS {
mtl::dense_vector<double>& result,
double fac)
{
if (num_rows(grdUhAtQP) > 0)
for (int iq = 0; iq < nPoints; iq++)
result[iq] += fac * (*f)(vec1AtQPs[iq], vec2AtQPs[iq]) * ((*b) * grdUhAtQP[iq]);
if (num_rows(grdUhAtQP) > 0) {
if (f) {
for (int iq = 0; iq < nPoints; iq++)
result[iq] += fac * (*f)(vec1AtQPs[iq], vec2AtQPs[iq]) * ((*b) * grdUhAtQP[iq]);
} else {
for (int iq = 0; iq < nPoints; iq++)
result[iq] += fac * vec1AtQPs[iq] * vec2AtQPs[iq] * ((*b) * grdUhAtQP[iq]);
}
}
}
......@@ -590,7 +634,11 @@ namespace AMDiS {
DOFVectorBase<double> *dv3,
TertiaryAbstractFunction<double, double, double, double> *f_,
WorldVector<double> *bvec)
: FirstOrderTerm(f_->getDegree()),
: FirstOrderTerm(f_ ?
f_->getDegree() :
dv1->getFeSpace()->getBasisFcts()->getDegree()
+ dv2->getFeSpace()->getBasisFcts()->getDegree()
+ dv3->getFeSpace()->getBasisFcts()->getDegree()),
vec1(dv1),
vec2(dv2),
vec3(dv3),
......@@ -607,7 +655,11 @@ namespace AMDiS {
DOFVectorBase<double> *dv3,
TertiaryAbstractFunction<double, double, double, double> *f_,
int b)
: FirstOrderTerm(f_->getDegree()),
: FirstOrderTerm(f_ ?
f_->getDegree() :
dv1->getFeSpace()->getBasisFcts()->getDegree()
+ dv2->getFeSpace()->getBasisFcts()->getDegree()
+ dv3->getFeSpace()->getBasisFcts()->getDegree()),
vec1(dv1),
vec2(dv2),
vec3(dv3),
......@@ -635,14 +687,28 @@ namespace AMDiS {
const int nPoints = static_cast<int>(Lb.size());
if (bOne > -1) {
for (int iq = 0; iq < nPoints; iq++)
lb_one(grdLambda, Lb[iq], (*f)(vec1AtQPs[iq], vec2AtQPs[iq], vec3AtQPs[iq]));
} else {
for (int iq = 0; iq < nPoints; iq++) {
if (b)
lb(grdLambda, *b, Lb[iq], (*f)(vec1AtQPs[iq], vec2AtQPs[iq], vec3AtQPs[iq]));
else
l1(grdLambda, Lb[iq], (*f)(vec1AtQPs[iq], vec2AtQPs[iq], vec3AtQPs[iq]));
if (f) {
for (int iq = 0; iq < nPoints; iq++)
lb_one(grdLambda, Lb[iq], (*f)(vec1AtQPs[iq], vec2AtQPs[iq], vec3AtQPs[iq]));
} else {
for (int iq = 0; iq < nPoints; iq++)
lb_one(grdLambda, Lb[iq], vec1AtQPs[iq] * vec2AtQPs[iq] * vec3AtQPs[iq]);
}
} else {
if (f) {
for (int iq = 0; iq < nPoints; iq++) {
if (b)
lb(grdLambda, *b, Lb[iq], (*f)(vec1AtQPs[iq], vec2AtQPs[iq], vec3AtQPs[iq]));
else
l1(grdLambda, Lb[iq], (*f)(vec1AtQPs[iq], vec2AtQPs[iq], vec3AtQPs[iq]));
}
} else {
for (int iq = 0; iq < nPoints; iq++) {
if (b)
lb(grdLambda, *b, Lb[iq], vec1AtQPs[iq] * vec2AtQPs[iq] * vec3AtQPs[iq]);
else
l1(grdLambda, Lb[iq], vec1AtQPs[iq] * vec2AtQPs[iq] * vec3AtQPs[iq]);
}
}
}
}
......@@ -660,9 +726,15 @@ namespace AMDiS {
if (bOne > -1) {
ERROR_EXIT("Not yet implemented!\n");
} else {
for (int iq = 0; iq < nPoints; iq++)
result[iq] += fac * (*f)(vec1AtQPs[iq], vec2AtQPs[iq] ,vec3AtQPs[iq]) *
((*b) * grdUhAtQP[iq]);
if (f) {
for (int iq = 0; iq < nPoints; iq++)
result[iq] += fac * (*f)(vec1AtQPs[iq], vec2AtQPs[iq] ,vec3AtQPs[iq]) *
((*b) * grdUhAtQP[iq]);
} else {
for (int iq = 0; iq < nPoints; iq++)
result[iq] += fac * vec1AtQPs[iq] * vec2AtQPs[iq] * vec3AtQPs[iq] *
((*b) * grdUhAtQP[iq]);
}
}
}
......
......@@ -187,8 +187,11 @@ namespace AMDiS {
// ========== VecAtQP_SOT ==========
VecAtQP_SOT::VecAtQP_SOT(DOFVectorBase<double> *dv,
AbstractFunction<double, double> *af)
: SecondOrderTerm(af ? af->getDegree() : dv->getFeSpace()->getBasisFcts()->getDegree()), vec(dv), f(af)
AbstractFunction<double, double> *af,
double factor_
)
: SecondOrderTerm(af ? af->getDegree() : dv->getFeSpace()->getBasisFcts()->getDegree()),
vec(dv), f(af), factor(factor_)
{
setSymmetric(true);
......@@ -220,10 +223,10 @@ namespace AMDiS {
if (f) {
for (int iq = 0; iq < nPoints; iq++)
l1lt(grdLambda, LALt[iq], (*f)(vecAtQPs[iq]));
l1lt(grdLambda, LALt[iq], factor*(*f)(vecAtQPs[iq]));
} else {
for (int iq = 0; iq < nPoints; iq++)
l1lt(grdLambda, LALt[iq], vecAtQPs[iq]);
l1lt(grdLambda, LALt[iq], factor*vecAtQPs[iq]);
}
}
......@@ -237,19 +240,20 @@ namespace AMDiS {
int dow = Global::getGeo(WORLD);
if (num_rows(D2UhAtQP) > 0) {
double fac_ = factor * fac;
if (f) {
for (int iq = 0; iq < nPoints; iq++) {
double resultQP = 0.0;
for (int i = 0; i < dow; i++)
resultQP += D2UhAtQP[iq][i][i];
result[iq] += fac * (*f)(vecAtQPs[iq]) * resultQP;
result[iq] += fac_ * (*f)(vecAtQPs[iq]) * resultQP;
}
} else {
for (int iq = 0; iq < nPoints; iq++) {
double resultQP = 0.0;
for (int i = 0; i < dow; i++)
resultQP += D2UhAtQP[iq][i][i];
result[iq] += fac * vecAtQPs[iq] * resultQP;
result[iq] += fac_ * vecAtQPs[iq] * resultQP;
}
}
}
......@@ -261,13 +265,13 @@ namespace AMDiS {
int nPoints = grdUhAtQP.size();
if (f) {
for (int iq = 0; iq < nPoints; iq++) {
double factor = (*f)(vecAtQPs[iq]);
axpy(factor, grdUhAtQP[iq], result[iq]);
double fac_ = factor * (*f)(vecAtQPs[iq]);
axpy(fac_, grdUhAtQP[iq], result[iq]);
}
} else {
for (int iq = 0; iq < nPoints; iq++) {
double factor = vecAtQPs[iq];
axpy(factor, grdUhAtQP[iq], result[iq]);
double fac_ = factor * vecAtQPs[iq];
axpy(fac_, grdUhAtQP[iq], result[iq]);
}
}
}
......@@ -276,8 +280,11 @@ namespace AMDiS {
// ========== Vec2AtQP_SOT ==========
Vec2AtQP_SOT::Vec2AtQP_SOT(DOFVectorBase<double> *dv1, DOFVectorBase<double> *dv2,
BinaryAbstractFunction<double, double, double> *af)
: SecondOrderTerm(af ? af->getDegree() : 2*dv1->getFeSpace()->getBasisFcts()->getDegree()), vec1(dv1), vec2(dv2), f(af)
BinaryAbstractFunction<double, double, double> *af,
double factor_
)
: SecondOrderTerm(af ? af->getDegree() : 2*dv1->getFeSpace()->getBasisFcts()->getDegree()),
vec1(dv1), vec2(dv2), f(af), factor(factor_)
{
setSymmetric(true);
......@@ -304,9 +311,9 @@ namespace AMDiS {
for (int iq = 0; iq < nPoints; iq++) {
if (f)
l1lt(grdLambda, LALt[iq], (*f)(vecAtQPs1[iq], vecAtQPs2[iq]));
l1lt(grdLambda, LALt[iq], factor * (*f)(vecAtQPs1[iq], vecAtQPs2[iq]));
else
l1lt(grdLambda, LALt[iq], vecAtQPs1[iq] * vecAtQPs2[iq]);
l1lt(grdLambda, LALt[iq], factor * vecAtQPs1[iq] * vecAtQPs2[iq]);
}
}
......@@ -321,15 +328,16 @@ namespace AMDiS {
if (num_rows(D2UhAtQP) > 0) {
for (int iq = 0; iq < nPoints; iq++) {
double factor = 1.0;
double fac_ = 1.0;
if (f)
factor = (*f)(vecAtQPs1[iq], vecAtQPs2[iq]);
fac_ = (*f)(vecAtQPs1[iq], vecAtQPs2[iq]);
else
factor = vecAtQPs1[iq] * vecAtQPs2[iq];
fac_ = vecAtQPs1[iq] * vecAtQPs2[iq];
fac_ *= fac * factor;
double resultQP = 0.0;
for (int i = 0; i < dow; i++)
resultQP += D2UhAtQP[iq][i][i];
result[iq] += fac * factor * resultQP;
result[iq] += fac_ * resultQP;
}
}
}
......@@ -339,12 +347,13 @@ namespace AMDiS {
{
int nPoints = grdUhAtQP.size();
for (int iq = 0; iq < nPoints; iq++) {
double factor = 1.0;
double fac_ = 1.0;
if (f)
factor = (*f)(vecAtQPs1[iq], vecAtQPs2[iq]);
fac_ = (*f)(vecAtQPs1[iq], vecAtQPs2[iq]);
else
factor = vecAtQPs1[iq] * vecAtQPs2[iq];
axpy(factor, grdUhAtQP[iq], result[iq]);
fac_ = vecAtQPs1[iq] * vecAtQPs2[iq];
fac_ *= factor;
axpy(fac_, grdUhAtQP[iq], result[iq]);
}
}
......
......@@ -362,7 +362,8 @@ namespace AMDiS {
{
public:
/// Constructor.
VecAtQP_SOT(DOFVectorBase<double> *dv, AbstractFunction<double, double> *af = NULL);
VecAtQP_SOT(DOFVectorBase<double> *dv, AbstractFunction<double, double> *af = NULL,
double factor_ = 1.0);
/// Implementation of \ref OperatorTerm::initElement().
void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
......@@ -398,6 +399,8 @@ namespace AMDiS {
/// Function evaluated at \ref vecAtQPs.
AbstractFunction<double, double> *f;
double factor;
};
/**
......@@ -414,7 +417,8 @@ namespace AMDiS {
/// Constructor.
Vec2AtQP_SOT(DOFVectorBase<double> *dv1,
DOFVectorBase<double> *dv2,
BinaryAbstractFunction<double, double, double> *af = NULL);
BinaryAbstractFunction<double, double, double> *af = NULL,
double factor_ = 1.0);
/// Implementation of \ref OperatorTerm::initElement().
void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
......@@ -444,6 +448,8 @@ namespace AMDiS {
/// Function evaluated at \ref vecAtQPs.
BinaryAbstractFunction<double, double, double> *f;
double factor;
};
......
......@@ -28,59 +28,73 @@
namespace AMDiS { namespace Parallel {
PetscSolverGlobalMatrix::PetscSolverGlobalMatrix(string name)
PetscSolverGlobalMatrix::PetscSolverGlobalMatrix(string name, bool setOptions)
: PetscSolver(name),
zeroStartVector(false),
printMatInfo(false)
{
PetscParameters params;
{ FUNCNAME_DBG("PetscSolverGlobalMatrix()");
bool matSolverPackage = false;
// set the solver
std::string solverName = "petsc";
Parameters::get(name, solverName);
if (solverName == "petsc")
Parameters::get(name + "->ksp_type", solverName);
std::string kspSolver = params.solverMap[solverName];
if (params.matSolverPackage[kspSolver]) {
// direct solvers
PetscOptionsInsertString(("-" + kspPrefix + "ksp_type preonly").c_str());
PetscOptionsInsertString(("-" + kspPrefix + "pc_type lu").c_str());
PetscOptionsInsertString(("-" + kspPrefix + "pc_factor_mat_solver_package " + (kspSolver != "direct" ? kspSolver : "mumps")).c_str());
setMaxIterations(1);
zeroStartVector = true;
matSolverPackage = true;
} else if (!params.emptyParam[kspSolver]) {
// other solvers
PetscOptionsInsertString(("-" + kspPrefix + "ksp_type " + kspSolver).c_str());
}
// set the preconditioner
string precon = "";
Parameters::get(name + "->pc_type", precon);
if (!precon.size())
Parameters::get(name + "->left precon", precon);
if (!matSolverPackage && !params.emptyParam[precon]) {
precon = (params.preconMap.find(precon) != params.preconMap.end() ? params.preconMap[precon] : precon);
PetscOptionsInsertString(("-" + kspPrefix + "pc_type " + precon).c_str());
if (setOptions) {
PetscParameters params;
// set the solver
std::string solverName = "petsc";
Parameters::get(name, solverName);
if (solverName == "petsc")
Parameters::get(name + "->ksp_type", solverName);
std::string kspSolver = params.solverMap[solverName];
if (params.matSolverPackage.find(kspSolver) != params.matSolverPackage.end()) {
// direct solvers
PetscOptionsInsertString(("-" + kspPrefix + "ksp_type preonly").c_str());
PetscOptionsInsertString(("-" + kspPrefix + "pc_type lu").c_str());
PetscOptionsInsertString(("-" + kspPrefix + "pc_factor_mat_solver_package " + kspSolver).c_str());
setMaxIterations(1);
zeroStartVector = true;
matSolverPackage = true;
} else if (params.emptyParam.find(kspSolver) == params.emptyParam.end() && solverName != "petsc") {
// other solvers
PetscOptionsInsertString(("-" + kspPrefix + "ksp_type " + kspSolver).c_str());
}
// set the preconditioner
string precon = "";
Parameters::get(name + "->pc_type", precon);
if (!precon.size())
Parameters::get(name + "->left precon", precon);
if (!matSolverPackage && params.emptyParam.find(precon) == params.emptyParam.end()) {
precon = (params.preconMap.find(precon) != params.preconMap.end() ? params.preconMap[precon] : precon);
PetscOptionsInsertString(("-" + kspPrefix + "pc_type " + precon).c_str());
}
PetscOptionsInsertString(("-" + kspPrefix + "ksp_max_it " + boost::lexical_cast<std::string>(getMaxIterations())).c_str());
PetscOptionsInsertString(("-" + kspPrefix + "ksp_rtol " + boost::lexical_cast<std::string>(getRelative())).c_str());
PetscOptionsInsertString(("-" + kspPrefix + "ksp_atol " + boost::lexical_cast<std::string>(getTolerance())).c_str());
if (getInfo() >= 20)
PetscOptionsInsertString(("-" + kspPrefix + "ksp_monitor_true_residual").c_str());
else if (getInfo() >= 10)
PetscOptionsInsertString(("-" + kspPrefix + "ksp_monitor").c_str());
}
PetscOptionsInsertString(("-" + kspPrefix + "ksp_max_it " + boost::lexical_cast<std::string>(getMaxIterations())).c_str());
PetscOptionsInsertString(("-" + kspPrefix + "ksp_rtol " + boost::lexical_cast<std::string>(getRelative())).c_str());
PetscOptionsInsertString(("-" + kspPrefix + "ksp_atol " + boost::lexical_cast<std::string>(getTolerance())).c_str());
if (getInfo() >= 20)
PetscOptionsInsertString(("-" + kspPrefix + "ksp_monitor_true_residual").c_str());
else if (getInfo() >= 10)
PetscOptionsInsertString(("-" + kspPrefix + "ksp_monitor").c_str());
if (!matSolverPackage) {
Parameters::get(name + "->use zero start vector", zeroStartVector);
}
Parameters::get("parallel->print matrix info", printMatInfo);
#if DEBUG != 0
bool printOptionsInfo = false;
Parameters::get("parallel->debug->print options info", printOptionsInfo);
if (printOptionsInfo) {
MSG("PetscOptionsView:\n");
PetscViewer viewer;
PetscViewerCreate(PETSC_COMM_WORLD, &viewer);
PetscViewerSetType(viewer, PETSCVIEWERASCII);
PetscOptionsView(viewer);
PetscViewerDestroy(&viewer);
}
#endif
}
......@@ -93,7 +107,7 @@ namespace AMDiS { namespace Parallel {
TEST_EXIT_DBG(seqMat)("No DOF matrix defined!\n");
#if (DEBUG != 0)
double wtime = MPI::Wtime();
Timer t;
#endif
createMatVec(*seqMat);
......@@ -106,7 +120,8 @@ namespace AMDiS { namespace Parallel {
// === Create PETSc vector (solution and a temporary vector). ===
#if (DEBUG != 0)
MSG("Fill petsc matrix 1 needed %.5f seconds\n", MPI::Wtime() - wtime);
MSG("Fill petsc matrix 1 needed %.5f seconds\n", t.elapsed());
t.reset();
#endif
// === Transfer values from DOF matrices to the PETSc matrix. ===
......@@ -118,7 +133,8 @@ namespace AMDiS { namespace Parallel {
setDofMatrix((*seqMat)[i][j], i, j);
#if (DEBUG != 0)
MSG("Fill petsc matrix 2 needed %.5f seconds\n", MPI::Wtime() - wtime);
MSG("Fill petsc matrix 2 needed %.5f seconds\n", t.elapsed());
t.reset();
#endif
matAssembly();
......@@ -143,7 +159,7 @@ namespace AMDiS { namespace Parallel {
#if (DEBUG != 0)
MSG("Fill petsc matrix 3 needed %.5f seconds\n", MPI::Wtime() - wtime);
MSG("Fill petsc matrix 3 needed %.5f seconds\n", t.elapsed());
#endif
......@@ -163,9 +179,9 @@ namespace AMDiS { namespace Parallel {
void PetscSolverGlobalMatrix::fillPetscMatrixWithCoarseSpace(Matrix<DOFMatrix*> *seqMat)
{
FUNCNAME("PetscSolverGlobalMatrix::fillPetscMatrixWithCoarseSpace()");
FUNCNAME_DBG("PetscSolverGlobalMatrix::fillPetscMatrixWithCoarseSpace()");
TEST_EXIT_DBG(interiorMap)("Should not happen!\n");
TEST_EXIT_DBG(interiorMap)("No interiorMap! Should not happen!\n");
TEST_EXIT_DBG(coarseSpaceMap.size() == seqMat->getSize())
("Wrong sizes %d %d\n", coarseSpaceMap.size(), seqMat->getSize());
......@@ -329,7 +345,7 @@ namespace AMDiS { namespace Parallel {
void PetscSolverGlobalMatrix::fillPetscRhs(SystemVector *vec)
{
FUNCNAME("PetscSolverGlobalMatrix::fillPetscRhs()");
FUNCNAME_DBG("PetscSolverGlobalMatrix::fillPetscRhs()");
TEST_EXIT_DBG(vec)("No DOF vector defined!\n");
TEST_EXIT_DBG(interiorMap)("No parallel DOF map defined!\n");
......@@ -469,8 +485,6 @@ namespace AMDiS { namespace Parallel {
void PetscSolverGlobalMatrix::solveGlobal(Vec &rhs, Vec &sol)
{
FUNCNAME("PetscSolverGlobalMatrix::solveGlobal()");
Vec tmp;
if (domainComm.Get_size() == 1)
createLocalVec(*interiorMap, tmp);
......@@ -504,20 +518,15 @@ namespace AMDiS { namespace Parallel {
void PetscSolverGlobalMatrix::destroyMatrixData()
{
FUNCNAME("PetscSolverGlobalMatrix::destroyMatrixData()");
matDestroy();
exitPreconditioner(pcInterior);
exitSolver(kspInterior);
}
void PetscSolverGlobalMatrix::destroyVectorData()
{
FUNCNAME("PetscSolverGlobalMatrix::destroyVectorData()");
vecDestroy();
}
......@@ -559,8 +568,6 @@ namespace AMDiS { namespace Parallel {
const char* splitName,
vector<int> &components)
{
FUNCNAME("PetscSolverGlobalMatrix::createFieldSplit()");
IS is;
interiorMap->createIndexSet(is, components[0], components.size());
PCFieldSplitSetIS(pc, splitName, is);
......@@ -570,7 +577,6 @@ namespace AMDiS { namespace Parallel {
void PetscSolverGlobalMatrix::extractVectorComponent(Vec input, int i, Vec *output, int numberOfComponents)
{
FUNCNAME("PetscSolverGlobalMatrix::extractVectorComponent()");
IS is;
interiorMap->createIndexSet(is, i, numberOfComponents);
VecGetSubVector(input, is, output);
......@@ -579,7 +585,6 @@ namespace AMDiS { namespace Parallel {
void PetscSolverGlobalMatrix::extractMatrixComponent(Mat input, int startRow, int numberOfRows, int startCol, int numberOfCols, Mat *output)
{
FUNCNAME("PetscSolverGlobalMatrix::extractMatrixComponent()");
IS isrow, iscol;