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

bug wegen cell interpolation raus

parent 64fea19e
......@@ -85,13 +85,33 @@ class Expr_interpolant_point_to_cell : public Expr<Expr_interpolant_point_to_cel
double Give_fromTotal(int i) const { assert(false); return 0.0; }
};
/** \addtogroup InterpolationOperators **/
/* @{ */
/**
* interpolates from point data to cell data
**/
template <class A>
inline Expr_interpolant_point_to_cell<A> Cell_interpolation(const Expr<A>& a) {
return Expr_interpolant_point_to_cell<A>(a);
inline Expr_interpolant_point_to_cell<A> Cell_interpolation(const Expr<A>& ao) {
const A& a ( ao );
Unstructured_grid* ug = a.Give_blockgrid()->Give_unstructured_grid();
for(int id = 0;id < ug->Give_number_hexahedra();++id ) {
a.template Update<hexahedronEl> ( id );
}
return Expr_interpolant_point_to_cell<A>(ao);
}
/* @} */
/*
template <class DTyp>
inline Expr_interpolant_point_to_cell<Variable<DTyp> > Cell_interpolation(Variable<DTyp>& v) {
v.UpdateHexahedra();
return Expr_interpolant_point_to_cell<Variable<DTyp> >(v);
}
*/
//////////////////////////////////////////////////////
// 2. cell variable
//////////////////////////////////////////////////////
......@@ -101,6 +121,9 @@ inline Expr_interpolant_point_to_cell<A> Cell_interpolation(const Expr<A>& a) {
template <class DTyp, class Vari>
class VariableVector;
/** \addtogroup ExpressionTemplates **/
/* @{ */
template <class DTyp>
class Cell_variable : public Expr<Cell_variable< DTyp > > {
......@@ -185,6 +208,7 @@ private:
MPI_Comm comm;
};
//////////////////////////////////////////
// 2.2. product_cell, L_infty_cell
//////////////////////////////////////////////////////////////
......@@ -209,7 +233,7 @@ double Maximum_cell(const Expr<A>& a);
template <class A>
double Minimum_cell(const Expr<A>& a);
/* @} */
//////////////////////////////////////////
// 3. Implementierungen
......
......@@ -218,6 +218,8 @@ class Assign_System;
template <class DTyp, class Vari>
class VariableVector;
/** \addtogroup ExpressionTemplates **/
/* @{ */
template <class DTyp>
class Variable : public Expr<Variable< DTyp > >, public Object_based_on_ug {
template <class A, class ADTyp>
......@@ -423,7 +425,9 @@ class Variable : public Expr<Variable< DTyp > >, public Object_based_on_ug {
DTyp* dataTotal;
bool specialVariableForOneBlock; //> dann ist dataTotal nicht verwendbar
};
/* @} */
template <class DTyp>
void Variable<DTyp>::UpdateHexahedra() {
for(int id_hex=0;id_hex<ug->Give_number_hexahedra();++id_hex) {
......@@ -565,7 +569,8 @@ inline std::complex<double> Variable<std::complex<double> >::Give_data<hexahedro
///////////////////////////
/** \addtogroup ExpressionTemplates **/
/* @{ */
template <class A, class B>
_TypeOf2_ ( A, B ) product ( Expr<A>& a, Expr<B>& b, Marker& marker );
......@@ -593,7 +598,7 @@ double Minimum ( const Expr<A>& a, Marker& marker );
template <class A>
double Minimum ( const Expr<A>& a );
/* @} */
//////////////////////////////////////////
......
......@@ -54,6 +54,7 @@
* Interpolation from Cell_variable to Variable <br>
* FAST VERSION <br>
* Sometimes this version is a little bit less accurate than Interpolate_from_cell_to_point in case of smooth functions <br>
* This version is more accurate in case of discontinuous functions
* But in case of a non smooth function, this version is more appropriate
**/
class FastInterpolate_from_cell_to_point {
......
......@@ -111,12 +111,23 @@ class Expr2D_interpolant_point_to_cell : public Expr2D<Expr2D_interpolant_point_
}
};
/** \addtogroup InterpolationOperators **/
/* @{ */
/**
* interpolates from point data to cell data
**/
template <class A>
inline Expr2D_interpolant_point_to_cell<A> Cell_interpolation(const Expr2D<A>& a) {
return Expr2D_interpolant_point_to_cell<A>(a);
inline Expr2D_interpolant_point_to_cell<A> Cell_interpolation(const Expr2D<A>& ao) {
const A& a ( ao );
Unstructured2DGrid* ug = a.Give_blockgrid()->Give_unstructured_grid();
for(int id = 0;id < ug->Give_number_rectangle();++id ) {
ao.template Update<rectangleEl> ( id );
}
return Expr2D_interpolant_point_to_cell<A>(ao);
}
/* @} */
//////////////////////////////////////////////////////
......
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