Commit 90a083bc authored by Santiago Ospina's avatar Santiago Ospina

Added interface of grid function to the flux reconstruction and printed into the vtk writer.

Signed-off-by: Santiago Ospina De Los Ríos's avatarSantiago Ospina <santiago.ospina@iup.uni-heidelberg.de>
parent b7508d2e
......@@ -228,15 +228,16 @@ void RichardsSimulation<Traits>::write_data () const
vtkwriter->template addVertexData<GFWaterContent>(waterdgf,"theta_w");
vtkwriter->template addVertexData<GFSaturation>(satdgf,"Theta");
vtkwriter->template addVertexData<GFWaterFlux>(fluxdgf,"flux");
vtkwriter->template addVertexData<GFWaterFluxReconstruction>(waterfrgf,"flux (reconstruction)");
} else {
vtkwriter->template addCellData<GFMatricHead>(udgf,"head");
vtkwriter->template addCellData<GFWaterFlux>(fluxdgf,"flux");
vtkwriter->template addCellData<GFConductivity>(condgf,"K_0");
vtkwriter->template addCellData<GFWaterContent>(waterdgf,"theta_w");
vtkwriter->template addCellData<GFSaturation>(satdgf,"Theta");
vtkwriter->template addCellData<GFWaterFluxReconstruction>(waterfrgf,"flux (reconstruction)");
}
try{
vtkwriter->write(controller->getTime(),output_type);
}
......
......@@ -22,7 +22,18 @@ namespace Dorie{
* @tparam order Order of the RT reconstruction.
*/
template<class GO, Dune::GeometryType::BasicType gt, int order>
class RaviartThomasFluxReconstruction // : public GridFunctionBase<>
class RaviartThomasFluxReconstruction
: public Dune::PDELab::GridFunctionBase<
Dune::PDELab::GridFunctionTraits<
typename GO::Traits::TrialGridFunctionSpace::Traits::GridViewType,
typename GO::Traits::TrialGridFunctionSpace::Traits::FiniteElementType::Traits::LocalBasisType::Traits::RangeFieldType,
GO::Traits::TrialGridFunctionSpace::Traits::GridViewType::dimension,
Dune::FieldVector<
typename GO::Traits::TrialGridFunctionSpace::Traits::FiniteElementType::Traits::LocalBasisType::Traits::RangeFieldType,
GO::Traits::TrialGridFunctionSpace::Traits::GridViewType::dimension
> >,
RaviartThomasFluxReconstruction<GO,gt,order>
>
{
using GFSW = typename GO::Traits::TrialGridFunctionSpace;
using Domain = typename GO::Traits::Domain;
......@@ -51,53 +62,27 @@ class RaviartThomasFluxReconstruction // : public GridFunctionBase<>
using GFSVSkeleton = Dune::PDELab::GridFunctionSpace<ES,SkeletonFEM>;
using LocalRaviartThomasEngine = Dune::Dorie::LocalRaviartThomasAssemblerEngine<LA,GFSVVolume,GFSVSkeleton>;
// ============
// data members
// ============
GO& _go;
// grid related stuff
GV gv;
// const IndexSet& is;
GFSU _gfsu;
Range _x;
// // discretization related stuff
// DF time; // this is just for set_time
// int intorderadd;
// int quadrature_factor;
// // the local finite elements
// LFE lfe;
// LFEFACE lfeface; // for testing faces
// RTPsi<DF,RF,order,dim,gt> lfeelem; // for testing elements
// // the global coefficient vector
// std::vector<LocalDOF> rtdof;
// // cache for RT basis functions
// mutable RTCache rtcache;
// mutable JacobianTransposed BigB;
// mutable RF detBigB;
// mutable int lastindex;
// Range _r;
public:
using Traits = Dune::PDELab::GridFunctionTraits<
typename GO::Traits::TrialGridFunctionSpace::Traits::GridViewType,
typename GO::Traits::TrialGridFunctionSpace::Traits::FiniteElementType::Traits::LocalBasisType::Traits::RangeFieldType,
GO::Traits::TrialGridFunctionSpace::Traits::GridViewType::dimension,
Dune::FieldVector<
typename GO::Traits::TrialGridFunctionSpace::Traits::FiniteElementType::Traits::LocalBasisType::Traits::RangeFieldType,
GO::Traits::TrialGridFunctionSpace::Traits::GridViewType::dimension
> >;
RaviartThomasFluxReconstruction(GO& go, int intorderadd_=2)
: _go(go)
, gv(go.trialGridFunctionSpace().gridView())
, _gfsu(_go.trialGridFunctionSpace().entitySet(),gv)
, _x(_gfsu,0.0)
, dgfp(_gfsu,_x)
{}
void update (const Domain& p)
{
const auto& entity_set = _go.trialGridFunctionSpace().entitySet();
VolumeFEM volume_fem;
......@@ -123,6 +108,31 @@ public:
local_raviart_thomas_engine.setSolution(_x);
global_assembler_gop.assemble(local_raviart_thomas_engine);
}
// evaluate velocity
inline void evaluate (const typename Traits::ElementType& e,
const typename Traits::DomainType& x,
typename Traits::RangeType& y) const
{
dgfp.evaluate(e,x,y);
}
template<class Time>
void setTime (Time time_)
{}
//! get a reference to the GridView
inline const typename Traits::GridViewType& getGridView () const
{
return gv;
}
private:
GO& _go;
GV gv;
GFSU _gfsu;
Range _x;
Dune::PDELab::DiscreteGridFunctionPiola<GFSU,Range> dgfp;
};
} // namespace Dorie
......
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