// ============================================================================ // == == // == AMDiS - Adaptive multidimensional simulations == // == == // == http://www.amdis-fem.org == // == == // ============================================================================ // // Software License for AMDiS // // Copyright (c) 2010 Dresden University of Technology // All rights reserved. // Authors: Simon Vey, Thomas Witkowski et al. // // This file is part of AMDiS // // See also license.opensource.txt in the distribution. #ifndef BOUNDARYELEMENTTOPDIST_H #define BOUNDARYELEMENTTOPDIST_H #include "ElInfo.h" #include "FixVec.h" #include "ElementLevelSet.h" #include "BoundaryElementDist.h" #include "VelocityExt.h" using namespace AMDiS; class BoundaryElementTopDist : public BoundaryElementDist { public: BoundaryElementTopDist(ElementLevelSet *elLS_, int dim_, VelocityExt *velExt_ = NULL) : BoundaryElementDist(elLS_, dim_), velExt(velExt_) {} ~BoundaryElementTopDist() {} /** * Calculates distance from the interface for all vertices of a boundary * element. * Distance is here the topological distance. * * Return value: Status of element elInfo. */ int calcDistOnBoundaryElement(ElInfo *elInfo, FixVec &dVec); protected: /** * Calculates distance of vertex v to intersection edge through * sP1 and sP2 within element. * lambda implicitly gives the next point on the intersection edge. */ double calcDistOnIntersecEdge(const WorldVector &sP1, const WorldVector &sP2, const WorldVector &v, double &lambda); //calculates the distance between two points double calc_dist_between_two_points( const WorldVector &point1, const WorldVector &point2); void cases_for_lambda(const WorldVector &SP, const WorldVector &SP_projected, const WorldVector &point1, const WorldVector &point2, double &lambda, double &dist); //calculates the projection of the point "v" onto a straight line //given by two points "sP1" nad "sP2" void projected_on_a_straight_line(const WorldVector &sP1, const WorldVector &sP2, const WorldVector &v, WorldVector &v_p, double &lambda_out ); protected: /** * Object needed to extrapolate velocity from the interface. */ VelocityExt *velExt; }; #endif // BOUNDARYELEMENTTOPDIST_H