Commit 3484b9be authored by Sebastian Aland's avatar Sebastian Aland

PetscSolverCahnHilliard2 korrigiert

parent 0e7a58de
......@@ -23,7 +23,7 @@
#ifndef AMDIS_PETSC_SOLVER_CAHN_HILLIARD2_H
#define AMDIS_PETSC_SOLVER_CAHN_HILLIARD2_H
#include "parallel/PetscSolverGlobalBlockMatrix.h"
#include "parallel/PetscSolverGlobalMatrix.h"
namespace AMDiS {
......@@ -31,12 +31,12 @@ namespace AMDiS {
struct CahnHilliardData2 {
KSP kspMass, kspMinusDeltaK, kspMplusK;
Mat matM, matMinusDeltaK;
Mat matMass, matMinusDeltaK;
double *eps, *delta;
MPI::Intracomm *mpiCommGlobal;
};
class PetscSolverCahnHilliard2 : public PetscSolverGlobalBlockMatrix
class PetscSolverCahnHilliard2 : public PetscSolverGlobalMatrix
{
public:
/// Creator class
......@@ -51,33 +51,63 @@ namespace AMDiS {
return new PetscSolverCahnHilliard2(this->name);
}
};
PetscSolverCahnHilliard2(string name, double *epsPtr = NULL, double *deltaPtr = NULL);
PetscSolverCahnHilliard2(string name);
void solvePetscMatrix(SystemVector &vec, AdaptInfo *adaptInfo);
void setChData(double *epsPtr, double *deltaPtr)
{
eps = epsPtr;
delta = deltaPtr;
}
void setPhase(DOFVector<double> *d, double eP3=0)
{
phase = d;
epsPhase3 = eP3;
}
protected:
void initSolver(KSP &ksp);
void initPreconditioner(PC pc);
void exitPreconditioner(PC pc);
PetscSolver* createSubSolver(int component, string kspPrefix);
private:
int pressureComponent;
bool pressureNullSpace;
/// If true, old solution is used for initial guess in solver phase.
bool useOldInitialGuess;
/// 0: approximate solve 1: direct solver
int velocitySolutionMode;
/// 0: approximate solve 1: direct solver
int massSolutionMode;
/// 0: approximate solve 1: direct solver
int laplaceSolutionMode;
PetscSolver *massMatrixSolver, *laplaceMatrixSolver, *deltaKMatrixSolver;
CahnHilliardData2 matShellContext;
double *eps, *delta;
double epsPhase3;
SystemVector* solution;
DOFVector<double>* phase;
};
}
#endif // AMDIS_PETSC_SOLVER_CAHN_HILLIARD2_H
#endif
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