Commit 3a7156a4 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Adapted demos to new AMDiS (DELETE/delete and dirichlet boundary conditions).

parent 83b6de2b
...@@ -107,8 +107,6 @@ private: ...@@ -107,8 +107,6 @@ private:
class Identity : public AbstractFunction<double, double> class Identity : public AbstractFunction<double, double>
{ {
public: public:
MEMORY_MANAGED(Identity);
Identity(int degree) : AbstractFunction<double, double>(degree) {} Identity(int degree) : AbstractFunction<double, double>(degree) {}
double operator()(const double& x) const double operator()(const double& x) const
......
...@@ -142,7 +142,6 @@ int main(int argc, char* argv[]) ...@@ -142,7 +142,6 @@ int main(int argc, char* argv[])
double rotation = M_PI/3.0; double rotation = M_PI/3.0;
int i, j;
int dim = torus.getMesh()->getDim(); int dim = torus.getMesh()->getDim();
int dow = Global::getGeo(WORLD); int dow = Global::getGeo(WORLD);
...@@ -152,30 +151,28 @@ int main(int argc, char* argv[]) ...@@ -152,30 +151,28 @@ int main(int argc, char* argv[])
const FiniteElemSpace *feSpace = torus.getFESpace(); const FiniteElemSpace *feSpace = torus.getFESpace();
const BasisFunction *basFcts = feSpace->getBasisFcts(); const BasisFunction *basFcts = feSpace->getBasisFcts();
int numBasFcts = basFcts->getNumber(); int numBasFcts = basFcts->getNumber();
DegreeOfFreedom *localIndices = GET_MEMORY(DegreeOfFreedom, numBasFcts); DegreeOfFreedom *localIndices = new DegreeOfFreedom[numBasFcts];
DOFAdmin *admin = feSpace->getAdmin(); DOFAdmin *admin = feSpace->getAdmin();
WorldVector<DOFVector<double>*> parametricCoords; WorldVector<DOFVector<double>*> parametricCoords;
for(i = 0; i < dow; i++) { for (int i = 0; i < dow; i++)
parametricCoords[i] = new DOFVector<double>(feSpace, parametricCoords[i] = new DOFVector<double>(feSpace, "parametric coords");
"parametric coords");
}
std::map<DegreeOfFreedom, bool> visited; std::map<DegreeOfFreedom, bool> visited;
TraverseStack stack; TraverseStack stack;
ElInfo *elInfo = stack.traverseFirst(torus.getMesh(), -1, ElInfo *elInfo = stack.traverseFirst(torus.getMesh(), -1,
Mesh::CALL_LEAF_EL | Mesh::FILL_COORDS); Mesh::CALL_LEAF_EL | Mesh::FILL_COORDS);
while(elInfo) { while (elInfo) {
basFcts->getLocalIndices(elInfo->getElement(), admin, localIndices); basFcts->getLocalIndices(elInfo->getElement(), admin, localIndices);
for(i = 0; i < dim + 1; i++) { for (int i = 0; i < dim + 1; i++) {
dof = localIndices[i]; dof = localIndices[i];
x = elInfo->getCoord(i); x = elInfo->getCoord(i);
YRotation::rotate(x, rotation); YRotation::rotate(x, rotation);
if(!visited[dof]) { if (!visited[dof]) {
for(j = 0; j < dow; j++) { for (int j = 0; j < dow; j++)
(*(parametricCoords[j]))[dof] = x[j]; (*(parametricCoords[j]))[dof] = x[j];
}
visited[dof] = true; visited[dof] = true;
} }
} }
...@@ -192,16 +189,16 @@ int main(int argc, char* argv[]) ...@@ -192,16 +189,16 @@ int main(int argc, char* argv[])
visited.clear(); visited.clear();
elInfo = stack.traverseFirst(torus.getMesh(), -1, elInfo = stack.traverseFirst(torus.getMesh(), -1,
Mesh::CALL_LEAF_EL | Mesh::FILL_COORDS); Mesh::CALL_LEAF_EL | Mesh::FILL_COORDS);
while(elInfo) { while (elInfo) {
basFcts->getLocalIndices(elInfo->getElement(), admin, localIndices); basFcts->getLocalIndices(elInfo->getElement(), admin, localIndices);
for(i = 0; i < dim + 1; i++) { for (int i = 0; i < dim + 1; i++) {
dof = localIndices[i]; dof = localIndices[i];
x = elInfo->getCoord(i); x = elInfo->getCoord(i);
YRotation::rotate(x, rotation); YRotation::rotate(x, rotation);
if(!visited[dof]) { if (!visited[dof]) {
for(j = 0; j < dow; j++) { for (int j = 0; j < dow; j++)
(*(parametricCoords[j]))[dof] = x[j]; (*(parametricCoords[j]))[dof] = x[j];
}
visited[dof] = true; visited[dof] = true;
} }
} }
...@@ -214,7 +211,7 @@ int main(int argc, char* argv[]) ...@@ -214,7 +211,7 @@ int main(int argc, char* argv[])
for(i = 0; i < dow; i++) for(i = 0; i < dow; i++)
delete parametricCoords[i]; delete parametricCoords[i];
FREE_MEMORY(localIndices, DegreeOfFreedom, numBasFcts); delete [] localIndices;
} }
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