Commit 7bf56b3a authored by Naumann, Andreas's avatar Naumann, Andreas
Browse files

updated implicit problem and amdis gui to new interfaces

parent a84838be
This diff is collapsed.
...@@ -207,6 +207,11 @@ namespace AMDiS { ...@@ -207,6 +207,11 @@ namespace AMDiS {
return name; return name;
} }
inline void setName(std::string n)
{
name=n;
}
inline BoundaryManager* getBoundaryManager() const inline BoundaryManager* getBoundaryManager() const
{ {
return boundaryManager; return boundaryManager;
......
...@@ -529,6 +529,10 @@ namespace AMDiS { ...@@ -529,6 +529,10 @@ namespace AMDiS {
return result; return result;
} }
inline WorldVector<double> operator*(double d, const WorldVector<double>& v)
{
return v*d;
}
inline WorldVector<double> operator+(const WorldVector<double>& v1, inline WorldVector<double> operator+(const WorldVector<double>& v1,
const WorldVector<double>& v2) const WorldVector<double>& v2)
{ {
......
...@@ -115,12 +115,12 @@ namespace AMDiS { ...@@ -115,12 +115,12 @@ namespace AMDiS {
inStream.close(); inStream.close();
//create the fespace with the correct admin //create the fespace with the correct admin
createFESpace(); createFeSpace();
r = new DOFVector< double >(getFESpace(), "r"); r = new DOFVector< double >(getFeSpace(), "r");
phi1 = new DOFVector<double>(getFESpace(), "phi1"); phi1 = new DOFVector<double>(getFeSpace(), "phi1");
phi2 = new DOFVector<double>(getFESpace(), "phi2"); phi2 = new DOFVector<double>(getFeSpace(), "phi2");
levelSet = new DOFVector< double >(getFESpace(), "levelSet"); levelSet = new DOFVector< double >(getFeSpace(), "levelSet");
inStream.open(dofFilename.c_str()); inStream.open(dofFilename.c_str());
switch (serType) { switch (serType) {
case 0: case 0:
...@@ -188,11 +188,11 @@ namespace AMDiS { ...@@ -188,11 +188,11 @@ namespace AMDiS {
meshes[p]->deserialize(inStream); meshes[p]->deserialize(inStream);
inStream.close(); inStream.close();
//create the fespace with the correct admin //create the fespace with the correct admin
createFESpace(NULL); createFeSpace(NULL);
r[p] = new DOFVector< double >(getFESpace(p), "r"); r[p] = new DOFVector< double >(getFeSpace(p), "r");
phi1[p] = new DOFVector<double>(getFESpace(p), "phi1"); phi1[p] = new DOFVector<double>(getFeSpace(p), "phi1");
phi2[p] = new DOFVector<double>(getFESpace(p), "phi2"); phi2[p] = new DOFVector<double>(getFeSpace(p), "phi2");
levelSet[p] = new DOFVector< double >(getFESpace(p), "levelSet"); levelSet[p] = new DOFVector< double >(getFeSpace(p), "levelSet");
inStream.open(dofFilename.c_str()); inStream.open(dofFilename.c_str());
switch (serType) switch (serType)
{ {
......
...@@ -15,8 +15,9 @@ namespace AMDiS { ...@@ -15,8 +15,9 @@ namespace AMDiS {
grdInterpolFct(grdFct) grdInterpolFct(grdFct)
{ {
Flag adoptFlag = INIT_SYSTEM | INIT_MESH | INIT_FE_SPACE; Flag adoptFlag = INIT_SYSTEM | INIT_MESH | INIT_FE_SPACE;
Flag initFlag = INIT_ALL & ~adoptFlag & ~INIT_SOLVER & ~INIT_ESTIMATOR; Flag initFlag = INIT_ALL & ~adoptFlag & ~INIT_SOLVER & ~INIT_ESTIMATOR & ~CREATE_MESH & ~INIT_FILEWRITER;
if(initFlag.isSet(CREATE_MESH))
WARNING("CREATE_MESH is set\n");
initialize(initFlag, spaceProblem, adoptFlag); initialize(initFlag, spaceProblem, adoptFlag);
} }
......
...@@ -656,7 +656,6 @@ namespace AMDiS { ...@@ -656,7 +656,6 @@ namespace AMDiS {
traverseInfo.updateStatus(); traverseInfo.updateStatus();
// Used to calculate the overall number of non zero entries. // Used to calculate the overall number of non zero entries.
int nnz = 0; int nnz = 0;
...@@ -1119,10 +1118,16 @@ namespace AMDiS { ...@@ -1119,10 +1118,16 @@ namespace AMDiS {
it != op->getAuxFeSpaces().end(); ++it) { it != op->getAuxFeSpaces().end(); ++it) {
if ((*it)->getMesh() != componentSpaces[i]->getMesh() || if ((*it)->getMesh() != componentSpaces[i]->getMesh() ||
(*it)->getMesh() != componentSpaces[j]->getMesh()) { (*it)->getMesh() != componentSpaces[j]->getMesh()) {
// std::cout<<"auxFE "<<k<<" in position ("<<i<<","<<j<<") has different mesh\n"<<std::endl;
op->setNeedDualTraverse(true); op->setNeedDualTraverse(true);
break; break;
} }
} }
/* std::cout<<"after adding MatOp to ("<<i<<","<<j<<"):\n";
traverseInfo.updateStatus();
for(int i2=0;i2<nComponents;i2++)
for(int j2=0;j2<nComponents;j2++)
std::cout<<"traverseInfo.getStatus("<<i2<<","<<j2<<"):"<<traverseInfo.getStatus(i2,j2)<<std::endl;*/
} }
......
...@@ -229,9 +229,17 @@ namespace AMDiS { ...@@ -229,9 +229,17 @@ namespace AMDiS {
WorldVector<double> *values = &(gradientsAtQPs[vec]->values[0]); WorldVector<double> *values = &(gradientsAtQPs[vec]->values[0]);
gradientsAtQPs[vec]->valid = true; gradientsAtQPs[vec]->valid = true;
bool hasNan=false;
for(int i=0;i<localQuad->getNumPoints() && !hasNan;i++)
for(int j=0;j<Global::getGeo(WORLD) && !hasNan ;j++)
hasNan=isnan((values[i])[j]);
TEST_EXIT_DBG(!hasNan)("gradient contains a nan\n");
vec->getGrdAtQPs(smallElInfo, largeElInfo, localQuad, NULL, values); vec->getGrdAtQPs(smallElInfo, largeElInfo, localQuad, NULL, values);
hasNan=false;
for(int i=0;i<localQuad->getNumPoints() && !hasNan;i++)
for(int j=0;j<Global::getGeo(WORLD) && !hasNan ;j++)
hasNan=isnan((values[i])[j]);
TEST_EXIT_DBG(!hasNan)("gradient contains a nan\n");
return values; return values;
} }
......
...@@ -98,7 +98,11 @@ namespace AMDiS { ...@@ -98,7 +98,11 @@ namespace AMDiS {
std::vector<OperatorTerm*>::iterator termIt; std::vector<OperatorTerm*>::iterator termIt;
for (termIt = terms[myRank].begin(); termIt != terms[myRank].end(); ++termIt) for (termIt = terms[myRank].begin(); termIt != terms[myRank].end(); ++termIt)
(static_cast<ZeroOrderTerm*>((*termIt)))->getC(elInfo, nPoints, c); (static_cast<ZeroOrderTerm*>((*termIt)))->getC(elInfo, nPoints, c);
bool hasNan=false;
for(int i=0;i<nPoints && !hasNan ;i++)
hasNan=isnan(c[i]);
TEST_EXIT(!hasNan)("there is a nan in at least one position\n");
if (symmetric) { if (symmetric) {
TEST_EXIT_DBG(nCol == nRow)("nCol != nRow, but symmetric assembling!\n"); TEST_EXIT_DBG(nCol == nRow)("nCol != nRow, but symmetric assembling!\n");
...@@ -134,6 +138,11 @@ namespace AMDiS { ...@@ -134,6 +138,11 @@ namespace AMDiS {
} }
} }
} }
hasNan=false;
for(unsigned i=0;i<num_rows(mat) && !hasNan;i++)
for(unsigned j=0;j<num_cols(mat) && !hasNan; j++)
hasNan=isnan(mat[i][j]);
TEST_EXIT(!hasNan)("calculated an element matrix containing a nan\n");
} }
......
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