[Richards&Transport] Use VTKWriter without template keyword

parent 57527aba
......@@ -76,7 +76,7 @@ public:
* @tparam GF Type of the grid function
*/
template<class GF>
void addVertexData(const std::shared_ptr<const GF> &gf_ptr, std::string name)
void addVertexData(std::shared_ptr<const GF> gf_ptr, std::string name)
{
static_assert(std::is_same<typename GF::Traits::GridViewType,GV>::value,
"GridFunctionVTKSequenceWriter only works with only one GridView type.");
......
......@@ -271,34 +271,34 @@ void RichardsSimulation<Traits>::write_data () const
{
// create adapters
auto head = get_matric_head();
auto wflux = std::make_shared<GFWaterFlux>(gfs, u, fparam);
auto cond = std::make_shared<GFConductivity>(gv, fparam);
auto wc = std::make_shared<GFWaterContent>(head, gv, fparam);
auto sat = std::make_shared<GFSaturation>(head, gv, fparam);
auto wflux = std::make_shared<const GFWaterFlux>(gfs, u, fparam);
auto cond = std::make_shared<const GFConductivity>(gv, fparam);
auto wc = std::make_shared<const GFWaterContent>(head, gv, fparam);
auto sat = std::make_shared<const GFSaturation>(head, gv, fparam);
if (inifile.get<bool>("output.vertexData")) {
vtkwriter->template addVertexData<GFMatricHead>(head,"head");
vtkwriter->template addVertexData<GFWaterFlux>(wflux,"flux");
vtkwriter->template addVertexData<GFConductivity>(cond,"K_0");
vtkwriter->template addVertexData<GFWaterContent>(wc,"theta_w");
vtkwriter->template addVertexData<GFSaturation>(sat,"Theta");
vtkwriter->addVertexData(head,"head");
vtkwriter->addVertexData(wflux,"flux");
vtkwriter->addVertexData(cond,"K_0");
vtkwriter->addVertexData(wc,"theta_w");
vtkwriter->addVertexData(sat,"Theta");
if constexpr (enable_rt_engine)
if (enable_fluxrc) {
auto wfluxr = get_water_flux_reconstructed();
auto RT_name = "flux_RT" + std::to_string(flux_order);
vtkwriter->template addVertexData<GFFluxReconstruction>(wfluxr,RT_name);
vtkwriter->addVertexData(wfluxr,RT_name);
}
} else {
vtkwriter->template addCellData<GFMatricHead>(head,"head");
vtkwriter->template addCellData<GFWaterFlux>(wflux,"flux");
vtkwriter->template addCellData<GFConductivity>(cond,"K_0");
vtkwriter->template addCellData<GFWaterContent>(wc,"theta_w");
vtkwriter->template addCellData<GFSaturation>(sat,"Theta");
vtkwriter->addCellData(head,"head");
vtkwriter->addCellData(wflux,"flux");
vtkwriter->addCellData(cond,"K_0");
vtkwriter->addCellData(wc,"theta_w");
vtkwriter->addCellData(sat,"Theta");
if constexpr (enable_rt_engine)
if (enable_fluxrc) {
auto wfluxr = get_water_flux_reconstructed();
auto RT_name = "flux_RT" + std::to_string(flux_order);
vtkwriter->template addCellData<GFFluxReconstruction>(wfluxr,RT_name);
vtkwriter->addCellData(wfluxr,RT_name);
}
}
......
......@@ -222,36 +222,34 @@ void TransportSimulation<Traits>::write_data () const
{
if (vtkwriter)
{
auto peclet = std::make_shared<GFPeclet>(gv, sparam, water_flux_gf, water_content_gf);
auto d_hd = std::make_shared<GFEffectiveHydrodynamicDispersion>(gv, sparam, water_flux_gf, water_content_gf);
auto peclet = std::make_shared<const GFPeclet>(gv, sparam, water_flux_gf, water_content_gf);
auto d_hd = std::make_shared<const GFEffectiveHydrodynamicDispersion>(gv, sparam, water_flux_gf, water_content_gf);
if (inifile.get<bool>("output.vertexData")) {
vtkwriter->template addVertexData<GFSolute>(get_solute(),"solute");
vtkwriter->template addVertexData<GFTotalSolute>(get_total_solute(),"total_solute");
vtkwriter->template addVertexData<GFPeclet>(peclet,"micro_peclet");
vtkwriter->addVertexData(get_solute(),"solute");
vtkwriter->addVertexData(get_total_solute(),"total_solute");
vtkwriter->addVertexData(peclet,"micro_peclet");
if (inifile.get<bool>("output.writeDispersionTensor"))
vtkwriter->template addVertexData<GFEffectiveHydrodynamicDispersion>(d_hd,"eff_hd_dispersion");
vtkwriter->addVertexData(d_hd,"eff_hd_dispersion");
if constexpr (enable_rt_engine)
if (enable_fluxrc) {
auto RT_name = "flux_RT" + std::to_string(flux_order);
vtkwriter->template addVertexData<GFFluxReconstruction>
(get_solute_flux_reconstructed(),RT_name);
vtkwriter->addVertexData(get_solute_flux_reconstructed(),RT_name);
}
} else {
vtkwriter->template addCellData<GFSolute>(get_solute(),"solute");
vtkwriter->template addCellData<GFTotalSolute>(get_total_solute(),"total_solute");
vtkwriter->template addCellData<GFPeclet>(peclet,"micro_peclet");
vtkwriter->addCellData(get_solute(),"solute");
vtkwriter->addCellData(get_total_solute(),"total_solute");
vtkwriter->addCellData(peclet,"micro_peclet");
if (inifile.get<bool>("output.writeDispersionTensor"))
vtkwriter->template addCellData<GFEffectiveHydrodynamicDispersion>(d_hd,"eff_hd_dispersion");
vtkwriter->addCellData(d_hd,"eff_hd_dispersion");
if constexpr (enable_rt_engine)
if (enable_fluxrc) {
auto RT_name = "flux_RT" + std::to_string(flux_order);
vtkwriter->template addCellData<GFFluxReconstruction>
(get_solute_flux_reconstructed(),RT_name);
vtkwriter->addCellData(get_solute_flux_reconstructed(),RT_name);
}
}
......
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