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

Some optimizations.

parent 03a3f621
Branches
Tags
No related merge requests found
......@@ -77,12 +77,11 @@ class ElementLevelSet
mesh = mesh_;
dim = mesh->getDim();
elIntersecPoints =
NEW VectorOfFixVecs<DimVec<double> >(dim,
MAX_INTERSECTION_POINTS,
NO_INIT);
elVertexStatusVec = new int[dim+1];
elVertexLevelSetVec = new double[dim+1];
elIntersecPoints = new VectorOfFixVecs<DimVec<double> >(dim,
MAX_INTERSECTION_POINTS,
NO_INIT);
elVertexStatusVec = new int[dim + 1];
elVertexLevelSetVec = new double[dim + 1];
int setElementLevelSetTol = 0;
GET_PARAMETER(0, name + "->set ElementLevelSet tolerances", "%d",
......@@ -106,7 +105,7 @@ class ElementLevelSet
if(elVertexLevelSetVec)
delete [] elVertexLevelSetVec;
if (elIntersecPoints)
DELETE elIntersecPoints;
delete elIntersecPoints;
}
/**
......@@ -138,18 +137,15 @@ class ElementLevelSet
int createElementLevelSet(const ElInfo *elInfo_,
const bool doCalcIntersecPts_ = true);
/**
* Gets value of level set function at point given in
* barycentric coordinates.
*/
inline double calcLevelSetFct(const DimVec<double>& bary) {
/// Gets value of level set function at point given in barycentric coordinates.
inline double calcLevelSetFct(const DimVec<double>& bary)
{
return (*lSFct)(bary);
};
}
/**
* Resets level set information on element.
*/
inline void resetElement() {
/// Resets level set information on element.
inline void resetElement()
{
FUNCNAME("ElementLevelSet::resetElement");
numElVertexInterior = 0;
......@@ -157,116 +153,109 @@ class ElementLevelSet
numElVertexExterior = 0;
numIntersecPoints = 0;
elStatus = LEVEL_SET_UNDEFINED;
};
}
/**
* Defines current element (elInfo).
*/
inline void setElement(const ElInfo *elInfo_) {
/// Defines current element (elInfo).
inline void setElement(const ElInfo *elInfo_)
{
elInfo = elInfo_;
resetElement();
};
/**
* Set level_set_domain.
*/
inline void setLevelSetDomain(int status_) {
}
/// Set level_set_domain.
inline void setLevelSetDomain(int status_)
{
TEST_EXIT(status_ == LEVEL_SET_INTERIOR ||
status_ == LEVEL_SET_EXTERIOR ||
status_ == LEVEL_SET_BOUNDARY)("illegal level set status !\n");
level_set_domain = status_;
};
}
/**
* Functions to set tolerances for intersection point calculation.
*/
inline void setLsValTol(double tol) {LS_VAL_TOL = tol;};
inline void setLsValMin(double min) {LS_VAL_MIN = min;};
inline void setSpBaryTol(double tol) {SP_BARY_TOL = tol;};
/// Functions to set tolerances for intersection point calculation.
inline void setLsValTol(double tol)
{
LS_VAL_TOL = tol;
}
/**
* Get level_set_domain.
*/
inline const int& getLevelSetDomain() const {
inline void setLsValMin(double min)
{
LS_VAL_MIN = min;
}
inline void setSpBaryTol(double tol)
{
SP_BARY_TOL = tol;
}
/// Get level_set_domain.
inline const int& getLevelSetDomain() const
{
return level_set_domain;
};
}
/**
* Get LevelSet-Status of element.
*/
inline const int& getElementLevelSetStatus() const {
/// Get LevelSet-Status of element.
inline const int& getElementLevelSetStatus() const
{
return elStatus;
};
}
/**
* Get number of vertices which are intersection points.
*/
inline const int& getNumVertIntPoints() const {
/// Get number of vertices which are intersection points.
inline const int& getNumVertIntPoints() const
{
FUNCNAME("ElementLevelSet::getNumVertIntPoints");
TEST_EXIT(numElVertexBoundary == 0)("numElVertexBoundary should be zero!\n");
return numElVertexBoundary;
};
};
/**
* Get vector elVertexStatusVec.
*/
inline const int *getElVertStatusVec() const {
/// Get vector elVertexStatusVec.
inline const int *getElVertStatusVec() const
{
return elVertexStatusVec;
};
}
/**
* Get i-th component of vector elVertexLevelSetVec.
*/
inline const double getElVertLevelSetVec(const int i) const {
/// Get i-th component of vector elVertexLevelSetVec.
inline const double getElVertLevelSetVec(const int i) const
{
return elVertexLevelSetVec[i];
};
}
/**
* Get vector elVertexLevelSetVec.
*/
inline const double *getElVertLevelSetVec() const {
/// Get vector elVertexLevelSetVec.
inline const double *getElVertLevelSetVec() const
{
return elVertexLevelSetVec;
};
}
/**
* Get levelSetFct.
*/
inline ElementFunction<double> *getLevelSetFct() const {
/// Get levelSetFct.
inline ElementFunction<double> *getLevelSetFct() const
{
return lSFct;
};
}
/**
* Get mesh.
*/
inline Mesh *getMesh() const {
/// Get mesh.
inline Mesh *getMesh() const
{
return mesh;
};
}
/**
* Get dim.
*/
inline int getDim() const {
/// Get dim.
inline int getDim() const
{
return dim;
};
}
/**
* Get the intersection points.
*/
inline VectorOfFixVecs<DimVec<double> > *getElIntersecPoints() const {
/// Get the intersection points.
inline VectorOfFixVecs<DimVec<double> > *getElIntersecPoints() const
{
return elIntersecPoints;
};
}
/**
* Get number of intersection points.
*/
inline int getNumElIntersecPoints() const {
/// Get number of intersection points.
inline int getNumElIntersecPoints() const
{
return numIntersecPoints;
};
}
/**
* Calculate exterior normal to intersection plane.
*/
/// Calculate exterior normal to intersection plane.
void calcIntersecNormal(WorldVector<double> &normal);
/**
......@@ -287,9 +276,7 @@ class ElementLevelSet
int getVertexPos(const DimVec<double> barCoords);
protected:
/**
* Calculates level set value of each vertex of element.
*/
/// Calculates level set value of each vertex of element.
void calculateElementLevelSetVal();
/**
......
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment