Commit 1c145a63 authored by Thomas Witkowski's avatar Thomas Witkowski

Fixed problem for nnz structure with PETSc global matrix solver.

parent 6c719d35
......@@ -421,7 +421,7 @@ namespace AMDiS {
WorldVector<double> tmp = (it->second)[i];
tmp -= recvCoords[it->first][i];
if (norm(tmp) > 1e-13) {
if (norm(tmp) > 1e-8) {
// === Print error message if the coordinates are not the same. ===
if (printCoords) {
MSG("[DBG] i = %d\n", i);
......
......@@ -48,7 +48,9 @@ namespace AMDiS {
meshDistributor->getMpiComm().Allreduce(&sendValue, &recvAllValues,
1, MPI_INT, MPI_SUM);
if (!d_nnz || recvAllValues != 0) {
recvAllValues = 1;
if (!d_nnz || recvAllValues != 0 || alwaysCreateNnzStructure) {
if (d_nnz) {
delete [] d_nnz;
d_nnz = NULL;
......@@ -208,7 +210,7 @@ namespace AMDiS {
void PetscSolverGlobalMatrix::setDofMatrix(DOFMatrix* mat, int dispMult,
int dispAddRow, int dispAddCol)
int dispAddRow, int dispAddCol)
{
FUNCNAME("PetscSolverGlobalMatrix::setDofMatrix()");
......
......@@ -39,9 +39,12 @@ namespace AMDiS {
d_nnz(NULL),
o_nnz(NULL),
lastMeshNnz(0),
zeroStartVector(false)
zeroStartVector(false),
alwaysCreateNnzStructure(false)
{
Parameters::get("parallel->use zero start vector", zeroStartVector);
Parameters::get("parallel->always create nnz structure",
alwaysCreateNnzStructure);
}
void fillPetscMatrix(Matrix<DOFMatrix*> *mat);
......@@ -77,6 +80,14 @@ namespace AMDiS {
int lastMeshNnz;
bool zeroStartVector;
/// If this variable is set to true, the non-zero matrix structure is
/// created each time from scratch by calling \ref createPetscNnzStrcuture.
/// This can be necessary if the number of non-zeros in the matrix varies
/// though the mesh does not change. This may happen if there are many
/// operators using DOFVectors from old timestep containing many zeros due to
/// some phase fields.
bool alwaysCreateNnzStructure;
};
......
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