diff --git a/dune/phasefield/chns_base.hh b/dune/phasefield/chns_base.hh index d07ca378c86ed86a13aac45a9f6eff836b480714..5fe527fe157cba2f6be62db44ba60e3bc1f30151 100644 --- a/dune/phasefield/chns_base.hh +++ b/dune/phasefield/chns_base.hh @@ -66,16 +66,16 @@ public: // RETURN VALUE: -1 -> ABORT, 0-> REDO TIMESTEP, 1-> OK - template<typename NS_NEWTON, typename CH_NEWTON, typename VTKWRITER> - int doTimestep(NS_NEWTON& ns_newton, CH_NEWTON& ch_newton, VTKWRITER& vtkwriter) + template<typename NS_NEWTON, typename CH_NEWTON, typename VTKWRITER, typename NS_V, typename CH_V> + int doTimestep(NS_NEWTON& ns_newton, CH_NEWTON& ch_newton, VTKWRITER& vtkwriter, NS_V& nsV, CH_V& chV) { try { if (verb > 1) std::cout << "= Begin newtonapply NS:" << std::endl; - ns_newton.apply(); + ns_newton.apply(nsV); if (verb > 1) std::cout << "= Begin newtonapply CH:" << std::endl; - ch_newton.apply(); + ch_newton.apply(chV); } catch(...) @@ -90,16 +90,16 @@ public: // RETURN VALUE: -1 -> ABORT, 0-> REDO TIMESTEP, 1-> OK - template<typename NS_NEWTON, typename CH_NEWTON, typename VTKWRITER> - int doTimestepNoAccept(NS_NEWTON& ns_newton, CH_NEWTON& ch_newton, VTKWRITER& vtkwriter) + template<typename NS_NEWTON, typename CH_NEWTON, typename VTKWRITER, typename NS_V, typename CH_V> + int doTimestepNoAccept(NS_NEWTON& ns_newton, CH_NEWTON& ch_newton, VTKWRITER& vtkwriter, NS_V& nsV, CH_V& chV) { try { if (verb > 1) std::cout << "= Begin newtonapply NS:" << std::endl; - ns_newton.apply(); + ns_newton.apply(nsV); if (verb > 1) std::cout << "= Begin newtonapply CH:" << std::endl; - ch_newton.apply(); + ch_newton.apply(chV); } catch(...) @@ -113,13 +113,13 @@ public: } // RETURN VALUE: -1 -> ABORT, 0-> REDO TIMESTEP, 1-> OK - template<typename NS_NEWTON, typename VTKWRITER> - int doOnlyNSTimestep(NS_NEWTON& ns_newton, VTKWRITER& vtkwriter) + template<typename NS_NEWTON, typename VTKWRITER, typename NS_V> + int doOnlyNSTimestep(NS_NEWTON& ns_newton, VTKWRITER& vtkwriter, NS_V& nsV) { try { if (verb > 1) std::cout << "= Begin (only) newtonapply NS:" << std::endl; - ns_newton.apply(); + ns_newton.apply(nsV); } catch(...) { @@ -130,13 +130,13 @@ public: } // RETURN VALUE: -1 -> ABORT, 0-> REDO TIMESTEP, 1-> OK - template<typename CH_NEWTON, typename VTKWRITER> - int doOnlyCHTimestep(CH_NEWTON& ch_newton, VTKWRITER& vtkwriter) + template<typename CH_NEWTON, typename VTKWRITER, typename CH_V> + int doOnlyCHTimestep(CH_NEWTON& ch_newton, VTKWRITER& vtkwriter, CH_V& chV) { try { if (verb > 1) std::cout << "= Begin (only) newtonapply CH:" << std::endl; - ch_newton.apply(); + ch_newton.apply(chV); } catch(...) { @@ -145,15 +145,15 @@ public: applyTimestep(vtkwriter); return 1; } - + // RETURN VALUE: -1 -> ABORT, 0-> REDO TIMESTEP, 1-> OK - template<typename CHNS_NEWTON, typename VTKWRITER> - int doMonolithicTimestep(CHNS_NEWTON& chns_newton, VTKWRITER& vtkwriter) + template<typename CHNS_NEWTON, typename VTKWRITER, typename CHNS_V> + int doMonolithicTimestep(CHNS_NEWTON& chns_newton, VTKWRITER& vtkwriter, CHNS_V& chnsV) { try { if (verb > 1) std::cout << "= Begin newtonapply CHNS:" << std::endl; - chns_newton.apply(); + chns_newton.apply(chnsV); } catch(...) { @@ -178,10 +178,10 @@ public: chVLast = chV; if (verb > 1) std::cout << "= Begin newtonapply NS:" << std::endl; - ns_newton.apply(); + ns_newton.apply(nsV); if (verb > 1) std::cout << "= Begin newtonapply CH:" << std::endl; - ch_newton.apply(); + ch_newton.apply(chV); if (verb > 1) std::cout << "Result: " << ns_newton.result().iterations << " and " << ch_newton.result().iterations << std::endl; iter++; @@ -515,7 +515,7 @@ public: estgo.residual(chV,z0); if(writeOutput) { - auto vtkwriter = std::make_shared<Dune::SubsamplingVTKWriter<GV> >(gv,0); + auto vtkwriter = std::make_shared<Dune::SubsamplingVTKWriter<GV> >(gv,Dune::refinementLevels(0)); vtkwriter->addVertexData(std::make_shared<Dune::PDELab::VTKGridFunctionAdapter<Z0DGF> >(z0dgf,"indicator")); vtkwriter->write("RefinementIndicator",Dune::VTK::ascii); } @@ -623,7 +623,7 @@ public: printVector(chV,verbosity-2,"chV"); } } - + template<typename Grid, typename CHNS_V, typename CHNS_GFS> void refineGridCHNS(Grid &grid, CHNS_V &chnsV, CHNS_GFS chnsgfs, int verbosity = 0) { diff --git a/dune/phasefield/ff_chns.hh b/dune/phasefield/ff_chns.hh index 0f1f8e0c1c84ecdfd60b08eff2a73ac52f2bb148..4e1d601b5fbec9209d69b07066adb5671245fbf8 100644 --- a/dune/phasefield/ff_chns.hh +++ b/dune/phasefield/ff_chns.hh @@ -142,22 +142,22 @@ class DGF_ff_chns { public: - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::TreePath<0> > VSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::StaticTreePath<0> > VSubGFS; VSubGFS vSubGfs; typedef Dune::PDELab::VectorDiscreteGridFunction<VSubGFS,NS_V> VDGF; VDGF vDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::TreePath<1> > PSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::StaticTreePath<1> > PSubGFS; PSubGFS pSubGfs; typedef Dune::PDELab::DiscreteGridFunction<PSubGFS,NS_V> PDGF; PDGF pDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::TreePath<0> > PhiSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::StaticTreePath<0> > PhiSubGFS; PhiSubGFS phiSubGfs; typedef Dune::PDELab::DiscreteGridFunction<PhiSubGFS,CH_V> PhiDGF; PhiDGF phiDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::TreePath<1> > MuSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::StaticTreePath<1> > MuSubGFS; MuSubGFS muSubGfs; typedef Dune::PDELab::DiscreteGridFunction<MuSubGFS,CH_V> MuDGF; MuDGF muDgf; @@ -190,22 +190,22 @@ class DGF_ff_chns_monolithic { public: - typedef Dune::PDELab::GridFunctionSubSpace< typename GFS::CHNS, Dune::TypeTree::TreePath<1, 0> > VSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace< typename GFS::CHNS, Dune::TypeTree::StaticTreePath<1, 0> > VSubGFS; VSubGFS vSubGfs; typedef Dune::PDELab::VectorDiscreteGridFunction<VSubGFS, CHNS_V> VDGF; VDGF vDgf; - typedef Dune::PDELab::GridFunctionSubSpace< typename GFS::CHNS, Dune::TypeTree::TreePath<1, 1> > PSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace< typename GFS::CHNS, Dune::TypeTree::StaticTreePath<1, 1> > PSubGFS; PSubGFS pSubGfs; typedef Dune::PDELab::DiscreteGridFunction<PSubGFS, CHNS_V> PDGF; PDGF pDgf; - typedef Dune::PDELab::GridFunctionSubSpace< typename GFS::CHNS, Dune::TypeTree::TreePath<0, 0> > PhiSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace< typename GFS::CHNS, Dune::TypeTree::StaticTreePath<0, 0> > PhiSubGFS; PhiSubGFS phiSubGfs; typedef Dune::PDELab::DiscreteGridFunction<PhiSubGFS, CHNS_V> PhiDGF; PhiDGF phiDgf; - typedef Dune::PDELab::GridFunctionSubSpace< typename GFS::CHNS, Dune::TypeTree::TreePath<0, 1> > MuSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace< typename GFS::CHNS, Dune::TypeTree::StaticTreePath<0, 1> > MuSubGFS; MuSubGFS muSubGfs; typedef Dune::PDELab::DiscreteGridFunction<MuSubGFS, CHNS_V> MuDGF; MuDGF muDgf; diff --git a/dune/phasefield/fff_chns.hh b/dune/phasefield/fff_chns.hh index 5dc37d955a7e35d0af65e86adc7d7f01d0a1ffc7..d4c367fce673097751deafd1e4c664cf309146b1 100644 --- a/dune/phasefield/fff_chns.hh +++ b/dune/phasefield/fff_chns.hh @@ -82,32 +82,32 @@ class DGF_fff_chns { public: - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::TreePath<0> > VSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::StaticTreePath<0> > VSubGFS; VSubGFS vSubGfs; typedef Dune::PDELab::VectorDiscreteGridFunction<VSubGFS,NS_V> VDGF; VDGF vDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::TreePath<1> > PSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::StaticTreePath<1> > PSubGFS; PSubGFS pSubGfs; typedef Dune::PDELab::DiscreteGridFunction<PSubGFS,NS_V> PDGF; PDGF pDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::TreePath<0> > PhiSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::StaticTreePath<0> > PhiSubGFS; PhiSubGFS phiSubGfs; typedef Dune::PDELab::DiscreteGridFunction<PhiSubGFS,CH_V> PhiDGF; PhiDGF phiDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::TreePath<1> > MuSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::StaticTreePath<1> > MuSubGFS; MuSubGFS muSubGfs; typedef Dune::PDELab::DiscreteGridFunction<MuSubGFS,CH_V> MuDGF; MuDGF muDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::TreePath<2> > Phi2SubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::StaticTreePath<2> > Phi2SubGFS; Phi2SubGFS phi2SubGfs; typedef Dune::PDELab::DiscreteGridFunction<Phi2SubGFS,CH_V> Phi2DGF; Phi2DGF phi2Dgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::TreePath<3> > Mu2SubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::StaticTreePath<3> > Mu2SubGFS; Mu2SubGFS mu2SubGfs; typedef Dune::PDELab::DiscreteGridFunction<Mu2SubGFS,CH_V> Mu2DGF; Mu2DGF mu2Dgf; diff --git a/dune/phasefield/ffs_chns_r.hh b/dune/phasefield/ffs_chns_r.hh index 0f8a811b181566deb4ca75aec49d52efcfc0ab58..aedd84aec85418942bf137b17e4c8585e9f30133 100644 --- a/dune/phasefield/ffs_chns_r.hh +++ b/dune/phasefield/ffs_chns_r.hh @@ -156,37 +156,37 @@ class DGF_ffs_chns_r { public: - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::TreePath<0> > VSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::StaticTreePath<0> > VSubGFS; VSubGFS vSubGfs; typedef Dune::PDELab::VectorDiscreteGridFunction<VSubGFS,NS_V> VDGF; VDGF vDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::TreePath<1> > PSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::StaticTreePath<1> > PSubGFS; PSubGFS pSubGfs; typedef Dune::PDELab::DiscreteGridFunction<PSubGFS,NS_V> PDGF; PDGF pDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::TreePath<0> > PhiSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::StaticTreePath<0> > PhiSubGFS; PhiSubGFS phiSubGfs; typedef Dune::PDELab::DiscreteGridFunction<PhiSubGFS,CH_V> PhiDGF; PhiDGF phiDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::TreePath<1> > MuSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::StaticTreePath<1> > MuSubGFS; MuSubGFS muSubGfs; typedef Dune::PDELab::DiscreteGridFunction<MuSubGFS,CH_V> MuDGF; MuDGF muDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::TreePath<2> > Phi2SubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::StaticTreePath<2> > Phi2SubGFS; Phi2SubGFS phi2SubGfs; typedef Dune::PDELab::DiscreteGridFunction<Phi2SubGFS,CH_V> Phi2DGF; Phi2DGF phi2Dgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::TreePath<3> > Mu2SubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::StaticTreePath<3> > Mu2SubGFS; Mu2SubGFS mu2SubGfs; typedef Dune::PDELab::DiscreteGridFunction<Mu2SubGFS,CH_V> Mu2DGF; Mu2DGF mu2Dgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::TreePath<4> > USubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::StaticTreePath<4> > USubGFS; USubGFS uSubGfs; typedef Dune::PDELab::DiscreteGridFunction<USubGFS,CH_V> UDGF; UDGF uDgf; @@ -236,37 +236,37 @@ class DGF_ffs_chns_r_monolithic { public: - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CHNS,Dune::TypeTree::TreePath<1,0> > VSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CHNS,Dune::TypeTree::StaticTreePath<1,0> > VSubGFS; VSubGFS vSubGfs; typedef Dune::PDELab::VectorDiscreteGridFunction<VSubGFS,CHNS_V> VDGF; VDGF vDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CHNS,Dune::TypeTree::TreePath<1,1> > PSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CHNS,Dune::TypeTree::StaticTreePath<1,1> > PSubGFS; PSubGFS pSubGfs; typedef Dune::PDELab::DiscreteGridFunction<PSubGFS,CHNS_V> PDGF; PDGF pDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CHNS,Dune::TypeTree::TreePath<0,0> > PhiSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CHNS,Dune::TypeTree::StaticTreePath<0,0> > PhiSubGFS; PhiSubGFS phiSubGfs; typedef Dune::PDELab::DiscreteGridFunction<PhiSubGFS,CHNS_V> PhiDGF; PhiDGF phiDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CHNS,Dune::TypeTree::TreePath<0,1> > MuSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CHNS,Dune::TypeTree::StaticTreePath<0,1> > MuSubGFS; MuSubGFS muSubGfs; typedef Dune::PDELab::DiscreteGridFunction<MuSubGFS,CHNS_V> MuDGF; MuDGF muDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CHNS,Dune::TypeTree::TreePath<0,2> > Phi2SubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CHNS,Dune::TypeTree::StaticTreePath<0,2> > Phi2SubGFS; Phi2SubGFS phi2SubGfs; typedef Dune::PDELab::DiscreteGridFunction<Phi2SubGFS,CHNS_V> Phi2DGF; Phi2DGF phi2Dgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CHNS,Dune::TypeTree::TreePath<0,3> > Mu2SubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CHNS,Dune::TypeTree::StaticTreePath<0,3> > Mu2SubGFS; Mu2SubGFS mu2SubGfs; typedef Dune::PDELab::DiscreteGridFunction<Mu2SubGFS,CHNS_V> Mu2DGF; Mu2DGF mu2Dgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CHNS,Dune::TypeTree::TreePath<0,4> > USubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CHNS,Dune::TypeTree::StaticTreePath<0,4> > USubGFS; USubGFS uSubGfs; typedef Dune::PDELab::DiscreteGridFunction<USubGFS,CHNS_V> UDGF; UDGF uDgf; diff --git a/dune/phasefield/fs_chns_r.hh b/dune/phasefield/fs_chns_r.hh index a53113841d5d6cef6fd81a8b1562467346a5f014..89710ef4d108021dd9f69737a215d34420eda31f 100644 --- a/dune/phasefield/fs_chns_r.hh +++ b/dune/phasefield/fs_chns_r.hh @@ -86,27 +86,27 @@ class DGF_fs_chns_r { public: - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::TreePath<0> > VSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::StaticTreePath<0> > VSubGFS; VSubGFS vSubGfs; typedef Dune::PDELab::VectorDiscreteGridFunction<VSubGFS,NS_V> VDGF; VDGF vDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::TreePath<1> > PSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::NS,Dune::TypeTree::StaticTreePath<1> > PSubGFS; PSubGFS pSubGfs; typedef Dune::PDELab::DiscreteGridFunction<PSubGFS,NS_V> PDGF; PDGF pDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::TreePath<0> > PhiSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::StaticTreePath<0> > PhiSubGFS; PhiSubGFS phiSubGfs; typedef Dune::PDELab::DiscreteGridFunction<PhiSubGFS,CH_V> PhiDGF; PhiDGF phiDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::TreePath<1> > MuSubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::StaticTreePath<1> > MuSubGFS; MuSubGFS muSubGfs; typedef Dune::PDELab::DiscreteGridFunction<MuSubGFS,CH_V> MuDGF; MuDGF muDgf; - typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::TreePath<2> > USubGFS; + typedef Dune::PDELab::GridFunctionSubSpace<typename GFS::CH,Dune::TypeTree::StaticTreePath<2> > USubGFS; USubGFS uSubGfs; typedef Dune::PDELab::DiscreteGridFunction<USubGFS,CH_V> UDGF; UDGF uDgf; diff --git a/dune/phasefield/localoperator/fem_ff_chns_cahnhilliard.hh b/dune/phasefield/localoperator/fem_ff_chns_cahnhilliard.hh index b1023899f2a20626fa6c550f6d914efe422adea2..230bab619b774e999e68b8761beeb2e617b5cba1 100644 --- a/dune/phasefield/localoperator/fem_ff_chns_cahnhilliard.hh +++ b/dune/phasefield/localoperator/fem_ff_chns_cahnhilliard.hh @@ -154,7 +154,7 @@ public: r.accumulate(xispace,i,factor*( xi*phi[i] - - 1/param.eps* (param.dw.eval_dConvex(pf)+param.dw.eval_dConcarve(pfOld))*phi[i] + - 1/param.eps* (param.dw.eval_dConvex(pf)+param.dw.eval_dConcave(pfOld))*phi[i] - param.eps/2 * (gradpf*gradphi[i][0]) )); } diff --git a/src/example_2p_cahnhilliard/2p_driver.hh b/src/example_2p_cahnhilliard/2p_driver.hh index 58fa00a3569db4e822440acfe9b59ac7d76c74e2..bec949ed926b1ba65af6a325a5b946aca837dff7 100644 --- a/src/example_2p_cahnhilliard/2p_driver.hh +++ b/src/example_2p_cahnhilliard/2p_driver.hh @@ -6,7 +6,8 @@ #include<iostream> // Dune includes #include<dune/grid/io/file/vtk.hh> -#include<dune/pdelab/newton/newton.hh> +#include<dune/pdelab/backend/istl.hh> +#include<dune/pdelab/solver/newton.hh> #include <dune/phasefield/localoperator/fem_2p_cahnhilliard.hh> #include <dune/phasefield/localoperator/pf_diff_estimator.hh> @@ -104,7 +105,7 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const PHI_FEM& phiFem, Dune::Paramete if( stat != 0 && stat != -1) std::cout << "Error: Cannot create directory " << filename << std::endl; } - auto stationaryvtkwriter = std::make_shared<Dune::SubsamplingVTKWriter<GV> >(gv,0); + auto stationaryvtkwriter = std::make_shared<Dune::SubsamplingVTKWriter<GV> >(gv,Dune::refinementLevels(0)); Dune::VTKSequenceWriter<GV> vtkwriter(stationaryvtkwriter,filename.c_str(),filename.c_str(),""); dgf.addToVTKWriter(vtkwriter); @@ -130,7 +131,7 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const PHI_FEM& phiFem, Dune::Paramete //_________________________________________________________________________________________________________________________ printVector(chV,10,"chV"); - + vtkwriter.write(param.time.t,Dune::VTK::ascii); //____________________________________________________________________________________________________________________ @@ -144,10 +145,10 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const PHI_FEM& phiFem, Dune::Paramete // Linear solver typedef ISTLBackend_NOVLP_BASE_PREC_FOR_GMRES - <CH_GO, Dune::SeqILU0, Dune::RestartedGMResSolver> CH_LS; CH_LS ls_ch(chGo,600,200,3,1); + <CH_GO, Dune::SeqILU, Dune::RestartedGMResSolver> CH_LS; CH_LS ls_ch(chGo,600,200,3,1); - typedef Dune::PDELab::Newton<CH_GO,CH_LS,CH_V> PDESolver2; - PDESolver2 ch_newton(chGo,chV,ls_ch); + typedef Dune::PDELab::NewtonMethod<CH_GO, CH_LS> PDESolver2; + PDESolver2 ch_newton(chGo, ls_ch); ch_newton.setParameters(ptree.sub("Phasefield_Newton")); //_________________________________________________________________________________________________________________________ @@ -155,7 +156,7 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const PHI_FEM& phiFem, Dune::Paramete interpolateToBdry_CH(gfs,initial.iniCH, chV); - int result = timestepManager.doOnlyCHTimestep(ch_newton,vtkwriter); + int result = timestepManager.doOnlyCHTimestep(ch_newton,vtkwriter,chV); if(result <0) { return; diff --git a/src/example_2p_cahnhilliard_navierstokes/2p_driver.hh b/src/example_2p_cahnhilliard_navierstokes/2p_driver.hh index b8302da24f9554bd115cb5a86f327f1a104e023a..daa0afd952aadbaf744033fdc35e555cb504c7fc 100644 --- a/src/example_2p_cahnhilliard_navierstokes/2p_driver.hh +++ b/src/example_2p_cahnhilliard_navierstokes/2p_driver.hh @@ -6,7 +6,8 @@ #include<iostream> // Dune includes #include<dune/grid/io/file/vtk.hh> -#include<dune/pdelab/newton/newton.hh> +#include<dune/pdelab/backend/istl.hh> +#include<dune/pdelab/solver/newton.hh> #include <dune/phasefield/localoperator/fem_ff_chns_cahnhilliard.hh> #include <dune/phasefield/localoperator/fem_ff_chns_navierstokes.hh> @@ -105,7 +106,7 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const V_FEM& vFem, const P_FEM pFem, if( stat != 0 && stat != -1) std::cout << "Error: Cannot create directory " << filename << std::endl; } - auto stationaryvtkwriter = std::make_shared<Dune::SubsamplingVTKWriter<GV> >(gv,0); + auto stationaryvtkwriter = std::make_shared<Dune::SubsamplingVTKWriter<GV> >(gv,Dune::refinementLevels(0)); Dune::VTKSequenceWriter<GV> vtkwriter(stationaryvtkwriter,filename.c_str(),filename.c_str(),""); dgf.addToVTKWriter(vtkwriter); @@ -134,7 +135,7 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const V_FEM& vFem, const P_FEM pFem, printVector(chV,10,"chV"); printVector(nsV,10,"nsV"); vtkwriter.write(param.time.t,Dune::VTK::ascii); - + //____________________________________________________________________________________________________________________ chVOld = chV; nsVOld = nsV; @@ -150,28 +151,27 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const V_FEM& vFem, const P_FEM pFem, // Linear solver typedef ISTLBackend_NOVLP_BASE_PREC_FOR_GMRES - <CH_GO, Dune::SeqILU0, Dune::RestartedGMResSolver> CH_LS; CH_LS ls_ch(chGo,600,200,3,1); + <CH_GO, Dune::SeqILU, Dune::RestartedGMResSolver> CH_LS; CH_LS ls_ch(chGo,600,200,3,1); typedef ISTLBackend_NOVLP_BASE_PREC_FOR_GMRES - <NS_GO, Dune::SeqILU0, Dune::RestartedGMResSolver> NS_LS; NS_LS ls_ns(nsGo,1000,200,3,1); + <NS_GO, Dune::SeqILU, Dune::RestartedGMResSolver> NS_LS; NS_LS ls_ns(nsGo,1000,200,3,1); // Nonlinear solver - typedef Dune::PDELab::Newton<NS_GO,NS_LS,NS_V> PDESolver1; - PDESolver1 ns_newton(nsGo,nsV,ls_ns); + typedef Dune::PDELab::NewtonMethod<NS_GO, NS_LS> PDESolver1; + PDESolver1 ns_newton(nsGo, ls_ns); ns_newton.setParameters(ptree.sub("NS_Newton")); - typedef Dune::PDELab::Newton<CH_GO,CH_LS,CH_V> PDESolver2; - PDESolver2 ch_newton(chGo,chV,ls_ch); + typedef Dune::PDELab::NewtonMethod<CH_GO, CH_LS> PDESolver2; + PDESolver2 ch_newton(chGo, ls_ch); ch_newton.setParameters(ptree.sub("Phasefield_Newton")); - //_________________________________________________________________________________________________________________________ // do time step interpolateToBdry(gfs,initial.iniNS,initial.iniCH,nsV,chV); - int result = timestepManager.doTimestep(ns_newton,ch_newton,vtkwriter); + int result = timestepManager.doTimestep(ns_newton,ch_newton,vtkwriter,nsV,chV); if(result <0) { return; diff --git a/src/example_2p_fs/2p_driver.hh b/src/example_2p_fs/2p_driver.hh index d4465a31581797bd7c38457d67a298fb3c48c0d8..25308abc858ba250e70f2ab1e68fd1e2aee32d63 100644 --- a/src/example_2p_fs/2p_driver.hh +++ b/src/example_2p_fs/2p_driver.hh @@ -6,7 +6,8 @@ #include<iostream> // Dune includes #include<dune/grid/io/file/vtk.hh> -#include<dune/pdelab/newton/newton.hh> +#include<dune/pdelab/backend/istl.hh> +#include<dune/pdelab/solver/newton.hh> #include <dune/phasefield/localoperator/fem_fs_chns_cahnhilliard.hh> #include <dune/phasefield/localoperator/fem_fs_chns_navierstokes.hh> @@ -50,7 +51,7 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const V_FEM& vFem, const P_FEM pFem, //_________________________________________________________________________________________________________________________ //Constraints - typedef Bdry_ff_chns< + typedef Bdry_ff_chns< 2, Dune::PDELab::DirichletConstraintsParameters, // v_x, v_y Dune::PDELab::NoDirichletConstraintsParameters, // p Dune::PDELab::NoDirichletConstraintsParameters, // phi @@ -75,7 +76,7 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const V_FEM& vFem, const P_FEM pFem, ZeroInitial<GV,RF,Parameters>, //p PhiInitial_Sphere<GV,RF,Parameters>, //phi ZeroInitial<GV,RF,Parameters> //mu - > Initial; + > Initial; Initial initial(gv, param); Dune::PDELab::interpolate(initial.iniCH, gfs.ch, chV); Dune::PDELab::interpolate(initial.iniNS, gfs.ns, nsV); @@ -112,7 +113,7 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const V_FEM& vFem, const P_FEM pFem, if( stat != 0 && stat != -1) std::cout << "Error: Cannot create directory " << filename << std::endl; } - auto stationaryvtkwriter = std::make_shared<Dune::SubsamplingVTKWriter<GV>>(gv, 0); + auto stationaryvtkwriter = std::make_shared<Dune::SubsamplingVTKWriter<GV>>(gv, Dune::refinementLevels(0)); Dune::VTKSequenceWriter<GV> vtkwriter(stationaryvtkwriter, filename.c_str(), filename.c_str(), ""); dgf.addToVTKWriter(vtkwriter); @@ -155,20 +156,24 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const V_FEM& vFem, const P_FEM pFem, typedef Dune::PDELab::GridOperator<CH_GFS, CH_GFS, CH_LOP, MBE, RF, RF, RF, typename GFS::CH_CC, typename GFS::CH_CC> CH_GO; CH_GO chGo(gfs.ch, gfs.chCC, gfs.ch, gfs.chCC, chLop, mbe); + + //typedef Dune::PDELab::ISTLBackend_SEQ_GMRES_ILU0 CH_LS; CH_LS ls_ch(200, 600, 1); + //typedef Dune::PDELab::ISTLBackend_SEQ_GMRES_ILU0 NS_LS; NS_LS ls_ns(200, 1000, 1); + // Linear solver typedef ISTLBackend_NOVLP_BASE_PREC_FOR_GMRES - <CH_GO, Dune::SeqILU0, Dune::RestartedFlexibleGMResSolver> CH_LS; CH_LS ls_ch(chGo, 600, 200, 3, 1); + <CH_GO, Dune::SeqILU, Dune::RestartedGMResSolver> CH_LS; CH_LS ls_ch(chGo, 600, 200, 3, 1); typedef ISTLBackend_NOVLP_BASE_PREC_FOR_GMRES - <NS_GO, Dune::SeqILU0, Dune::RestartedFlexibleGMResSolver> NS_LS; NS_LS ls_ns(nsGo, 1000, 200, 3, 1); + <NS_GO, Dune::SeqILU, Dune::RestartedGMResSolver> NS_LS; NS_LS ls_ns(nsGo, 1000, 200, 3, 1); // Nonlinear solver - typedef Dune::PDELab::Newton<NS_GO, NS_LS, NS_V> PDESolver1; - PDESolver1 ns_newton(nsGo, nsV, ls_ns); + typedef Dune::PDELab::NewtonMethod<NS_GO, NS_LS> PDESolver1; + PDESolver1 ns_newton(nsGo, ls_ns); ns_newton.setParameters(ptree.sub("NS_Newton")); - typedef Dune::PDELab::Newton<CH_GO, CH_LS, CH_V> PDESolver2; - PDESolver2 ch_newton(chGo, chV, ls_ch); + typedef Dune::PDELab::NewtonMethod<CH_GO, CH_LS> PDESolver2; + PDESolver2 ch_newton(chGo, ls_ch); ch_newton.setParameters(ptree.sub("Phasefield_Newton")); diff --git a/src/example_2p_fs_monolithic/2p_driver.hh b/src/example_2p_fs_monolithic/2p_driver.hh index 07833bd1126fff02c8cb0c3ef0789938c7e0a88b..057701e15dd609cee771ab97025645ea1b3ea018 100644 --- a/src/example_2p_fs_monolithic/2p_driver.hh +++ b/src/example_2p_fs_monolithic/2p_driver.hh @@ -6,7 +6,8 @@ #include<iostream> // Dune includes #include<dune/grid/io/file/vtk.hh> -#include<dune/pdelab/newton/newton.hh> +#include<dune/pdelab/backend/istl.hh> +#include<dune/pdelab/solver/newton.hh> #include <dune/phasefield/localoperator/fem_fs_chns_monolithic.hh> #include <dune/phasefield/localoperator/pf_diff_estimator_monolithic.hh> @@ -48,7 +49,7 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const V_FEM& vFem, const P_FEM pFem, //_________________________________________________________________________________________________________________________ //Constraints - typedef Bdry_ff_chns_monolithic< + typedef Bdry_ff_chns_monolithic< 2, Dune::PDELab::DirichletConstraintsParameters, // v_x, v_y Dune::PDELab::NoDirichletConstraintsParameters, // p Dune::PDELab::NoDirichletConstraintsParameters, // phi @@ -71,7 +72,7 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const V_FEM& vFem, const P_FEM pFem, ZeroInitial<GV,RF,Parameters>, // p PhiInitial_Sphere<GV,RF,Parameters>, // phi ZeroInitial<GV,RF,Parameters> // mu - > Initial; + > Initial; Initial initial(gv, param); Dune::PDELab::interpolate(initial.iniCHNS, gfs.chns, chnsV); CHNS_V chnsVOld = chnsV; @@ -103,7 +104,7 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const V_FEM& vFem, const P_FEM pFem, if( stat != 0 && stat != -1) std::cout << "Error: Cannot create directory " << filename << std::endl; } - auto stationaryvtkwriter = std::make_shared<Dune::SubsamplingVTKWriter<GV>>(gv, 0); + auto stationaryvtkwriter = std::make_shared<Dune::SubsamplingVTKWriter<GV>>(gv, Dune::refinementLevels(0)); Dune::VTKSequenceWriter<GV> vtkwriter(stationaryvtkwriter, filename.c_str(), filename.c_str(), ""); dgf.addToVTKWriter(vtkwriter); @@ -142,11 +143,11 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const V_FEM& vFem, const P_FEM pFem, // Linear solver typedef ISTLBackend_NOVLP_BASE_PREC_FOR_GMRES - <CHNS_GO, Dune::SeqILU0, Dune::RestartedGMResSolver> CHNS_LS; CHNS_LS ls_chns(chnsGo, 1200, 200, 3, 1); + <CHNS_GO, Dune::SeqILU, Dune::RestartedGMResSolver> CHNS_LS; CHNS_LS ls_chns(chnsGo, 1200, 200, 3, 1); // Nonlinear solver - typedef Dune::PDELab::Newton<CHNS_GO, CHNS_LS, CHNS_V> PDESolver; - PDESolver chns_newton(chnsGo, chnsV, ls_chns); + typedef Dune::PDELab::NewtonMethod<CHNS_GO, CHNS_LS> PDESolver; + PDESolver chns_newton(chnsGo, ls_chns); chns_newton.setParameters(ptree.sub("CHNS_Newton")); @@ -156,7 +157,7 @@ void driver_2p(Grid& grid, GV& gv, ES& es, const V_FEM& vFem, const P_FEM pFem, interpolateToBdry_monolithic(gfs, initial.iniCHNS, chnsV); - int result = timestepManager.doMonolithicTimestep(chns_newton, vtkwriter); + int result = timestepManager.doMonolithicTimestep(chns_newton, vtkwriter, chnsV); if(result < 0) { diff --git a/src/example_3p_ffs_monolithic/3p_driver.hh b/src/example_3p_ffs_monolithic/3p_driver.hh index b42f10dfae053aebaafbf62860dcf2ae561373b0..89364a99af81e0d05e58d3fe414c7539d7b476fb 100644 --- a/src/example_3p_ffs_monolithic/3p_driver.hh +++ b/src/example_3p_ffs_monolithic/3p_driver.hh @@ -6,7 +6,8 @@ #include<iostream> // Dune includes #include<dune/grid/io/file/vtk.hh> -#include<dune/pdelab/newton/newton.hh> +#include<dune/pdelab/backend/istl.hh> +#include<dune/pdelab/solver/newton.hh> #include <dune/phasefield/localoperator/fem_ffs_chns_r_monolithic.hh> #include <dune/phasefield/localoperator/chns_monolithic_diff_estimator.hh> @@ -112,7 +113,7 @@ void driver_3p(Grid& grid, GV& gv, ES& es, const V_FEM& vFem, const P_FEM pFem, if( stat != 0 && stat != -1) std::cout << "Error: Cannot create directory " << filename << std::endl; } - auto stationaryvtkwriter = std::make_shared<Dune::SubsamplingVTKWriter<GV> >(gv,0); + auto stationaryvtkwriter = std::make_shared<Dune::SubsamplingVTKWriter<GV> >(gv,Dune::refinementLevels(0)); Dune::VTKSequenceWriter<GV> vtkwriter(stationaryvtkwriter,filename.c_str(),filename.c_str(),""); dgf.addToVTKWriter(vtkwriter); @@ -150,13 +151,12 @@ void driver_3p(Grid& grid, GV& gv, ES& es, const V_FEM& vFem, const P_FEM pFem, // Linear solver typedef ISTLBackend_NOVLP_BASE_PREC_FOR_GMRES - <CHNS_GO, Dune::SeqILU0, Dune::RestartedGMResSolver> CHNS_LS; CHNS_LS ls_chns(chnsGo,1200,200,3,1); + <CHNS_GO, Dune::SeqILU, Dune::RestartedGMResSolver> CHNS_LS; CHNS_LS ls_chns(chnsGo,1200,200,3,1); // Nonlinear solver - typedef Dune::PDELab::Newton<CHNS_GO,CHNS_LS,CHNS_V> PDESolver1; - PDESolver1 chns_newton(chnsGo,chnsV,ls_chns); - chns_newton.setParameters(ptree.sub("NS_Newton")); - + typedef Dune::PDELab::NewtonMethod<CHNS_GO, CHNS_LS> PDESolver1; + PDESolver1 chns_newton(chnsGo, ls_chns); + chns_newton.setParameters(ptree.sub("CHNS_Newton")); //_________________________________________________________________________________________________________________________ @@ -164,7 +164,7 @@ void driver_3p(Grid& grid, GV& gv, ES& es, const V_FEM& vFem, const P_FEM pFem, interpolateToBdry_monolithic(gfs,initial.iniCHNS, chnsV); - int result = timestepManager.doOnlyNSTimestep(chns_newton,vtkwriter); + int result = timestepManager.doOnlyNSTimestep(chns_newton,vtkwriter,chnsV); if(result <0) { return;