Commit 5e11ffbe authored by Praetorius, Simon's avatar Praetorius, Simon

some bugs fixed in the extensions/demos

parent af04434c
......@@ -255,8 +255,8 @@ namespace Helpers {
minLevel = std::min(minLevel,elInfo->getLevel());
coords = elInfo->getCoords();
double h = 0.0;
for (int i = 0; i < coords.size(); i++) {
for (int j = 0; j < coords.size(); j++) {
for (int i = 0; i < coords.getSize(); i++) {
for (int j = 0; j < coords.getSize(); j++) {
if (i != j)
h = std::max(h,norm(coords[i]-coords[j]));
}
......
......@@ -70,8 +70,8 @@ protected:
double getMacroMeshSize(Mesh* mesh) {
FixVec<WorldVector<double>, VERTEX> coords = mesh->getMacroElement(0)->getCoord();
double h = 0.0;
for (int i = 0; i < coords.size(); ++i)
for (int j = i + 1; j < coords.size(); ++j)
for (int i = 0; i < coords.getSize(); ++i)
for (int j = i + 1; j < coords.getSize(); ++j)
h = std::max(h, norm(coords[i]-coords[j]));
return h;
}
......
......@@ -268,7 +268,7 @@ WorldVecAndVecFct_FOT::WorldVecAndVecFct_FOT(WorldVector<DOFVectorBase<double>*>
phaseDV(phaseDV_),
fac(fac_)
{
numVecs=vecs_.size();
numVecs=vecs_.getSize();
TEST_EXIT(numVecs==2 || numVecs==3)("Only Dim=2 or Dim=3 possible\n");
TEST_EXIT(phaseDV_)("phaseDV is NULL!\n");
......@@ -343,7 +343,7 @@ WorldVec_FOT::WorldVec_FOT(WorldVector<DOFVector<double>*> vecs_, double fac_)
: FirstOrderTerm(vecs_[0]->getFeSpace()->getBasisFcts()->getDegree()),
fac(fac_)
{
numVecs=vecs_.size();
numVecs=vecs_.getSize();
for (int i = 0; i < numVecs; i++) {
TEST_EXIT(vecs_[i])("One vector is NULL!\n");
......@@ -465,7 +465,7 @@ WorldVecPhase_FOT::WorldVecPhase_FOT(DOFVectorBase<double> *phaseDV_, WorldVecto
phaseDV(phaseDV_),
fac(fac_)
{
numVecs=vecs_.size();
numVecs=vecs_.getSize();
TEST_EXIT(numVecs==2 || numVecs==3)("Only Dim=2 or Dim=3 possible\n");
TEST_EXIT(phaseDV_)("phaseDV is NULL!\n");
......@@ -543,7 +543,7 @@ VecAndWorldVec_FOT::VecAndWorldVec_FOT(DOFVector<double>* vec0_, WorldVector<DOF
fct(fct_),
fac(fac_)
{
numVecs = vecs_.size();
numVecs = vecs_.getSize();
TEST_EXIT(numVecs == 2 || numVecs == 3)
("Only Dim=2 or Dim=3 possible\n");
......
......@@ -167,8 +167,8 @@ public:
minLevel = std::min(minLevel,elInfo->getLevel());
coords = elInfo->getCoords();
double h = 0.0;
for (int i = 0; i < coords.size(); i++) {
for (int j = 0; j < coords.size(); j++) {
for (int i = 0; i < coords.getSize(); i++) {
for (int j = 0; j < coords.getSize(); j++) {
if (i != j)
h = std::max(h,norm(coords[i]-coords[j]));
}
......@@ -444,8 +444,8 @@ public:
minLevel = std::min(minLevel,elInfo->getLevel());
coords = elInfo->getCoords();
double h = 0.0;
for (int i = 0; i < coords.size(); i++) {
for (int j = 0; j < coords.size(); j++) {
for (int i = 0; i < coords.getSize(); i++) {
for (int j = 0; j < coords.getSize(); j++) {
if (i != j)
h = std::max(h,norm(coords[i]-coords[j]));
}
......@@ -474,8 +474,8 @@ public:
FixVec<WorldVector<double>, VERTEX> coords(mesh->getDim(), NO_INIT);
coords = elInfo->getCoords();
double h = 0.0;
for (int i = 0; i < coords.size(); i++) {
for (int j = 0; j < coords.size(); j++) {
for (int i = 0; i < coords.getSize(); i++) {
for (int j = 0; j < coords.getSize(); j++) {
if (i != j)
h = std::max(h,norm(coords[i]-coords[j]));
}
......
......@@ -225,8 +225,8 @@ public:
minLevel = std::min(minLevel,elInfo->getLevel());
coords = elInfo->getCoords();
double h = 0.0;
for (int i = 0; i < coords.size(); i++) {
for (int j = 0; j < coords.size(); j++) {
for (int i = 0; i < coords.getSize(); i++) {
for (int j = 0; j < coords.getSize(); j++) {
if (i != j)
h = std::max(h,norm(coords[i]-coords[j]));
}
......@@ -255,8 +255,8 @@ public:
FixVec<WorldVector<double>, VERTEX> coords(mesh->getDim(), NO_INIT);
coords = elInfo->getCoords();
double h = 0.0;
for (int i = 0; i < coords.size(); i++) {
for (int j = 0; j < coords.size(); j++) {
for (int i = 0; i < coords.getSize(); i++) {
for (int j = 0; j < coords.getSize(); j++) {
if (i != j)
h = std::max(h,norm(coords[i]-coords[j]));
}
......
......@@ -85,10 +85,10 @@ public:
while (elInfo) {
coords = elInfo->getCoords();
center.set(0.0);
for (int i = 0; i < coords.size(); ++i) {
for (int i = 0; i < coords.getSize(); ++i) {
center += coords[i];
}
center *= 1.0 / static_cast<double>(coords.size());
center *= 1.0 / coords.getSize();
int refineLevel = (*refineFct)(center);
int oldLevel = elInfo->getLevel();
elInfo->getElement()->setMark( calcMark(refineLevel, oldLevel) );
......@@ -133,10 +133,10 @@ public:
while (elInfo) {
coords = elInfo->getCoords();
center.set(0.0);
for (int i = 0; i < coords.size(); ++i) {
for (int i = 0; i < coords.getSize(); ++i) {
center += coords[i];
}
center *= 1.0 / static_cast<double>(coords.size());
center *= 1.0 / coords.getSize();
double value = (*fct)(center);
int refineLevel = (*refineFct)(value);
int oldLevel = elInfo->getLevel();
......@@ -249,10 +249,10 @@ public:
meanValue = elFct(lambda);
coords = elInfo->getCoords();
center.set(0.0);
for (int i = 0; i < coords.size(); ++i) {
for (int i = 0; i < coords.getSize(); ++i) {
center += coords[i];
}
center *= 1.0 / static_cast<double>(coords.size());
center *= 1.0 / coords.getSize();
int refineLevel = (*refineFct)(std::make_pair(center, meanValue));
int oldLevel = elInfo->getLevel();
elInfo->getElement()->setMark( calcMark(refineLevel, oldLevel) );
......
project("cahn_hilliard_demo")
cmake_minimum_required(VERSION 2.8)
#find_package(AMDIS REQUIRED COMPONENTS umfpack )
find_package(AMDIS REQUIRED)
if(AMDIS_FOUND)
message("amdis was found\n")
include(${AMDIS_USE_FILE})
SET(BASIS_LIBS ${AMDIS_LIBRARIES})
endif(AMDIS_FOUND)
set(ch src/cahnHilliard.cc)
add_executable("ch" ${ch})
target_link_libraries("ch" ${BASIS_LIBS})
set(ch_dd src/cahnHilliard_dd.cc src/CahnHilliard_DD.cc)
add_executable("ch_dd" ${ch_dd})
target_link_libraries("ch_dd" ${BASIS_LIBS})
set(ch_shell src/cahnHilliard_shell.cc)
add_executable("ch_shell" ${ch_shell})
target_link_libraries("ch_shell" ${BASIS_LIBS})
dimension of world: 2
% =================== MESH ================================
mesh_name: mesh
mesh->macro file name: ./macro/square2d.per.2d
mesh->periodic file: ./macro/square2d.per
mesh->global refinements: 8
mesh->check: 0
lattice: 4*M_PI/sqrt(3)
mesh->scale mesh: 1
N: 10
x: ${N}*${lattice}
y: ${N}*${lattice}
mesh->dimension: [${x}, ${y}]
refinement->phasefield->level in inner domain: 5
refinement->phasefield->level in outer domain: 5
refinement->phasefield->level on interface: 10
#include "init/reinit.inc.2d"
% ============== USER-PARAMETER ==========================
ch->use reinit: 0
ch->epsilon: 0.5
ch->gamma: 1
ch->double-well type: 1
% =========== OUTPUT ==============================================
ch->space->output->filename: ./output/ch2d_
% ==================== TIMESTEPS ===============================
adapt->timestep: 0.1
adapt->max timestep: 1e+10
adapt->min timestep: 1e-10
adapt->start time: 0.0
adapt->end time: 10000.0
% ============= PROBLEM-SPACES ==================================
ch->space->components: 2
ch->space->polynomial degree[0]: 2
ch->space->polynomial degree[1]: 2
ch->space->dim: 2
ch->space->mesh: mesh
% ================== SOLVER ======================================
ch->space->solver: petsc-ch
%ch->space->solver->backend: mtl
ch->space->solver->petsc prefix: ch_
%ch->space->solver->right precon: ch
ch->space->solver->orthogonalization: 1
ch->space->solver->restart: 30
ch->space->solver->max iteration: 2000
ch->space->solver->tolerance: 1.e-8
ch->space->solver->print cycle: 10
ch->space->solver->info: 10
ch->space->solver->right precon->subsolver M->solver: cg
ch->space->solver->right precon->subsolver M->solver->backend: mtl
ch->space->solver->right precon->subsolver M->solver->tolerance: 1.e-3
ch->space->solver->right precon->subsolver M->solver->max iteration: 5
ch->space->solver->right precon->subsolver M->solver->left precon: diag
ch->space->solver->right precon->subsolver MpL->solver: cg
ch->space->solver->right precon->subsolver MpL->solver->backend: mtl
ch->space->solver->right precon->subsolver MpL->solver->tolerance: 1.e-3
ch->space->solver->right precon->subsolver MpL->solver->max iteration: 20
ch->space->solver->right precon->subsolver MpL->solver->left precon: diag
% ch->space->solver->right precon->subsolver M->solver: cg
% ch->space->solver->right precon->subsolver M->solver->backend: mtl
% ch->space->solver->right precon->subsolver M->solver->tolerance: 1.e-3
% ch->space->solver->right precon->subsolver M->solver->max iteration: 2
% ch->space->solver->right precon->subsolver M->solver->left precon: diag
%
% ch->space->solver->right precon->subsolver MpL->solver: cg
% ch->space->solver->right precon->subsolver MpL->solver->backend: mtl
% ch->space->solver->right precon->subsolver MpL->solver->tolerance: 1.e-3
% ch->space->solver->right precon->subsolver MpL->solver->max iteration: 2
% ch->space->solver->right precon->subsolver MpL->solver->left precon: diag
%
% ch->space->solver->right precon->subsolver S->solver->max iteration: 3
% =================== OUTPUT =========================================
ch->space->output->ParaView animation: 1
ch->space->output->ParaView format: 1
ch->space->output->write every i-th timestep: 10
ch->space->output->append index: 1
ch->space->output->index length: 9
ch->space->output->index decimals: 7
dimension of world: 3
% =================== MESH ================================
mesh_name: mesh
mesh->macro file name: ./macro/fliese_20x20x2.per.3d
mesh->periodic file: ./macro/fliese_20x20x2.per
mesh->global refinements: 3
mesh->check: 0
mesh->scale mesh: 1
x: 10
y: ${x}
z: ${x} / 10.0
mesh->dimension: [${x}, ${y}, ${z}]
#include "init/reinit.inc.2d"
% ============== USER-PARAMETER ==========================
ch->use reinit: 0
ch->epsilon: 0.5
ch->gamma: 1
ch->double-well type: 1
% =========== OUTPUT ==============================================
ch->space->output->filename: ./output/ch3d_
% ==================== TIMESTEPS ===============================
adapt->timestep: 0.1
adapt->max timestep: 1e+10
adapt->min timestep: 1e-10
adapt->start time: 0.0
adapt->end time: 10000.0
% ============= PROBLEM-SPACES ==================================
ch->space->components: 2
ch->space->polynomial degree[0]: 2
ch->space->polynomial degree[1]: 2
ch->space->dim: 3
ch->space->mesh: mesh
% ================== SOLVER ======================================
ch->space->solver: fgmres
ch->space->solver->use old initial guess: 1
ch->space->solver->backend: mtl
%ch->space->solver->petsc prefix: ch
ch->space->solver->right precon: ch2
ch->space->solver->orthogonalization: 1
ch->space->solver->restart: 30
ch->space->solver->ell: 3
ch->space->solver->max iteration: 2000
ch->space->solver->print cycle: 10
ch->space->solver->tolerance: 1.e-8
ch->space->solver->info: 10
ch->space->solver->right precon->subsolver M->solver: cg
ch->space->solver->right precon->subsolver M->solver->backend: mtl
ch->space->solver->right precon->subsolver M->solver->tolerance: 1.e-3
ch->space->solver->right precon->subsolver M->solver->max iteration: 5
ch->space->solver->right precon->subsolver M->solver->left precon: diag
ch->space->solver->right precon->subsolver MpL->solver: cg
ch->space->solver->right precon->subsolver MpL->solver->backend: mtl
ch->space->solver->right precon->subsolver MpL->solver->tolerance: 1.e-3
ch->space->solver->right precon->subsolver MpL->solver->max iteration: 5
ch->space->solver->right precon->subsolver MpL->solver->left precon: diag
ch->space->solver->right precon->subsolver S->solver->max iteration: 10
%
% ch->space->solver->right precon->subsolver M->solver: cg
% ch->space->solver->right precon->subsolver M->solver->backend: mtl
% ch->space->solver->right precon->subsolver M->solver->tolerance: 1.e-3
% ch->space->solver->right precon->subsolver M->solver->max iteration: 5
% ch->space->solver->right precon->subsolver M->solver->left precon: diag
%
% ch->space->solver->right precon->subsolver MpL->solver: cg
% ch->space->solver->right precon->subsolver MpL->solver->backend: mtl
% ch->space->solver->right precon->subsolver MpL->solver->tolerance: 1.e-3
% ch->space->solver->right precon->subsolver MpL->solver->max iteration: 20
% ch->space->solver->right precon->subsolver MpL->solver->left precon: diag
% =================== OUTPUT =========================================
ch->space->output->ParaView animation: 1
ch->space->output->ParaView format: 1
ch->space->output->write every i-th timestep: 10
ch->space->output->append index: 1
ch->space->output->index length: 9
ch->space->output->index decimals: 7
dimension of world: 2
% =================== MESH ================================
mesh_name: mesh
mesh->macro file name: ./macro/macro.square.fine.2d
%mesh->periodic file: ./macro/square2d.per
mesh->global refinements: 0
mesh->check: 0
parallel->pre refine: 0
#include "init/reinit.inc.2d"
% ============== USER-PARAMETER ==========================
ch->use reinit: 0
ch->epsilon: 0.01
ch->gamma: 1
ch->double-well type: 1
% =========== INPUT ==============================================
ch->phasefield->filename: ./phase.arh
ch->phasefield->perturbation: 1.e-3
% =========== OUTPUT ==============================================
ch->space->output->filename: ./output/ch2d_dd_
% ==================== TIMESTEPS ===============================
adapt->timestep: 2.e-5
adapt->max timestep: 1e+10
adapt->min timestep: 1e-10
adapt->start time: 0.0
adapt->end time: 10000.0
% ============= PROBLEM-SPACES ==================================
ch->space->components: 2
ch->space->polynomial degree[0]: 2
ch->space->polynomial degree[1]: 2
ch->space->dim: 2
ch->space->mesh: mesh
% ================== SOLVER ======================================
ch->space->solver: petsc-ch
%ch->space->solver->backend: mtl
ch->space->solver->petsc prefix: ch_
%ch->space->solver->ksp: -ch_ksp_type fgmres
%ch->space->solver->ksp: -mass_ksp_max_it 10 -mass_ksp_type fgmres -laplace_ksp_max_it 10 -laplace_ksp_type fgmres
%ch->space->solver->ksp: -ch_ksp_type=fgmres
ch->space->solver->use old initial guess: 1
%ch->space->solver->ksp: -mass_ksp_max_it 15 -laplace_ksp_max_it 1 -laplace_ksp_type richardson -laplace_pc_type lu -laplace_pc_factor_mat_solver_package mumps
%ch->space->solver->ksp: -mass_ksp_max_it 1 -mass_ksp_type richardson -mass_pc_type lu -mass_pc_factor_mat_solver_package mumps -laplace_ksp_max_it 1 -laplace_ksp_type richardson -laplace_pc_type lu -laplace_pc_factor_mat_solver_package mumps
%ch->space->solver->orthogonalization: 1
%ch->space->solver->left precon: bjacobi
%ch->space->solver->right precon: bjacobi
ch->space->solver->restart: 50
ch->space->solver->max iteration: 2000
%ch->space->solver->relative tolerance: 0
ch->space->solver->tolerance: 1.e-6
ch->space->solver->print cycle: 10
ch->space->solver->info: 10
parallel->debug->print options info: 1
% =================== OUTPUT =========================================
ch->space->output->ParaView animation: 1
ch->space->output->ParaView format: 1
ch->space->output->write every i-th timestep: 1
ch->space->output->append index: 1
ch->space->output->index length: 9
ch->space->output->index decimals: 7
ch->phasefield->output->filename: ./output/phasefield_dd_
ch->phasefield->output->ParaView animation: 1
ch->phasefield->output->ParaView format: 1
ch->phasefield->output->write every i-th timestep: 1
ch->phasefield->output->append index: 1
ch->phasefield->output->index length: 9
ch->phasefield->output->index decimals: 7
dimension of world: 2
% =================== MESH ================================
mesh_name: mesh
mesh->macro file name: ./macro/square.2d
mesh->global refinements: 11
mesh->check: 0
lattice: 4*M_PI/sqrt(3)
mesh->scale mesh: 1
N: 10
x: ${N}*${lattice}
y: ${N}*${lattice}
mesh->dimension: [${x}, ${y}]
#include "init/reinit.inc.2d"
% ============== USER-PARAMETER ==========================
ch->use reinit: 0
ch->epsilon: 0.5
ch->gamma: 1
ch->double-well type: 1
% =========== OUTPUT ==============================================
ch->output->filename: ./output/ch2d_shell_
% ==================== TIMESTEPS ===============================
adapt->timestep: 0.1
adapt->max timestep: 1e+10
adapt->min timestep: 1e-10
adapt->start time: 0.0
adapt->end time: 10000.0
% ============= PROBLEM-SPACES ==================================
ch->components: 2
ch->polynomial degree[0]: 2
ch->polynomial degree[1]: 2
ch->dim: 2
ch->mesh: mesh
% ================== SOLVER ======================================
ch->solver: fgmres
ch->solver->backend: cahn_hilliard
%ch->solver->petsc prefix: ch
ch->solver->right precon: ch
ch->solver->orthogonalization: 1
ch->solver->restart: 30
ch->solver->max iteration: 2000
ch->solver->tolerance: 1.e-8
ch->solver->info: 10
ch->solver->right precon->subsolver M->solver: cg
ch->solver->right precon->subsolver M->solver->backend: mtl
ch->solver->right precon->subsolver M->solver->tolerance: 1.e-3
ch->solver->right precon->subsolver M->solver->max iteration: 5
ch->solver->right precon->subsolver M->solver->left precon: diag
ch->solver->right precon->subsolver MpL->solver: cg
ch->solver->right precon->subsolver MpL->solver->backend: mtl
ch->solver->right precon->subsolver MpL->solver->tolerance: 1.e-3
ch->solver->right precon->subsolver MpL->solver->max iteration: 20
ch->solver->right precon->subsolver MpL->solver->left precon: diag
% =================== OUTPUT =========================================
ch->output->ParaView animation: 1
ch->output->ParaView format: 1
ch->output->write every i-th timestep: 10
ch->output->append index: 1
ch->output->index length: 9
ch->output->index decimals: 7
dimension of world: 3
% =================== MESH ================================
mesh_name: mesh
mesh->macro file name: ./macro/fliese_20x20x2.3d
mesh->global refinements: 3
mesh->check: 0
lattice: 4*M_PI/sqrt(3)
mesh->scale mesh: 1
N: 10
x: ${N}*${lattice}
y: ${x}
z: ${x} / 10.0
mesh->dimension: [${x}, ${y}, ${z}]
#include "init/reinit.inc.2d"
% ============== USER-PARAMETER ==========================
ch->use reinit: 0
ch->epsilon: 0.5
ch->gamma: 1
ch->double-well type: 1
% =========== OUTPUT ==============================================
ch->output->filename: ./output/ch3d_shell_
% ==================== TIMESTEPS ===============================
adapt->timestep: 0.1
adapt->max timestep: 1e+10
adapt->min timestep: 1e-10
adapt->start time: 0.0
adapt->end time: 10000.0
% ============= PROBLEM-SPACES ==================================
ch->components: 2
ch->polynomial degree[0]: 2
ch->polynomial degree[1]: 2
ch->dim: 3
ch->mesh: mesh
% ================== SOLVER ======================================
ch->solver: fgmres
ch->solver->backend: cahn_hilliard
%ch->solver->petsc prefix: ch
ch->solver->right precon: ch
ch->solver->orthogonalization: 1
ch->solver->restart: 30
ch->solver->max iteration: 2000
ch->solver->tolerance: 1.e-8
ch->solver->info: 10
ch->solver->right precon->subsolver M->solver: cg
ch->solver->right precon->subsolver M->solver->backend: mtl
ch->solver->right precon->subsolver M->solver->tolerance: 1.e-3
ch->solver->right precon->subsolver M->solver->max iteration: 5
ch->solver->right precon->subsolver M->solver->left precon: diag
ch->solver->right precon->subsolver MpL->solver: cg
ch->solver->right precon->subsolver MpL->solver->backend: mtl
ch->solver->right precon->subsolver MpL->solver->tolerance: 1.e-3
ch->solver->right precon->subsolver MpL->solver->max iteration: 20
ch->solver->right precon->subsolver MpL->solver->left precon: diag
% =================== OUTPUT =========================================
ch->output->ParaView animation: 1
ch->output->ParaView format: 1
ch->output->write every i-th timestep: 10
ch->output->append index: 1
ch->output->index length: 9
ch->output->index decimals: 7
reinit->tolerance: 1.e-2
reinit->maximal number of iteration steps: 100
reinit->Gauss-Seidel iteration: 1
reinit->infinity value: 1.e8
reinit->boundary initialization: 3
\ No newline at end of file
DIM: 2
DIM_OF_WORLD: 2
number of elements: 8
number of vertices: 9
vertex coordinates:
-1 -1
0 -1
1 -1
-1 0
0 0
1 0
-1 1
0 1
1 1
element vertices:
0 4 3
4 0 1
1 5 4
5 1 2
3 7 6
7 3 4
4 8 7
8 4 5
element boundaries:
0 1 0
3 0 0
0 0 0