From 65d33876814419199cd9cc36f5c5bbf40d2388eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katharina=20T=C3=BCrk?= <kt@katharina-tuerk.de> Date: Thu, 21 Nov 2013 10:58:46 +0000 Subject: [PATCH] Work on documentation of files in folder multidomain Reviewed by Klaus git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@12043 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- .../common/multidomainassembler.hh | 53 ++++++++++++++++--- .../common/multidomainconvergencewriter.hh | 27 +++++++++- .../common/multidomainlocaloperator.hh | 38 +++++++++++++ dumux/multidomain/common/multidomainmodel.hh | 21 ++++++++ .../common/multidomainnewtoncontroller.hh | 44 +++++++++++++-- .../multidomain/common/multidomainproblem.hh | 21 +++++++- .../common/multidomainproperties.hh | 3 ++ .../common/multidomainpropertydefaults.hh | 8 +++ .../multidomain/common/pdelablocaloperator.hh | 21 ++++++-- dumux/multidomain/common/splitandmerge.hh | 4 ++ .../multidomain/common/subdomainproperties.hh | 3 ++ .../common/subdomainpropertydefaults.hh | 3 ++ 12 files changed, 228 insertions(+), 18 deletions(-) diff --git a/dumux/multidomain/common/multidomainassembler.hh b/dumux/multidomain/common/multidomainassembler.hh index d335d3cf3d..f13300fb75 100644 --- a/dumux/multidomain/common/multidomainassembler.hh +++ b/dumux/multidomain/common/multidomainassembler.hh @@ -16,6 +16,10 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ +/* +*\ brief docme +*/ + #ifndef DUMUX_MULTIDOMAIN_ASSEMBLER_HH #define DUMUX_MULTIDOMAIN_ASSEMBLER_HH @@ -24,9 +28,17 @@ #include <dune/pdelab/constraints/constraintsparameters.hh> #include <dune/pdelab/multidomain/constraints.hh> +/* + * \brief docme + */ namespace Dumux { //! Prevents the setting of a dirichlet constraint anywhere + +/* + * \brief docme + */ + struct NoDirichletConstraints : public Dune::PDELab::DirichletConstraintsParameters { @@ -36,6 +48,9 @@ struct NoDirichletConstraints : return false; } }; +/* + * \brief docme + */ template<class TypeTag> class MultiDomainAssembler @@ -80,6 +95,9 @@ class MultiDomainAssembler // copying the jacobian assembler is not a good idea MultiDomainAssembler(const MultiDomainAssembler &); +/* +* \brief docme +*/ public: MultiDomainAssembler() { @@ -180,27 +198,50 @@ public: // printvector(std::cout, residual_, "residual", "row", 200, 1, 3); } - //! return const reference to matrix + /* + * \brief docme + * + * \return const reference to matrix + */ const JacobianMatrix &matrix() const { return *matrix_; } - //! return reference to matrix - // This is not very nice, but required for the AMG solver + + /* + * \brief docme + * + * This is not very nice, but required for the AMG solver + * + * \return const reference to matrix + */ JacobianMatrix &matrix() { return *matrix_; } - //! return const reference to residual + /* + * \brief docme + * \return const reference to residual + */ + const SolutionVector &residual() const { return residual_; } SolutionVector &residual() { return residual_; } - //! return the multidomain gridfunctionspace + /* + * \brief docme + * \return the multidomain gridfunctionspace + */ + + MultiDomainGridFunctionSpace &gridFunctionSpace() const { return *mdGridFunctionSpace_; } MultiDomainGridFunctionSpace &mdGridFunctionSpace() const { return *mdGridFunctionSpace_; } - //! return the multidomain constraints trafo + /* + * \brief docme + * \ return the multidomain constraints trafo + */ + MultiDomainConstraintsTrafo &constraintsTrafo() const { return *constraintsTrafo_; } diff --git a/dumux/multidomain/common/multidomainconvergencewriter.hh b/dumux/multidomain/common/multidomainconvergencewriter.hh index 8e328bebfc..f30b78a747 100644 --- a/dumux/multidomain/common/multidomainconvergencewriter.hh +++ b/dumux/multidomain/common/multidomainconvergencewriter.hh @@ -61,6 +61,11 @@ struct MultiDomainConvergenceWriter typedef Dumux::VtkMultiWriter<GridView1> VtkMultiWriter1; typedef Dumux::VtkMultiWriter<GridView2> VtkMultiWriter2; + /* + * \brief docme + * \param ctl docme + */ + MultiDomainConvergenceWriter(NewtonController &ctl) : ctl_(ctl) { @@ -75,6 +80,9 @@ struct MultiDomainConvergenceWriter delete vtkMultiWriter1_; delete vtkMultiWriter2_; }; + /* + * \brief docme + */ void beginTimestep() { @@ -86,7 +94,11 @@ struct MultiDomainConvergenceWriter if (!vtkMultiWriter2_) vtkMultiWriter2_ = new VtkMultiWriter2(problem_().subProblem2().gridView(), "convergence2"); }; - + /* + * \brief docme + * \param gridView1 docme + * \param gridView2 docme + */ void beginIteration(const GridView1 &gridView1, const GridView2 &gridView2) { @@ -95,6 +107,12 @@ struct MultiDomainConvergenceWriter vtkMultiWriter2_->beginWrite(timeStepIndex_ + iteration_ / 100.0); }; + /* + * \brief docme + * \param uLastIter docme + * \param deltaU docme + */ + void writeFields(const SolutionVector &uLastIter, const SolutionVector &deltaU) { @@ -118,6 +136,9 @@ struct MultiDomainConvergenceWriter ctl_.method().model().subModel1().addConvergenceVtkFields(*vtkMultiWriter1_, uLastIter1, deltaU1); ctl_.method().model().subModel2().addConvergenceVtkFields(*vtkMultiWriter2_, uLastIter2, deltaU2); }; + /* + * \brief docme + */ void endIteration() { @@ -125,6 +146,10 @@ struct MultiDomainConvergenceWriter vtkMultiWriter2_->endWrite(); }; + /* + * \brief docme + */ + void endTimestep() { ++timeStepIndex_; diff --git a/dumux/multidomain/common/multidomainlocaloperator.hh b/dumux/multidomain/common/multidomainlocaloperator.hh index b7046f8028..a7f0a59838 100644 --- a/dumux/multidomain/common/multidomainlocaloperator.hh +++ b/dumux/multidomain/common/multidomainlocaloperator.hh @@ -16,6 +16,12 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ + +/* + * \file + * \brief docme + */ + #ifndef DUMUX_MULTIDOMAIN_LOCAL_OPERATOR_HH #define DUMUX_MULTIDOMAIN_LOCAL_OPERATOR_HH @@ -24,13 +30,29 @@ #include <dumux/implicit/box/boxproperties.hh> +/* + * \brief docme + */ namespace Dumux { +/* + * \brief docme + */ + namespace PDELab { +/* + * \brief docme + */ + template<class TypeTag> class MultiDomainLocalOperator + : +/* +* \brief docme +*/ + public Dune::PDELab::FullVolumePattern, public Dune::PDELab::LocalOperatorDefaultFlags { @@ -42,6 +64,10 @@ public Dune::PDELab::LocalOperatorDefaultFlags typedef typename Grid::Traits::template Codim<0>::EntityPointer EntityPointer; enum{numEq = GET_PROP_VALUE(TypeTag, NumEq)}; +/* +* \brief docme +* \param model docme +*/ public: // pattern assembly flags @@ -57,6 +83,12 @@ public: /*! * \brief Volume integral depending on test and ansatz functions * + * \tparam EG docme + * \tparam LFSU docme + * \tparam X docme + * \tparam LFSV docme + * \tparam R docme + * * \param eg docme * \param lfsu docme * \param x docme @@ -81,6 +113,12 @@ public: /*! * \brief Jacobian of volume term * + * \tparam EG docme + * \tparam LFSU docme + * \tparam X docme + * \tparam LFSV docme + * \tparam M docme + * * \param eg docme * \param lfsu docme, is basis * \param x docme diff --git a/dumux/multidomain/common/multidomainmodel.hh b/dumux/multidomain/common/multidomainmodel.hh index 40c46bb53a..db7328b052 100644 --- a/dumux/multidomain/common/multidomainmodel.hh +++ b/dumux/multidomain/common/multidomainmodel.hh @@ -16,6 +16,12 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ + +/* + * \file +* \brief docme +*/ + #ifndef DUMUX_MULTIDOMAIN_MODEL_HH #define DUMUX_MULTIDOMAIN_MODEL_HH @@ -25,6 +31,10 @@ #include "multidomainnewtoncontroller.hh" //#include "coupledjacobianassembler.hh" +/* +* \brief docme +*/ + namespace Dumux { @@ -39,6 +49,11 @@ namespace Dumux * \brief The base class of models which consist of two arbitrary * sub-models which are coupled */ + +/* +* \brief docme +*/ + template<class TypeTag> class MultiDomainModel { @@ -98,6 +113,12 @@ public: uPrev_); } + /* + * \brief docme + * \param u docme + * \param tmp docme + */ + Scalar globalResidual(const SolutionVector &u, SolutionVector &tmp) { DUNE_THROW(Dune::NotImplemented, ""); diff --git a/dumux/multidomain/common/multidomainnewtoncontroller.hh b/dumux/multidomain/common/multidomainnewtoncontroller.hh index 071fa7d408..2049f0597d 100644 --- a/dumux/multidomain/common/multidomainnewtoncontroller.hh +++ b/dumux/multidomain/common/multidomainnewtoncontroller.hh @@ -43,7 +43,6 @@ #include "multidomainconvergencewriter.hh" /*! - * \file * \brief Additional properties required for the coupled Newton controller */ namespace Dumux @@ -51,6 +50,10 @@ namespace Dumux template <class TypeTag> class MultiDomainNewtonController; +/* +* \brief docme +*/ + namespace Properties { @@ -128,6 +131,11 @@ class MultiDomainNewtonController typedef MultiDomainConvergenceWriter<TypeTag> ConvergenceWriter; typedef typename GET_PROP_TYPE(TypeTag, LinearSolver) LinearSolver; +/* +* \brief docme +* \param problem docme +*/ + public: MultiDomainNewtonController(const Problem &problem) : endIterMsgStream_(std::ostringstream::out) @@ -204,6 +212,7 @@ public: /*! * \brief Set the number of iterations after which the Newton * method gives up. + * \param maxSteps docme */ void setMaxSteps(int maxSteps) { maxSteps_ = maxSteps; } @@ -324,6 +333,12 @@ public: int converged = linearSolver_.solve(A, x, b); // make sure all processes converged +/* +* \brief docme +* \param convergedSend docme +* \param converged docme +*/ + #if HAVE_MPI int convergedSend = 1; MPI_Allreduce(/*sendBuf=*/&convergedSend, @@ -340,6 +355,12 @@ public: } catch (const Dune::MatrixBlockError &e) { // make sure all processes converged +/* +* \brief docme +* \param convergedSend docme +* \param converged docme +*/ + #if HAVE_MPI int convergedSend = 0; int converged; @@ -361,6 +382,13 @@ public: } catch (const Dune::Exception &e) { // make sure all processes converged + +/* +* \brief docme +* \param convergedSend docme +* \param converged docme +*/ + #if HAVE_MPI int convergedSend = 0; int converged; @@ -560,21 +588,27 @@ public: /*! * \brief the coupled problem + * + * \returns the actual implementation for the controller we do + * \it this way in order to allow "poor man's virtual methods", + * \i.e. methods of subclasses which can be called by the base + *\class. */ Problem &problem_() { return method_->problem(); } const Problem &problem_() const { return method_->problem(); } - // returns the actual implementation for the controller we do - // it this way in order to allow "poor man's virtual methods", - // i.e. methods of subclasses which can be called by the base - // class. + Implementation &asImp_() { return *static_cast<Implementation*>(this); } const Implementation &asImp_() const { return *static_cast<const Implementation*>(this); } + /* + * \brief docme + */ + bool verbose_; std::ostringstream endIterMsgStream_; diff --git a/dumux/multidomain/common/multidomainproblem.hh b/dumux/multidomain/common/multidomainproblem.hh index 42bb19ef52..7b48f754dd 100644 --- a/dumux/multidomain/common/multidomainproblem.hh +++ b/dumux/multidomain/common/multidomainproblem.hh @@ -20,6 +20,7 @@ * \file * \brief Base class for problems which involve two sub problems */ + #ifndef DUMUX_MULTIDOMAIN_PROBLEM_HH #define DUMUX_MULTIDOMAIN_PROBLEM_HH @@ -32,6 +33,10 @@ #include <dumux/io/vtkmultiwriter.hh> #include <dumux/io/restart.hh> +/* +* \brief docme +*/ + namespace Dumux { @@ -39,7 +44,7 @@ namespace Dumux * \ingroup ModelCoupling * \brief Base class for problems which involve two sub problems * - * \todo Please doc me more! + * \todo Please docme more! */ template<class TypeTag> class MultiDomainProblem @@ -152,6 +157,7 @@ public: /*! * \brief Serialize the simulation's state to disk */ + void serialize() { typedef Dumux::Restart Restarter; @@ -171,6 +177,7 @@ public: * \param tRestart The simulation time on which the program was * written to disk. */ + void restart(Scalar tRestart) { typedef Dumux::Restart Restarter; @@ -192,6 +199,7 @@ public: * * It is the inverse of the serialize() method. */ + template <class Restarter> void deserialize(Restarter &res) { @@ -358,6 +366,7 @@ public: * It could be either overwritten by the problem files, or simply * declared over the setName() function in the application file. */ + const char *name() const { return simname_.c_str(); @@ -528,28 +537,36 @@ public: /*! * \brief Returns a pointer to the subdomain1 element + * \param mdElement1 docme */ SDElementPointer sdElementPointer1(const MDElement& mdElement1) { return mdGrid().subDomain(subID1_).subDomainEntityPointer(mdElement1); } /*! * \brief Returns a pointer to the subdomain2 element + * + * \param mdElement2 docme */ SDElementPointer sdElementPointer2(const MDElement& mdElement2) { return mdGrid().subDomain(subID2_).subDomainEntityPointer(mdElement2); } /*! * \brief Provides a vertex mapper for the multidomain + * */ VertexMapper& mdVertexMapper() { return *mdVertexMapper_; } protected: + /* + * \brief docme + * \Returns the implementation of the problem (i.e. static polymorphism) + */ void initMortarElements() {} - //! Returns the implementation of the problem (i.e. static polymorphism) + Implementation &asImp_() { return *static_cast<Implementation *>(this); } diff --git a/dumux/multidomain/common/multidomainproperties.hh b/dumux/multidomain/common/multidomainproperties.hh index c76609f764..5774aceed5 100644 --- a/dumux/multidomain/common/multidomainproperties.hh +++ b/dumux/multidomain/common/multidomainproperties.hh @@ -32,6 +32,9 @@ */ namespace Dumux { +/* +* \brief docme +*/ namespace Properties { /*! diff --git a/dumux/multidomain/common/multidomainpropertydefaults.hh b/dumux/multidomain/common/multidomainpropertydefaults.hh index aaaed99be6..c0a4ba3b2f 100644 --- a/dumux/multidomain/common/multidomainpropertydefaults.hh +++ b/dumux/multidomain/common/multidomainpropertydefaults.hh @@ -20,6 +20,7 @@ * \file * \brief Sets default values for the MultiDomain properties */ + #ifndef DUMUX_MULTIDOMAIN_PROPERTY_DEFAULTS_HH #define DUMUX_MULTIDOMAIN_PROPERTY_DEFAULTS_HH @@ -48,6 +49,9 @@ #include <dumux/nonlinear/newtonmethod.hh> #include <dumux/common/timemanager.hh> +/* +* \brief docme +*/ namespace Dumux { @@ -55,6 +59,10 @@ template <class TypeTag> class MultiDomainModel; template <class TypeTag> class MultiDomainJacobianAssembler; template <class TypeTag> class MultiDomainNewtonController; +/* +* \brief docme +*/ + namespace Properties { diff --git a/dumux/multidomain/common/pdelablocaloperator.hh b/dumux/multidomain/common/pdelablocaloperator.hh index 1c061e5170..92c234fbbc 100644 --- a/dumux/multidomain/common/pdelablocaloperator.hh +++ b/dumux/multidomain/common/pdelablocaloperator.hh @@ -1,5 +1,6 @@ /***************************************************************************** - * Copyright (C) 2009-2010 by Bernd Flemisch * + * Copyright (C) 2009-2010 by Bernd Flemisch + * * Institute for Modelling Hydraulic and Environmental Systems * * University of Stuttgart, Germany * * email: <givenname>.<name>@iws.uni-stuttgart.de * @@ -19,11 +20,11 @@ *****************************************************************************/ /*! * \file - * * \brief A local operator for PDELab which wraps the box models. */ -#ifndef DUMUX_PDELAB_BOX_LOCAL_OPERATOR_HH -#define DUMUX_PDELAB_BOX_LOCAL_OPERATOR_HH + +#ifndef DUMUX_PDELAB_LOCAL_OPERATOR_HH +#define DUMUX_PDELAB_LOCAL_OPERATOR_HH #if ! HAVE_DUNE_PDELAB #error "DUNE-PDELab must be available in order to include this file!" @@ -34,8 +35,16 @@ #include <dumux/implicit/box/boxproperties.hh> +/* +* \brief docme +*/ + namespace Dumux { +/* +* \brief docme +*/ + namespace PDELab { /*! @@ -55,6 +64,10 @@ class BoxLocalOperator typedef typename GET_PROP_TYPE(TypeTag, Model) Model; enum{numEq = GET_PROP_VALUE(TypeTag, NumEq)}; +/* +* \brief docme +*/ + public: // pattern assembly flags enum { doPatternVolume = true }; diff --git a/dumux/multidomain/common/splitandmerge.hh b/dumux/multidomain/common/splitandmerge.hh index b9b2a92fed..eef57e554c 100644 --- a/dumux/multidomain/common/splitandmerge.hh +++ b/dumux/multidomain/common/splitandmerge.hh @@ -26,6 +26,10 @@ #include "multidomainproperties.hh" #include <dumux/common/valgrind.hh> +/* +* \brief docme +*/ + namespace Dumux { /*! diff --git a/dumux/multidomain/common/subdomainproperties.hh b/dumux/multidomain/common/subdomainproperties.hh index 6fe46edaf1..55890fec31 100644 --- a/dumux/multidomain/common/subdomainproperties.hh +++ b/dumux/multidomain/common/subdomainproperties.hh @@ -25,6 +25,9 @@ */ namespace Dumux { +/* +* \brief docme +*/ namespace Properties { /*! diff --git a/dumux/multidomain/common/subdomainpropertydefaults.hh b/dumux/multidomain/common/subdomainpropertydefaults.hh index 5a8c4ba48e..9a222dcd14 100644 --- a/dumux/multidomain/common/subdomainpropertydefaults.hh +++ b/dumux/multidomain/common/subdomainpropertydefaults.hh @@ -35,6 +35,9 @@ */ namespace Dumux { +/* +* \brief docme +*/ namespace Properties { -- GitLab