Skip to content
Snippets Groups Projects
Commit 1859605c authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

* Removed output from UmfPackSolver

parent 986197b6
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,8 @@ namespace AMDiS {
if (admin_local->getNumberOfDOFs(j) != (*ndof)[j])
break;
}
if (j > mesh->getDim()) break;
if (j > mesh->getDim())
break;
admin_local = NULL;
}
if (!admin_local) {
......@@ -44,6 +45,25 @@ namespace AMDiS {
feSpaces.push_back(this);
}
FiniteElemSpace::FiniteElemSpace()
{
}
FiniteElemSpace& FiniteElemSpace::operator=(const FiniteElemSpace& feSpace)
{
if (&feSpace == this)
return *this;
if (feSpace.admin == &(feSpace.mesh->getDOFAdmin(0))) {
std::cout << "JA, SIND GLEICH\n";
} else {
std::cout << "NO, NICHT WIRKLICH\n";
}
ERROR_EXIT("\n");
return *this;
}
FiniteElemSpace *FiniteElemSpace::provideFESpace(DOFAdmin *admin,
const BasisFunction *basFcts,
......@@ -64,7 +84,7 @@ namespace AMDiS {
}
}
if(admin) {
if (admin) {
ERROR_EXIT("no fespace found for this admin\n");
return NULL;
} else {
......
......@@ -58,6 +58,11 @@ namespace AMDiS {
MEMORY_MANAGED(FiniteElemSpace);
/** \brief
* Create an empty fe space.
*/
FiniteElemSpace();
/** \brief
*
*/
......@@ -70,6 +75,8 @@ namespace AMDiS {
* destructor
*/
virtual ~FiniteElemSpace() {}
FiniteElemSpace& operator=(const FiniteElemSpace& feSpace);
/** \brief
* Returns \ref name
......
......@@ -272,158 +272,23 @@ namespace AMDiS {
}
// ===== adding dofs to already existing elements ============================
if (initialized) {
static bool pnd_1d_0[2] = {true, true};
static bool pnd_1d_1[1] = {false};
static bool pnd_2d_0[3] = {true, true, true};
static bool pnd_2d_1[3] = {true, true, false};
static bool pnd_2d_2[1] = {false};
static bool pnd_3d_0[4] = {true, true, true, true};
static bool pnd_3d_1[6] = {false, true, true, true, true, true};
static bool pnd_3d_2[4] = {true, true, false, false};
static bool pnd_3d_3[1] = {false};
static bool *pnd_1d[2] = {pnd_1d_0, pnd_1d_1};
static bool *pnd_2d[3] = {pnd_2d_0, pnd_2d_1, pnd_2d_2};
static bool *pnd_3d[4] = {pnd_3d_0, pnd_3d_1, pnd_3d_2, pnd_3d_3};
static bool **parentNeedsDOF[4] = {NULL, pnd_1d, pnd_2d, pnd_3d};
std::list<struct delmem> delList;
std::map< std::set<DegreeOfFreedom>, DegreeOfFreedom*> dofPtrMap;
const DOFAdmin *vertexAdmin = getVertexAdmin();
int vertexAdminPreDOFs = vertexAdmin->getNumberOfPreDOFs(VERTEX);
// finding necessary node number for new admin
int newNNode = 0;
GeoIndex geoIndex;
for (int d = 0; d < dim+1; d++) {
geoIndex = INDEX_OF_DIM(d, dim);
if (localAdmin->getNumberOfDOFs(geoIndex)>0||nDOF[geoIndex]>0)
newNNode += getGeo(geoIndex);
}
bool extendNodes = (newNNode>nNodeEl);
int oldNNodes = nNodeEl;
nNodeEl = newNNode;
TraverseStack stack;
ElInfo *elInfo = NULL;
WARNING("You are using untested code (adding dofs to existing mesh). Please contact\nsoftware administrator if any errors occur in this context.\n");
elInfo = stack.traverseFirst(this, -1, CALL_EVERY_EL_PREORDER);
while(elInfo) {
Element *element = elInfo->getElement();
DegreeOfFreedom *newDOF, **oldDOF, **dof =
const_cast<DegreeOfFreedom**>(element->getDOF());
int index = 0;
if (extendNodes) {
oldDOF=dof;
element->setDOFPtrs();
dof=const_cast<DegreeOfFreedom**>(element->getDOF());
int index=0,oldIndex=0;
for (int d = 0; d < dim + 1; d++) {
geoIndex = INDEX_OF_DIM(d, dim);
if (nDOF[geoIndex]>0) {
for (int i = 0;i < getGeo(geoIndex); ++i)
dof[index++] = oldDOF[oldIndex++];
}
else {
if (localAdmin->getNumberOfDOFs(geoIndex) > 0)
index += getGeo(geoIndex);
}
}
FREE_MEMORY(oldDOF, DegreeOfFreedom*, oldNNodes);
TEST_EXIT_DBG(index == nNodeEl)("ERROR: Number of entered nodes %f != number of nodes %f\n",index,nNodeEl);
}
// If adding DOFAdmins to already initilized meshes is required, see older
// AMDiS version (revision < 244) at the same code position.
TEST_EXIT(!initialized)("Adding DOFAdmins to initilized meshes does not work!\n");
index = 0;
// allocate new memory at elements
for (int d = 0; d < dim+1; d++) {
geoIndex = INDEX_OF_DIM(d, dim);
int numberOfDOFs = localAdmin->getNumberOfDOFs(geoIndex);
int numberOfPreDOFs = nDOF[geoIndex];
if (numberOfDOFs>0||numberOfPreDOFs>0) {
// for all vertices/edges/...
for (int i = 0; i < getGeo(geoIndex); i++, index++) {
std::set<DegreeOfFreedom> dofSet;
for (int j = 0; j < d+1; j++) {
dofSet.insert(dof[element->getVertexOfPosition(geoIndex, i, j)][vertexAdminPreDOFs]);
}
if (element->isLeaf() || parentNeedsDOF[dim][d][i]) {
if (dofPtrMap[dofSet] == NULL) {
if (localAdmin->getNumberOfDOFs(geoIndex)) {
newDOF = GET_MEMORY(DegreeOfFreedom, numberOfPreDOFs + numberOfDOFs);
// copy old dofs to new memory and free old memory
if (dof[index]) {
for (int j = 0; j < numberOfPreDOFs; j++) {
newDOF[j] = dof[index][j];
}
// FREE_MEMORY(dof[index], DegreeOfFreedom, numberOfPreDOFs);
// Do not free memory. The information has to be used to identify the part in other elements.
// The memory is only marked for freeing.
struct delmem fm;
fm.ptr = dof[index];
fm.len = numberOfPreDOFs;
delList.push_back(fm);
}
for (int j = 0; j < numberOfDOFs; j++) {
newDOF[numberOfPreDOFs + j] = localAdmin->getDOFIndex();
}
dof[index] = newDOF;
}
dofPtrMap[dofSet] = dof[index];
} else {
dof[index] = dofPtrMap[dofSet];
}
}
}
}
}
elInfo = stack.traverseNext(elInfo);
}
// now free the old dof memory:
std::list<struct delmem>::iterator it = delList.begin();
while (it!=delList.end()) {
FREE_MEMORY((*it).ptr, DegreeOfFreedom, (*it).len);
it++;
}
delList.clear();
}
// ============================================================================
admin.push_back(localAdmin);
nDOFEl = 0;
localAdmin->setNumberOfPreDOFs(VERTEX,nDOF[VERTEX]);
nDOF[VERTEX] += localAdmin->getNumberOfDOFs(VERTEX);
nDOF[VERTEX] += localAdmin->getNumberOfDOFs(VERTEX);
nDOFEl += getGeo(VERTEX) * nDOF[VERTEX];
if(dim > 1) {
if (dim > 1) {
localAdmin->setNumberOfPreDOFs(EDGE,nDOF[EDGE]);
nDOF[EDGE] += localAdmin->getNumberOfDOFs(EDGE);
nDOF[EDGE] += localAdmin->getNumberOfDOFs(EDGE);
nDOFEl += getGeo(EDGE) * nDOF[EDGE];
}
......@@ -438,10 +303,11 @@ namespace AMDiS {
if (dim > 1) {
node[EDGE] = nNodeEl;
if (nDOF[EDGE] > 0) nNodeEl += getGeo(EDGE);
if (nDOF[EDGE] > 0)
nNodeEl += getGeo(EDGE);
}
if (3 == dim){
if (dim == 3) {
localAdmin->setNumberOfPreDOFs(FACE,nDOF[FACE]);
nDOF[FACE] += localAdmin->getNumberOfDOFs(FACE);
nDOFEl += getGeo(FACE) * nDOF[FACE];
......@@ -451,8 +317,9 @@ namespace AMDiS {
}
node[CENTER] = nNodeEl;
if (nDOF[CENTER] > 0)
if (nDOF[CENTER] > 0) {
nNodeEl += 1;
}
}
......
......@@ -50,8 +50,8 @@ namespace AMDiS {
*
*/
void push(T *solution,
double timestamp,
typename SolutionHelper<T>::type feSpace);
typename SolutionHelper<T>::type feSpace,
double timestamp);
/** \brief
*
......
......@@ -58,8 +58,8 @@ namespace AMDiS {
template<typename T>
void SolutionDataStorage<T>::push(T *solution,
double timestamp,
typename SolutionHelper<T>::type feSpace)
typename SolutionHelper<T>::type feSpace,
double timestamp)
{
FUNCNAME("SolutionDataStorage<T>::push()");
......
......@@ -204,6 +204,10 @@ namespace AMDiS {
return feSpace[i];
}
inline std::vector<FiniteElemSpace*> getFESpaces() const {
return feSpace;
}
/** \brief
* Here the system vector is interpreted as one large vector. The given
* is used as a global index which indicates a local vector number and
......
......@@ -159,7 +159,6 @@ namespace AMDiS {
umfpack_di_free_symbolic(&symbolic_);
}
if (multipleRhs == 0) {
std::cout << "FREE THE STUFF" << std::endl;
umfpack_di_free_numeric(&numeric);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment