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

iein paar Kommentare rein

parent efadcb70
......@@ -50,7 +50,7 @@ Ny-1 * + + + + *
// 1. Coordinate
///////////////////////////
/** \defgroup ExpressionTemplates ''Expression Template Operators (excluding +,-,... ) ''
/** \defgroup ExpressionTemplates ''Expression Template Operators in 3D (excluding +,-,... ) ''
**/
/* @{ */
class X_coordinate : public Expr<X_coordinate> {
......
......@@ -37,3 +37,8 @@
double saveDivision::eps = 1.0e-40;
......@@ -766,6 +766,8 @@ struct saveDivision {
};
/* @} */
template <class A, class B>
class SaveDiv : public Expr<SaveDiv<A, B> > {
const A& a_;
......@@ -805,32 +807,32 @@ class SaveDiv : public Expr<SaveDiv<A, B> > {
template <elementTyp TYP_EL>
inline Result Give_data ( params_in ) const {
Result valueB = b_.template Give_data<TYP_EL> ( params_out );
if(abs(valueB) < saveDivision::eps) return 0.0;
if(myABS(valueB) < saveDivision::eps) return 0.0;
return a_.template Give_data<TYP_EL> ( params_out ) / valueB;
}
template <sten_part_typ TYP_EL>
inline Result Give_data_sten ( params_in_sten ) const {
Result valueB = b_.template Give_data_sten<TYP_EL> ( params_out_sten );
if(abs(valueB) < saveDivision::eps) return 0.0;
if(myABS(valueB) < saveDivision::eps) return 0.0;
return a_.template Give_data_sten<TYP_EL> ( params_out_sten ) / valueB;
}
inline Result Give_matrix_hexahedra ( params_in_loc_matrix ) const {
Result valueB = b_.Give_matrix_hexahedra ( params_out_loc_matrix );
if(abs(valueB) < saveDivision::eps) return 0.0;
if(myABS(valueB) < saveDivision::eps) return 0.0;
return a_.Give_matrix_hexahedra ( params_out_loc_matrix ) / valueB;
}
inline Result Give_cell_hexahedra ( params_in_cell ) const {
Result valueB = b_.Give_cell_hexahedra ( params_out_cell );
if(abs(valueB) < saveDivision::eps) return 0.0;
if(myABS(valueB) < saveDivision::eps) return 0.0;
return a_.Give_cell_hexahedra ( params_out_cell ) / valueB;
}
inline Result Give_fromTotal(int i) const {
Result valueB = b_.Give_fromTotal(i);
if(abs(valueB) < saveDivision::eps) return 0.0;
if(myABS(valueB) < saveDivision::eps) return 0.0;
return a_.Give_fromTotal(i) / valueB;
}
......@@ -839,6 +841,12 @@ class SaveDiv : public Expr<SaveDiv<A, B> > {
a_.template Update<TYP_EL> ( id );
b_.template Update<TYP_EL> ( id );
}
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());
}
};
......
......@@ -448,15 +448,7 @@ inline std::vector<int> find_p_quad ( dir3D quad, Hexahedron_el *hex )
}
D3vector Blockgrid::Give_coord_hexahedron ( int id_hex,
int i, int j, int k ) const
{
if (id_hex < 0 || id_hex > 4)
{
cout << "doubt x " << endl;
}
D3vector Blockgrid::Give_coord_hexahedron ( int id_hex, int i, int j, int k ) const {
// if (blockgrid_hexa_coordinates_set.size() > 0)
// {
//cout << "id_hex " << id_hex << " i " << i << " j " << j << " k " << k << endl;
......
......@@ -124,7 +124,8 @@ inline Expr2D_interpolant_point_to_cell<A> Cell_interpolation(const Expr2D<A>& a
//////////////////////////////////////////////////////
// 3.1. definition
//////////////////////////////////////////////////////////////
/** \addtogroup ExpressionTemplates2D **/
/* @{ */
template <class DTyp>
class Cell_variable2D : public Expr2D<Cell_variable2D< DTyp > > {
......@@ -187,6 +188,7 @@ double L_infty_cell(const Expr2D<A>& a, Marker2D& marker);
template <class A>
double L_infty_cell(const Expr2D<A>& a);
/* @} */
//////////////////////////////////////////
......
......@@ -55,6 +55,9 @@ Ny-1 * + + + + *
// 1. Coordinate
///////////////////////////
/** \defgroup ExpressionTemplates2D ''Expression Template Operators in 3D (excluding +,-,... ) ''
**/
/* @{ */
class X_coordinate2d : public Expr2D<X_coordinate2d> {
public:
......@@ -79,7 +82,7 @@ class X_coordinate2d : public Expr2D<X_coordinate2d> {
private:
Blockgrid2D* blockgrid;
};
/* @} */
inline double X_coordinate2d::Give_cell_rectangle ( params2D_in_cell ) const {
// return blockgrid->Give_coord_rectangle(id_rec, i, j, k).x;
......@@ -105,6 +108,8 @@ inline double X_coordinate2d::Give_data<pointEl> ( params2D_in ) const {
return blockgrid->Give_coord_point ( id ).x;
}
/** \addtogroup ExpressionTemplates2D **/
/* @{ */
class Y_coordinate2d : public Expr2D<Y_coordinate2d> {
public:
......@@ -129,6 +134,7 @@ class Y_coordinate2d : public Expr2D<Y_coordinate2d> {
private:
Blockgrid2D* blockgrid;
};
/* @} */
inline double Y_coordinate2d::Give_cell_rectangle ( params2D_in_cell ) const {
return 0.25* (blockgrid->Give_coord_rectangle ( id_rec, i , j ).y +
......
......@@ -159,7 +159,8 @@ template <class DTyp> class Variable2D;
template <class A, class DTyp, class DTyp1> class Exp_Function1;
template <class A, class B, class C, class D, class DTyp, class DTyp_Result> class Exp_Function4;
/** \addtogroup ExpressionTemplates2D **/
/* @{ */
template <class DTyp>
class Variable2D : public Expr2D<Variable2D< DTyp > > {
public:
......@@ -295,6 +296,7 @@ class Variable2D : public Expr2D<Variable2D< DTyp > > {
int ug_number_points;
int idGrid;
};
/* @} */
template <class DTyp>
DTyp Variable2D<DTyp>::Give_interpolated_cell_rectangle(int id_rec, int i, int j, int Nx) const {
......
......@@ -536,7 +536,8 @@ inline bool Variable2D<bool>::Give_data<rectangleEl> ( params2D_in ) const {
// 3. Other functions, max, ...
///////////////////////////
/** \addtogroup ExpressionTemplates2D **/
/* @{ */
/*
template <class A, class B>
_TypeOf2_ ( A, B ) product ( Expr2D<A>& a, Expr2D<B>& b, Marker2D& marker );
......@@ -546,6 +547,7 @@ _TypeOf2_ ( A, B ) product (const Expr2D<A>& a,const Expr2D<B>& b );
template <class A>
double L_infty ( const Expr2D<A>& a, Marker2D& marker );
......@@ -574,8 +576,7 @@ double Maximum ( const Variable2D<DTyp>& v);
template <class DTyp>
double L2Norm ( const Variable2D<DTyp>& v, Marker2D& marker );
/* @} */
//////////////////////////////////////////
// and it's implementation
......
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