Commit c2ebc435 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Solved bug, when coupled problems have different basis functions degree.

parent b4ddbecb
...@@ -44,7 +44,7 @@ available_tags=" CXX F77" ...@@ -44,7 +44,7 @@ available_tags=" CXX F77"
# ### BEGIN LIBTOOL CONFIG # ### BEGIN LIBTOOL CONFIG
# Libtool was configured on host NWRW03: # Libtool was configured on host NWRW15:
# Shell to use when invoking shell scripts. # Shell to use when invoking shell scripts.
SHELL="/bin/sh" SHELL="/bin/sh"
...@@ -328,7 +328,7 @@ link_all_deplibs=unknown ...@@ -328,7 +328,7 @@ link_all_deplibs=unknown
sys_lib_search_path_spec=" /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../ /lib/i386-redhat-linux/4.1.2/ /lib/ /usr/lib/i386-redhat-linux/4.1.2/ /usr/lib/" sys_lib_search_path_spec=" /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../ /lib/i386-redhat-linux/4.1.2/ /lib/ /usr/lib/i386-redhat-linux/4.1.2/ /usr/lib/"
# Run-time system search path for libraries # Run-time system search path for libraries
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/octave-3.0.1 /usr/lib/qt-3.3/lib " sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/octave-2.9.9 /usr/lib/qt-3.3/lib "
# Fix the shell variable $srcfile for the compiler. # Fix the shell variable $srcfile for the compiler.
fix_srcfile_path="" fix_srcfile_path=""
...@@ -6760,7 +6760,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` ...@@ -6760,7 +6760,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
# End: # End:
# ### BEGIN LIBTOOL TAG CONFIG: CXX # ### BEGIN LIBTOOL TAG CONFIG: CXX
# Libtool was configured on host NWRW03: # Libtool was configured on host NWRW15:
# Shell to use when invoking shell scripts. # Shell to use when invoking shell scripts.
SHELL="/bin/sh" SHELL="/bin/sh"
...@@ -7041,7 +7041,7 @@ link_all_deplibs=unknown ...@@ -7041,7 +7041,7 @@ link_all_deplibs=unknown
sys_lib_search_path_spec=" /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../ /lib/i386-redhat-linux/4.1.2/ /lib/ /usr/lib/i386-redhat-linux/4.1.2/ /usr/lib/" sys_lib_search_path_spec=" /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../ /lib/i386-redhat-linux/4.1.2/ /lib/ /usr/lib/i386-redhat-linux/4.1.2/ /usr/lib/"
# Run-time system search path for libraries # Run-time system search path for libraries
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/octave-3.0.1 /usr/lib/qt-3.3/lib " sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/octave-2.9.9 /usr/lib/qt-3.3/lib "
# Fix the shell variable $srcfile for the compiler. # Fix the shell variable $srcfile for the compiler.
fix_srcfile_path="" fix_srcfile_path=""
...@@ -7065,7 +7065,7 @@ include_expsyms="" ...@@ -7065,7 +7065,7 @@ include_expsyms=""
# ### BEGIN LIBTOOL TAG CONFIG: F77 # ### BEGIN LIBTOOL TAG CONFIG: F77
# Libtool was configured on host NWRW03: # Libtool was configured on host NWRW15:
# Shell to use when invoking shell scripts. # Shell to use when invoking shell scripts.
SHELL="/bin/sh" SHELL="/bin/sh"
...@@ -7109,7 +7109,7 @@ LTCC="gcc" ...@@ -7109,7 +7109,7 @@ LTCC="gcc"
LTCFLAGS="-g -O2" LTCFLAGS="-g -O2"
# A language-specific compiler. # A language-specific compiler.
CC="f95" CC="g77"
# Is the compiler the GNU C compiler? # Is the compiler the GNU C compiler?
with_gcc=yes with_gcc=yes
...@@ -7346,10 +7346,10 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM ...@@ -7346,10 +7346,10 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM
link_all_deplibs=unknown link_all_deplibs=unknown
# Compile-time system search path for libraries # Compile-time system search path for libraries
sys_lib_search_path_spec=" /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../ /lib/i386-redhat-linux/4.1.2/ /lib/ /usr/lib/i386-redhat-linux/4.1.2/ /usr/lib/" sys_lib_search_path_spec=" /usr/lib/gcc/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../i386-redhat-linux/lib/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../ /lib/i386-redhat-linux/3.4.6/ /lib/ /usr/lib/i386-redhat-linux/3.4.6/ /usr/lib/"
# Run-time system search path for libraries # Run-time system search path for libraries
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/octave-3.0.1 /usr/lib/qt-3.3/lib " sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/octave-2.9.9 /usr/lib/qt-3.3/lib "
# Fix the shell variable $srcfile for the compiler. # Fix the shell variable $srcfile for the compiler.
fix_srcfile_path="" fix_srcfile_path=""
......
...@@ -328,7 +328,6 @@ namespace AMDiS { ...@@ -328,7 +328,6 @@ namespace AMDiS {
/** \} */ /** \} */
// ===== pure virtual methods =================================================
/** \name pure virtual methods /** \name pure virtual methods
* \{ * \{
...@@ -339,12 +338,9 @@ namespace AMDiS { ...@@ -339,12 +338,9 @@ namespace AMDiS {
* Used by Estimator for the jumps => same quadrature nodes from both sides! * Used by Estimator for the jumps => same quadrature nodes from both sides!
*/ */
virtual const FixVec<int,WORLD>& virtual const FixVec<int,WORLD>&
sortFaceIndices(int face, FixVec<int,WORLD> *vec) const = 0; sortFaceIndices(int face, FixVec<int, WORLD> *vec) const = 0;
/** \brief /// Returns a copy of itself. Needed by Mesh to create Elements by a prototype.
* Returns a copy of itself. Needed by Mesh to create Elements by a
* prototype.
*/
virtual Element *clone() = 0; virtual Element *clone() = 0;
/** \brief /** \brief
......
...@@ -10,12 +10,12 @@ namespace AMDiS { ...@@ -10,12 +10,12 @@ namespace AMDiS {
std::vector<FiniteElemSpace*> FiniteElemSpace::feSpaces; std::vector<FiniteElemSpace*> FiniteElemSpace::feSpaces;
FiniteElemSpace::FiniteElemSpace(DOFAdmin* admin_, FiniteElemSpace::FiniteElemSpace(DOFAdmin* admin_,
const BasisFunction* bas_fcts_, const BasisFunction* bas_fcts,
Mesh* aMesh, Mesh* aMesh,
const std::string& aString) const std::string& aString)
: name(aString), : name(aString),
admin(admin_), admin(admin_),
basFcts(bas_fcts_), basFcts(bas_fcts),
mesh(aMesh) mesh(aMesh)
{ {
FUNCNAME("FiniteElemSpace::FiniteElemSpace()"); FUNCNAME("FiniteElemSpace::FiniteElemSpace()");
...@@ -30,17 +30,16 @@ namespace AMDiS { ...@@ -30,17 +30,16 @@ namespace AMDiS {
for (int i = 0; i < mesh->getNumberOfDOFAdmin(); i++) { for (int i = 0; i < mesh->getNumberOfDOFAdmin(); i++) {
admin_local = &(mesh->getDOFAdmin(i)); admin_local = &(mesh->getDOFAdmin(i));
int j = 0; int j = 0;
for (; j <= mesh->getDim(); j++) { for (; j <= mesh->getDim(); j++)
if (admin_local->getNumberOfDOFs(j) != (*ndof)[j]) if (admin_local->getNumberOfDOFs(j) != (*ndof)[j])
break; break;
}
if (j > mesh->getDim()) if (j > mesh->getDim())
break; break;
admin_local = NULL; admin_local = NULL;
} }
if (!admin_local) { if (!admin_local)
admin_local = mesh->createDOFAdmin(name, *ndof); admin_local = mesh->createDOFAdmin(name, *ndof);
}
admin = const_cast<DOFAdmin*>(admin_local); admin = const_cast<DOFAdmin*>(admin_local);
} }
...@@ -76,24 +75,13 @@ namespace AMDiS { ...@@ -76,24 +75,13 @@ namespace AMDiS {
{ {
int numSpaces = static_cast<int>(feSpaces.size()); int numSpaces = static_cast<int>(feSpaces.size());
for (int i = 0; i < numSpaces; i++) { for (int i = 0; i < numSpaces; i++)
if (admin) { if (feSpaces[i]->basFcts == basFcts &&
if (feSpaces[i]->admin == admin) { feSpaces[i]->mesh == mesh &&
return feSpaces[i]; (!admin || (admin && feSpaces[i]->admin == admin)))
} return feSpaces[i];
} else {
if (feSpaces[i]->basFcts == basFcts && feSpaces[i]->mesh == mesh) {
return feSpaces[i];
}
}
}
if (admin) { return new FiniteElemSpace(admin, basFcts, mesh, name_);
ERROR_EXIT("no fespace found for this admin\n");
return NULL;
} else {
return new FiniteElemSpace(NULL, basFcts, mesh, name_);
}
} }
int FiniteElemSpace::calcMemoryUsage() int FiniteElemSpace::calcMemoryUsage()
......
...@@ -1046,11 +1046,14 @@ namespace AMDiS { ...@@ -1046,11 +1046,14 @@ namespace AMDiS {
int n0 = drv->getFESpace()->getAdmin()->getNumberOfPreDOFs(CENTER); int n0 = drv->getFESpace()->getAdmin()->getNumberOfPreDOFs(CENTER);
Element *el = list->getElement(0); Element *el = list->getElement(0);
int node = drv->getFESpace()->getMesh()->getNode(CENTER); int node = drv->getFESpace()->getMesh()->getNode(CENTER);
DegreeOfFreedom dof0 = el->getDOF(node, n0); /* Parent center */ // Parent center
DegreeOfFreedom dof_new = el->getChild(0)->getDOF(node, n0); /* newest vertex is center */ DegreeOfFreedom dof0 = el->getDOF(node, n0);
// Newest vertex is center
DegreeOfFreedom dof_new = el->getChild(0)->getDOF(node, n0);
(*drv)[dof_new] = (*drv)[dof0]; (*drv)[dof_new] = (*drv)[dof0];
dof_new = el->getChild(1)->getDOF(node, n0); /* newest vertex is center */ // Newest vertex is center
dof_new = el->getChild(1)->getDOF(node, n0);
(*drv)[dof_new] = (*drv)[dof0]; (*drv)[dof_new] = (*drv)[dof0];
} }
......
...@@ -158,9 +158,8 @@ namespace AMDiS { ...@@ -158,9 +158,8 @@ namespace AMDiS {
associated = new VertexVector(mesh->getVertexAdmin(), "vertex vector"); associated = new VertexVector(mesh->getVertexAdmin(), "vertex vector");
mesh->periodicAssociations[boundaryType] = associated; mesh->periodicAssociations[boundaryType] = associated;
VertexVector::Iterator it(associated, ALL_DOFS); VertexVector::Iterator it(associated, ALL_DOFS);
for (it.reset2(); !it.end(); ++it) { for (it.reset2(); !it.end(); ++it)
*it = it.getDOFIndex(); *it = it.getDOFIndex();
}
} }
for (int j = 0; j < dim; j++) { for (int j = 0; j < dim; j++) {
...@@ -213,11 +212,10 @@ namespace AMDiS { ...@@ -213,11 +212,10 @@ namespace AMDiS {
} }
} }
for (int i = 0; i < mesh->getNumberOfVertices(); i++) { for (int i = 0; i < mesh->getNumberOfVertices(); i++)
if (periodicMap.getEntry(i) != -1) { if (periodicMap.getEntry(i) != -1)
MSG("identification : vertex %d is now vertex %d\n", i, periodicMap.getEntry(i)); MSG("identification : vertex %d is now vertex %d\n",
} i, periodicMap.getEntry(i));
}
} }
// ========================================================= // =========================================================
...@@ -268,7 +266,6 @@ namespace AMDiS { ...@@ -268,7 +266,6 @@ namespace AMDiS {
boundaryDOFs(mesh); boundaryDOFs(mesh);
// initial boundary projections // initial boundary projections
//if(dim > 1) {
int numFaces = mesh->getGeo(FACE); int numFaces = mesh->getGeo(FACE);
int dim = mesh->getDim(); int dim = mesh->getDim();
mel = mesh->firstMacroElement(); mel = mesh->firstMacroElement();
...@@ -291,7 +288,6 @@ namespace AMDiS { ...@@ -291,7 +288,6 @@ namespace AMDiS {
} }
} }
} }
//}
macroInfo->fillBoundaryInfo(mesh); macroInfo->fillBoundaryInfo(mesh);
...@@ -1409,46 +1405,35 @@ namespace AMDiS { ...@@ -1409,46 +1405,35 @@ namespace AMDiS {
&(nei->projection[mesh->getGeo(FACE)+edge_no]); &(nei->projection[mesh->getGeo(FACE)+edge_no]);
if (mesh->getNumberOfDOFs(EDGE)) if (mesh->getNumberOfDOFs(EDGE))
{ nei->element->setDOF(node+edge_no,edge_dof);
// if(periodic) {
// nei->element->setDOF(node+edge_no, mesh->getDOF(EDGE));
// } else {
nei->element->setDOF(node+edge_no,edge_dof);
// }
}
if (next_el[edge_no][0] != opp_v) if (next_el[edge_no][0] != opp_v) {
{ if(nei->getBoundary(next_el[edge_no][0])) {
if(nei->getBoundary(next_el[edge_no][0])) { lbound = newBound(nei->getBoundary(next_el[edge_no][0]), lbound);
lbound = newBound(nei->getBoundary(next_el[edge_no][0]), lbound); Projection *neiProject = nei->getProjection(next_el[edge_no][0]);
Projection *neiProject = nei->getProjection(next_el[edge_no][0]); if (!lproject) {
if(!lproject) lproject = neiProject;
} else {
if (neiProject && (lproject->getID() < neiProject->getID()))
lproject = neiProject; lproject = neiProject;
else {
if(neiProject && (lproject->getID() < neiProject->getID())) {
lproject = neiProject;
}
}
} }
opp_v = nei->getOppVertex(next_el[edge_no][0]);
nei = nei->getNeighbour(next_el[edge_no][0]);
} }
else opp_v = nei->getOppVertex(next_el[edge_no][0]);
{ nei = nei->getNeighbour(next_el[edge_no][0]);
if(nei->getBoundary(next_el[edge_no][1])) { } else {
lbound = newBound(nei->getBoundary(next_el[edge_no][1]), lbound); if (nei->getBoundary(next_el[edge_no][1])) {
Projection *neiProject = nei->getProjection(next_el[edge_no][1]); lbound = newBound(nei->getBoundary(next_el[edge_no][1]), lbound);
if(!lproject) Projection *neiProject = nei->getProjection(next_el[edge_no][1]);
if (!lproject) {
lproject = neiProject;
} else {
if (neiProject && (lproject->getID() < neiProject->getID()))
lproject = neiProject; lproject = neiProject;
else {
if(neiProject && (lproject->getID() < neiProject->getID())) {
lproject = neiProject;
}
}
} }
opp_v = nei->getOppVertex(next_el[edge_no][1]);
nei = nei->getNeighbour(next_el[edge_no][1]);
} }
opp_v = nei->getOppVertex(next_el[edge_no][1]);
nei = nei->getNeighbour(next_el[edge_no][1]);
}
} }
if (!nei) if (!nei)
{ {
...@@ -1861,10 +1846,10 @@ namespace AMDiS { ...@@ -1861,10 +1846,10 @@ namespace AMDiS {
{ {
FUNCNAME("MacroReader::checkMesh()"); FUNCNAME("MacroReader::checkMesh()");
int i, nused, nfree; int i, nused, nfree;
DOFAdmin *localAdmin=mesh->admin[0]; DOFAdmin *localAdmin=mesh->admin[0];
Flag fill_flag; Flag fill_flag;
int error_detected = 0; int error_detected = 0;
MSG("checking mesh\n"); MSG("checking mesh\n");
......
...@@ -387,14 +387,15 @@ namespace AMDiS { ...@@ -387,14 +387,15 @@ namespace AMDiS {
localAdmin->setMesh(this); localAdmin->setMesh(this);
std::vector<DOFAdmin*>::iterator dai = std::find(admin.begin(),admin.end(),localAdmin); std::vector<DOFAdmin*>::iterator dai =
std::find(admin.begin(),admin.end(),localAdmin);
TEST_EXIT(dai == admin.end()) TEST_EXIT(dai == admin.end())
("admin %s is already associated to mesh %s\n", ("admin %s is already associated to mesh %s\n",
localAdmin->getName().c_str(), this->getName().c_str()); localAdmin->getName().c_str(), this->getName().c_str());
// if this will be required, see the untested code in revision < 224 // if this will be required, see the untested code in revision < 224
TEST_EXIT(!initialized)("Adding DOFAdmins to initilized meshes does not work yet!\n"); // TEST_EXIT(!initialized)("Adding DOFAdmins to initilized meshes does not work yet!\n");
admin.push_back(localAdmin); admin.push_back(localAdmin);
...@@ -435,9 +436,8 @@ namespace AMDiS { ...@@ -435,9 +436,8 @@ namespace AMDiS {
} }
node[CENTER] = nNodeEl; node[CENTER] = nNodeEl;
if (nDOF[CENTER] > 0) { if (nDOF[CENTER] > 0)
nNodeEl += 1; nNodeEl += 1;
}
} }
void Mesh::dofCompress() void Mesh::dofCompress()
...@@ -1082,25 +1082,25 @@ namespace AMDiS { ...@@ -1082,25 +1082,25 @@ namespace AMDiS {
// If there is no value file which should be written, we can delete // If there is no value file which should be written, we can delete
// the information of the macro file. // the information of the macro file.
if (!valueFilename.length()) { if (!valueFilename.length())
clearMacroFileInfo(); clearMacroFileInfo();
}
} }
initialized = true; initialized = true;
} }
bool Mesh::associated(DegreeOfFreedom dof1, DegreeOfFreedom dof2) { bool Mesh::associated(DegreeOfFreedom dof1, DegreeOfFreedom dof2)
{
std::map<BoundaryType, VertexVector*>::iterator it; std::map<BoundaryType, VertexVector*>::iterator it;
std::map<BoundaryType, VertexVector*>::iterator end = periodicAssociations.end(); std::map<BoundaryType, VertexVector*>::iterator end = periodicAssociations.end();
for (it = periodicAssociations.begin(); it != end; ++it) { for (it = periodicAssociations.begin(); it != end; ++it)
if ((*(it->second))[dof1] == dof2) if ((*(it->second))[dof1] == dof2)
return true; return true;
}
return false; return false;
} }
bool Mesh::indirectlyAssociated(DegreeOfFreedom dof1, DegreeOfFreedom dof2) { bool Mesh::indirectlyAssociated(DegreeOfFreedom dof1, DegreeOfFreedom dof2)
{
std::vector<DegreeOfFreedom> associatedToDOF1; std::vector<DegreeOfFreedom> associatedToDOF1;
std::map<BoundaryType, VertexVector*>::iterator it; std::map<BoundaryType, VertexVector*>::iterator it;
std::map<BoundaryType, VertexVector*>::iterator end = periodicAssociations.end(); std::map<BoundaryType, VertexVector*>::iterator end = periodicAssociations.end();
......
...@@ -72,17 +72,9 @@ namespace AMDiS { ...@@ -72,17 +72,9 @@ namespace AMDiS {
WARNING("feSpaces already created\n"); WARNING("feSpaces already created\n");
} else { } else {
if (initFlag.isSet(INIT_FE_SPACE) || if (initFlag.isSet(INIT_FE_SPACE) ||
(initFlag.isSet(INIT_SYSTEM) && !adoptFlag.isSet(INIT_FE_SPACE))) { (initFlag.isSet(INIT_SYSTEM) && !adoptFlag.isSet(INIT_FE_SPACE)))
createFESpace(NULL);
if (!adoptFlag.isSet(INIT_MESH)) {
createFESpace(NULL);
} else {
TEST_EXIT(meshes.size() == 1)("I have to think about it!\n");
TEST_EXIT(meshes[0]->getNumberOfDOFAdmin() == 1)("I have to think about it!\n");
createFESpace(&(const_cast<DOFAdmin&>(meshes[0]->getDOFAdmin(0))));
}
}
if (adoptProblem && if (adoptProblem &&
(adoptFlag.isSet(INIT_FE_SPACE) || adoptFlag.isSet(INIT_SYSTEM))) { (adoptFlag.isSet(INIT_FE_SPACE) || adoptFlag.isSet(INIT_SYSTEM))) {
feSpaces = adoptProblem->getFESpaces(); feSpaces = adoptProblem->getFESpaces();
...@@ -106,9 +98,9 @@ namespace AMDiS { ...@@ -106,9 +98,9 @@ namespace AMDiS {
WARNING("no feSpace created\n"); WARNING("no feSpace created\n");
// === create system === // === create system ===
if (initFlag.isSet(INIT_SYSTEM)) { if (initFlag.isSet(INIT_SYSTEM))
createMatricesAndVectors(); createMatricesAndVectors();
}
if (adoptProblem && adoptFlag.isSet(INIT_SYSTEM)) { if (adoptProblem && adoptFlag.isSet(INIT_SYSTEM)) {
solution = adoptProblem->getSolution(); solution = adoptProblem->getSolution();
rhs = adoptProblem->getRHS(); rhs = adoptProblem->getRHS();
...@@ -189,9 +181,13 @@ namespace AMDiS { ...@@ -189,9 +181,13 @@ namespace AMDiS {
&globalRefinements); &globalRefinements);
// Initialize the meshes if there is no serialization file. // Initialize the meshes if there is no serialization file.
for (int i = 0; i < static_cast<int>(meshes.size()); i++) for (int i = 0; i < static_cast<int>(meshes.size()); i++) {
if (initFlag.isSet(INIT_MESH) && meshes[i] && !(meshes[i]->isInitialized())) bool initMesh = initFlag.isSet(INIT_MESH) ||
(adoptProblem && adoptFlag.isSet(INIT_MESH));
if (initMesh && meshes[i] && !(meshes[i]->isInitialized()))
meshes[i]->initialize(); meshes[i]->initialize();
}
// === read value file and use it for the mesh values === // === read value file and use it for the mesh values ===
std::string valueFilename(""); std::string valueFilename("");
...@@ -233,9 +229,9 @@ namespace AMDiS { ...@@ -233,9 +229,9 @@ namespace AMDiS {
sprintf(number, "%d", i); sprintf(number, "%d", i);
int refSet = -1; int refSet = -1;
GET_PARAMETER(0, name + "->refinement set[" + number + "]", "%d", &refSet); GET_PARAMETER(0, name + "->refinement set[" + number + "]", "%d", &refSet);
if (refSet < 0) { if (refSet < 0)
refSet = 0; refSet = 0;
}
if (meshForRefinementSet[refSet] == NULL) { if (meshForRefinementSet[refSet] == NULL) {
Mesh *newMesh = new Mesh(meshName, dim); Mesh *newMesh = new Mesh(meshName, dim);
meshForRefinementSet[refSet] = newMesh; meshForRefinementSet[refSet] = newMesh;
...@@ -296,9 +292,9 @@ namespace AMDiS { ...@@ -296,9 +292,9 @@ namespace AMDiS {
} }
for (int i = 0; i < nComponents; i++) { for (int i = 0; i < nComponents; i++) {
for (int j = 0; j < nComponents; j++) { for (int j = 0; j < nComponents; j++)
traverseInfo.getMatrix(i, j).setFESpace(componentSpaces[i], componentSpaces[j]); traverseInfo.getMatrix(i, j).setFESpace(componentSpaces[i], componentSpaces[j]);
}
traverseInfo.getVector(i).setFESpace(componentSpaces[i]); traverseInfo.getVector(i).setFESpace(componentSpaces[i]);
} }
......
...@@ -12,9 +12,11 @@ namespace AMDiS { ...@@ -12,9 +12,11 @@ namespace AMDiS {
: Estimator(name, r), : Estimator(name, r),
C0(1.0), C0(1.0),
C1(1.0), C1(1.0),
C2(1.0), C2(0.0),
C3(1.0) C3(1.0)
{ {
FUNCNAME("ResidualEstimator::ResidualEstimator()");
GET_PARAMETER(0, name + "->C0", "%f", &C0); GET_PARAMETER(0, name + "->C0", "%f", &C0);
GET_PARAMETER(0, name + "->C1", "%f", &C1); GET_PARAMETER(0, name + "->C1", "%f", &C1);
GET_PARAMETER(0, name + "->C2", "%f", &C2); GET_PARAMETER(0, name + "->C2", "%f", &C2);
...@@ -24,6 +26,8 @@ namespace AMDiS { ...@@ -24,6 +26,8 @@ namespace AMDiS {