Commit d65f6a6f authored by Christoph Pflaum's avatar Christoph Pflaum
Browse files

iKOmmentare wohl nur

parent 62a65618
......@@ -233,6 +233,27 @@ Exp_Functor1<A, DTyp_Result, DTyp, Func>::Give_fromTotal(int i) const {
/** \addtogroup ExpressionTemplates **/
/* @{ */
/**
* The class Func must contain a member function
* DTyp Func::evalute(DTyp x);
* Then, one apply Functor1 as follows
* \verbatim
* class Func test{
* public:
* Func(double f) : mf(f) {};
* double evaluate(double x) { return x * mf; }
* private:
* double mf;
* };
* .....
*
* Func multiplyFive(5.0);
* Functor1 multiplyFiveFunc(multiplyFive);
* .....
*
* a = multiplyFiveFunc(b);
* \endverbatim
**/
template <class DTyp_Result, class DTyp, class Func>
class Functor1 {
public:
......@@ -254,7 +275,6 @@ class Functor1 {
* 2 arguments
**/
template <class A, class B, class DTyp_Result, class DTyp, class Func>
class Exp_Functor2
: public Expr<Exp_Functor2<A, B, DTyp_Result, DTyp, Func> > {
const A& a_;
......@@ -317,6 +337,11 @@ Exp_Functor2<A, B, DTyp_Result, DTyp, Func>::Give_fromTotal(int i) const {
/** \addtogroup ExpressionTemplates **/
/* @{ */
/**
* The class Func must contain a member function
* DTyp Func::evalute(DTyp x, DTyp y);
* see Functor1
**/
template <class DTyp_Result, class DTyp, class Func>
class Functor2 {
......@@ -420,8 +445,12 @@ Exp_Functor3<A, B, C, DTyp_Result, DTyp, Func>::Give_fromTotal(int i) const {
/** \addtogroup ExpressionTemplates **/
/* @{ */
/**
* The class Func must contain a member function
* DTyp Func::evalute(DTyp x, DTyp y, DTyp z);
* see Functor1
**/
template <class DTyp_Result, class DTyp, class Func>
class Functor3 {
public:
......@@ -510,8 +539,12 @@ Exp_Functor4<A, B, C, D, DTyp_Result, DTyp, Func>::Give_cell_hexahedra ( params_
/** \addtogroup ExpressionTemplates **/
/* @{ */
/**
* The class Func must contain a member function
* DTyp Func::evalute(DTyp x, DTyp y);
* see Functor1
**/
template <class DTyp_Result, class DTyp, class Func>
class Functor4 {
public:
......
......@@ -735,26 +735,26 @@ class SaveDiv2D : public Expr2D<SaveDiv2D<A, B> > {
template <elementTyp TYP_EL>
inline Result Give_data ( params2D_in ) const {
Result valueB = b_.template Give_data<TYP_EL> ( params2D_out );
if(abs(valueB) < saveDivision2D::eps) return 0.0;
if(myABS(valueB) < saveDivision2D::eps) return 0.0;
return a_.template Give_data<TYP_EL> ( params2D_out ) / valueB;
}
template <sten_part_typ TYP_EL>
inline Result Give_data_sten ( params2D_in_sten ) const {
Result valueB = b_.template Give_data_sten<TYP_EL> ( params2D_out_sten );
if(abs(valueB) < saveDivision2D::eps) return 0.0;
if(myABS(valueB) < saveDivision2D::eps) return 0.0;
return a_.template Give_data_sten<TYP_EL> ( params2D_out_sten ) / valueB;
}
inline Result Give_matrix_rectangle ( params2D_in_loc_matrix ) const {
Result valueB = b_.Give_matrix_rectangle ( params2D_out_loc_matrix );
if(abs(valueB) < saveDivision2D::eps) return 0.0;
if(myABS(valueB) < saveDivision2D::eps) return 0.0;
return a_.Give_matrix_rectangle ( params2D_out_loc_matrix ) / valueB;
}
inline Result Give_cell_rectangle ( params2D_in_cell ) const {
Result valueB = b_.Give_cell_rectangle ( params2D_out_cell );
if(abs(valueB) < saveDivision2D::eps) return 0.0;
if(myABS(valueB) < saveDivision2D::eps) return 0.0;
return a_.Give_cell_rectangle ( params2D_out_cell ) / valueB;
}
......@@ -767,6 +767,12 @@ class SaveDiv2D : public Expr2D<SaveDiv2D<A, B> > {
inline Unstructured2DGrid * Give_Ug() const {
return a_.Give_Ug();
}
private:
static double myABS(double a) { return a < 0.0 ? -a : a; }
static std::complex<double> myABS(std::complex<double> c) {
return (c.real() < 0.0 ? -c.real() : c.real()) + (c.imag() < 0.0 ? -c.imag() : c.imag());
}
};
//----------------------------------------------------------------------------
......
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