Commit fa6e44fa authored by Phillip Lino Rall's avatar Phillip Lino Rall
Browse files

uploading the merged files

parent 5e80bbf8
......@@ -7,6 +7,8 @@ unix:TEMPLATE = app
TARGET=run
#QMAKE_CXX = ccache g++
DEFINES += DEVELOP
# placing *.o files in bin_o
......
......@@ -17,7 +17,8 @@
**********************************************************************************/
#include "../../../linAlgExptemp/source/linAlg.h"
#include "../../../linAlgExptemp/source/extemp/extemp_type.h"
//#include "../../../linAlgExptemp/source/extemp/extemp_type.h"
#include "common_source/extemp_type.h"
#ifndef EXTEMP_H
#define EXTEMP_H
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -49,11 +49,7 @@ ny-1 * + + + + *
<<<<<<< HEAD
/**
=======
/***
>>>>>>> phillips_changes
* interpolates data from blockgrid_ to rectangular block [pWSD, pENT]
***/
class Interpolate_on_structured_grid {
......
......@@ -15,20 +15,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**********************************************************************************/
#include "../../../Source_Colsamm/Colsamm.h"
using namespace ::_COLSAMM_;
#include "interpolCellVar.h"
#include "../extemp/variable_cc.h"
#include "../pde_op/diffop_cc.h"
#include "../../../Source_Colsamm/Colsamm.h"
#include "assert.h"
using namespace ::_COLSAMM_;
template<>
void Interpolate_from_cell_to_point<Stencil_variable>::init(Blockgrid* blockgrid_) {
......
......@@ -251,7 +251,128 @@ inline double Y_meshsize::Give_cell_rectangle ( params2D_in_cell ) const {
///////////////////////////
// 3. Functions
///////////////////////////
// RALL : ifdef CPP11 : evtl löschen !
#ifdef CPP11
template<int ...> struct seq {};
template<int N, int ...S> struct gens : gens<N-1, N-1, S...> {};
template<int ...S> struct gens<0, S...>{ typedef seq<S...> type; };
template<class A, typename DTyp, typename DTyp_Result, typename ... Arguments>
class Exp2D_Function1 : public Expr2D<Exp2D_Function1<A, DTyp, DTyp_Result, Arguments...> >
{
const A& a_;
tuple<Arguments...> args_;
DTyp_Result
(*Formula_)(DTyp x, Arguments...);
template<elementTyp TYP_EL, int ...S>
inline DTyp_Result
Give_data_private(params2D_in, seq<S...>) const;
// gens<10> g;
// gens<10>::type s;
public:
inline
Exp2D_Function1(const A& a, DTyp_Result
(*Formula)(DTyp x, Arguments...), Arguments ... args)
: a_(a), Formula_(Formula), args_(args...)
{
}
stencil_typ
Give_stencil_typ() const
{
return no_stencil;
}
Blockgrid2D* Give_blockgrid() const { return a_.Give_blockgrid(); };
typedef DTyp_Result Result;
template<elementTyp TYP_EL>
inline DTyp_Result
Give_data(params2D_in) const;
inline DTyp_Result
Give_cell_rectangle(params2D_in_cell) const;
inline DTyp_Result
Give_matrix_rectangles(params2D_in_loc_matrix) const;
template<elementTyp TYP_EL>
void
Update(int id) const
{
a_.Update<TYP_EL>(id);
}
inline Unstructured2DGrid * Give_Ug() const {
return a_.Give_Ug();
}
};
template<class A, class DTyp, class DTyp_Result, typename ... Arguments>
template<elementTyp TYP_EL>
inline DTyp_Result
Exp2D_Function1<A, DTyp, DTyp_Result, Arguments...>::Give_data(params2D_in) const
{
return Give_data_private<TYP_EL>( params2D_out, typename gens<sizeof...(Arguments)>::type() );
}
template<class A, class DTyp, class DTyp_Result, typename ... Arguments>
template<elementTyp TYP_EL, int ...S>
inline DTyp_Result
Exp2D_Function1<A, DTyp, DTyp_Result, Arguments...>::Give_data_private(params2D_in, seq<S...>) const
{
return Formula_ ( a_.Give_data<TYP_EL> ( params2D_out ) , std::get<S>(args_) ...);
}
template<class A, class DTyp, class DTyp_Result, typename ... Arguments>
inline DTyp_Result
Exp2D_Function1<A, DTyp, DTyp_Result, Arguments...>::Give_cell_rectangle(params2D_in_cell) const
{
if (sizeof...(Arguments) == 0)
return Formula_ ( a_.Give_cell_rectangle ( params2D_out_cell ) );
else {
return Formula_ ( a_.Give_cell_rectangle ( params2D_out_cell, 1.0 ) );
}
}
template<class A, class DTyp, class DTyp_Result, typename ... Arguments>
inline DTyp_Result
Exp2D_Function1<A, DTyp, DTyp_Result, Arguments...>::Give_matrix_rectangles(params2D_in_loc_matrix) const
{
if (sizeof...(Arguments) == 0)
return Formula_ ( a_.Give_matrix_rectangles ( params2D_out_loc_matrix) );
else {
return Formula_ ( a_.Give_matrix_rectangles ( params2D_out_loc_matrix, 1.0 ) );
}
}
template <class DTyp_Result, class DTyp, typename... Arguments>
class Function2d1 {
public:
typedef DTyp_Result Result;
Function2d1 ( DTyp_Result ( *formula ) ( DTyp x , Arguments... args)) : Formula ( formula ) {}
template <class A>
inline Exp2D_Function1<A, DTyp, DTyp_Result, Arguments...> operator() ( const Expr2D<A>& a, Arguments... args) const
{ return Exp2D_Function1<A, DTyp, DTyp_Result, Arguments...> ( a, Formula, args...); }
private:
DTyp_Result ( *Formula) ( DTyp x, Arguments... );
};
#else
template<class A, typename DTyp, typename DTyp_Result>
class Exp2D_Function1 : public Expr2D<Exp2D_Function1<A, DTyp, DTyp_Result > >
{
......@@ -1025,5 +1146,6 @@ class Function2d6 {
private:
DTyp ( *Formula ) ( DTyp x1, DTyp x2, DTyp x3, DTyp x4, DTyp x5, DTyp x6 );
};
#endif
#endif // CO_FU_H
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