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

Removed *_MEMORY macros in cFEM

parent 030e4563
No related branches found
No related tags found
No related merge requests found
...@@ -11,10 +11,9 @@ ...@@ -11,10 +11,9 @@
#include "CompositeFEMMethods.h" #include "CompositeFEMMethods.h"
void void CompositeFEMMethods::setPosLsToVal(DOFVector<double> *dof,
CompositeFEMMethods::setPosLsToVal(DOFVector<double> *dof, const double &val,
const double &val, const DOFVector<double> *lsFct_dof)
const DOFVector<double> *lsFct_dof)
{ {
DOFVector<double>::Iterator it_dof(dof, USED_DOFS); DOFVector<double>::Iterator it_dof(dof, USED_DOFS);
DOFVector<double>::Iterator it_lsFct_dof( DOFVector<double>::Iterator it_lsFct_dof(
...@@ -25,17 +24,14 @@ CompositeFEMMethods::setPosLsToVal(DOFVector<double> *dof, ...@@ -25,17 +24,14 @@ CompositeFEMMethods::setPosLsToVal(DOFVector<double> *dof,
++it_dof, ++it_lsFct_dof) { ++it_dof, ++it_lsFct_dof) {
// Is vertex in domain with positive level set function values ? // Is vertex in domain with positive level set function values ?
if (*it_lsFct_dof > 0) { if (*it_lsFct_dof > 0)
*it_dof = val; *it_dof = val;
}
} }
} }
void void CompositeFEMMethods::setPosLsToFct(DOFVector<double> *dof,
CompositeFEMMethods::setPosLsToFct( const AbstractFunction<double, WorldVector<double> > *fct,
DOFVector<double> *dof, const DOFVector<double> *lsFct_dof)
const AbstractFunction<double, WorldVector<double> > *fct,
const DOFVector<double> *lsFct_dof)
{ {
const BasisFunction *basisFcts = dof->getFESpace()->getBasisFcts(); const BasisFunction *basisFcts = dof->getFESpace()->getBasisFcts();
const DOFAdmin *admin = dof->getFESpace()->getAdmin(); const DOFAdmin *admin = dof->getFESpace()->getAdmin();
...@@ -61,19 +57,17 @@ CompositeFEMMethods::setPosLsToFct( ...@@ -61,19 +57,17 @@ CompositeFEMMethods::setPosLsToFct(
for (int i=0; i<=dim; ++i) { for (int i=0; i<=dim; ++i) {
// Is vertex in domain with positive level set function values ? // Is vertex in domain with positive level set function values ?
if (locVec[i] > 0) { if (locVec[i] > 0)
(*dof)[locInd[i]] = (*fct)(elInfo->getCoord(i)); (*dof)[locInd[i]] = (*fct)(elInfo->getCoord(i));
}
} }
elInfo = stack.traverseNext(elInfo); elInfo = stack.traverseNext(elInfo);
} }
} }
void void CompositeFEMMethods::printBoundaryElements(const std::string fn_str,
CompositeFEMMethods::printBoundaryElements(const std::string fn_str, ElementLevelSet *elLS,
ElementLevelSet *elLS, FiniteElemSpace *feSpace)
FiniteElemSpace *feSpace)
{ {
FUNCNAME("CompositeFEMMethods::printBoundaryElements()"); FUNCNAME("CompositeFEMMethods::printBoundaryElements()");
...@@ -92,14 +86,14 @@ CompositeFEMMethods::printBoundaryElements(const std::string fn_str, ...@@ -92,14 +86,14 @@ CompositeFEMMethods::printBoundaryElements(const std::string fn_str,
WorldVector<double> coord; WorldVector<double> coord;
const int nBasFcts = feSpace->getBasisFcts()->getNumber(); const int nBasFcts = feSpace->getBasisFcts()->getNumber();
DegreeOfFreedom *locInd = GET_MEMORY(DegreeOfFreedom, nBasFcts); DegreeOfFreedom *locInd = new DegreeOfFreedom[nBasFcts];
ElInfo *loc_elInfo = stack.traverseFirst(feSpace->getMesh(), ElInfo *loc_elInfo = stack.traverseFirst(feSpace->getMesh(),
-1, -1,
Mesh::CALL_LEAF_EL | Mesh::CALL_LEAF_EL |
Mesh::FILL_BOUND | Mesh::FILL_BOUND |
Mesh::FILL_COORDS); Mesh::FILL_COORDS);
while(loc_elInfo) { while (loc_elInfo) {
// Get local indices of vertices. // Get local indices of vertices.
feSpace->getBasisFcts()->getLocalIndices( feSpace->getBasisFcts()->getLocalIndices(
...@@ -137,7 +131,7 @@ CompositeFEMMethods::printBoundaryElements(const std::string fn_str, ...@@ -137,7 +131,7 @@ CompositeFEMMethods::printBoundaryElements(const std::string fn_str,
} // end of: mesh traverse } // end of: mesh traverse
FREE_MEMORY(locInd, DegreeOfFreedom, nBasFcts); delete [] locInd;
boundaryOut << "\nNumber of boundary elements: \t" << boundEl_cntr << "\n"; boundaryOut << "\nNumber of boundary elements: \t" << boundEl_cntr << "\n";
......
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