diff --git a/README.rst b/README.rst index 162439412a78d9fa62ac868e7cace4d5dea48ac4_UkVBRE1FLnJzdA==..0dfd86f4b103b4806a4d30c9cfa244a3ff63a92c_UkVBRE1FLnJzdA== 100644 --- a/README.rst +++ b/README.rst @@ -38,7 +38,7 @@ The development mode is often useful. From the root directory:: - sudo python setup.py develop + python setup.py develop Tests ----- diff --git a/doc/ipynb/tuto_dev.ipynb b/doc/ipynb/tuto_dev.ipynb index 162439412a78d9fa62ac868e7cace4d5dea48ac4_ZG9jL2lweW5iL3R1dG9fZGV2LmlweW5i..0dfd86f4b103b4806a4d30c9cfa244a3ff63a92c_ZG9jL2lweW5iL3R1dG9fZGV2LmlweW5i 100644 --- a/doc/ipynb/tuto_dev.ipynb +++ b/doc/ipynb/tuto_dev.ipynb @@ -165,6 +165,6 @@ ] }, { - "cell_type": "markdown", + "cell_type": "raw", "metadata": {}, "source": [ @@ -169,4 +169,4 @@ "metadata": {}, "source": [ - "The first attribute `InfoSolver` is a class deriving from `ParamContainer`. This class is usually defined in the `solver` module. It is used during the instantiation of the Simul object to produce a `ParamContainer` containing a description of the solver, in practice the names and the modules of the classes used for the different tasks that need to be performed during the simulation.\n", + "The first attribute :class:`InfoSolver` is a class deriving from :class:`ParamContainer`. This class is usually defined in the `solver` module. It is used during the instantiation of the Simul object to produce a :class:`ParamContainer` containing a description of the solver, in practice the names and the modules of the classes used for the different tasks that need to be performed during the simulation.\n", "\n", @@ -172,3 +172,3 @@ "\n", - "There are also four other functions. `compute_freq_diss` and `tendencies_nonlin` are used during the simulation and describe the equations that are solved.\n", + "There are also four other functions. :func:`compute_freq_diss` and :func:`tendencies_nonlin` are used during the simulation and describe the equations that are solved.\n", "\n", @@ -174,5 +174,5 @@ "\n", - "`create_default_params` and `_complete_params_with_default` are used to produce the `ParamContainer` containing the default parameters for a simulation:" + ":func:`create_default_params` and :func:`_complete_params_with_default` are used to produce the `ParamContainer` containing the default parameters for a simulation:" ] }, { @@ -187,6 +187,6 @@ ] }, { - "cell_type": "markdown", + "cell_type": "raw", "metadata": {}, "source": [ @@ -191,6 +191,6 @@ "metadata": {}, "source": [ - "During the creation of `params`, the class `InfoSolver` has been used to create a `ParamContainer` named `info_solver`:" + "During the creation of `params`, the class :class:`InfoSolver` has been used to create a :class:`ParamContainer` named `info_solver`:" ] }, { @@ -299,8 +299,8 @@ ] }, { - "cell_type": "markdown", + "cell_type": "raw", "metadata": {}, "source": [ "We see that this solver uses many classes and that they are organized in tasks (\"Operator\", \"InitFields\", \"TimeStepping\", \"State\", \"Output\", \"Forcing\"). Some first-level classes (for example \"Output\") have second-level classes (\"PrintStdOut\", \"Spectra\", \"PhysFields\", etc.). Such description of a solver is very general. It is also very conveniant to create a new solver from a similar existing solver.\n", "\n", @@ -303,8 +303,8 @@ "metadata": {}, "source": [ "We see that this solver uses many classes and that they are organized in tasks (\"Operator\", \"InitFields\", \"TimeStepping\", \"State\", \"Output\", \"Forcing\"). Some first-level classes (for example \"Output\") have second-level classes (\"PrintStdOut\", \"Spectra\", \"PhysFields\", etc.). Such description of a solver is very general. It is also very conveniant to create a new solver from a similar existing solver.\n", "\n", - "Every classes can have a class function or a static function `_complete_params_with_default` that is called when the object containing the default parameters is created.\n", + "Every classes can have a class function or a static function :func:`_complete_params_with_default` that is called when the object containing the default parameters is created.\n", "\n", "The objects `params` and `Simul.info_solver` are then used to instantiate the simulation (here with the default parameters for the solver):" ] @@ -400,7 +400,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The functions `Simul.compute_freq_diss` and `Simul.tendencies_nonlin` define the solved equations. Looking at the documentation of the solver module :mod:`fluidsim.solvers.ns2d.solver`, we see that `Simul.tendencies_nonlin` is defined in this module and that `Simul.compute_freq_diss` is inherited from the base class :class:`fluidsim.base.solvers.pseudo_spect.SimulBasePseudoSpectral`. By clicking on these links, you can look at the documentation and the sources of these functions. The documentation explains how this function define the solved equations. I think the sources are quite clear and can be understood by anyone knowing a little bit of Python for science. Most of the objects involved in these functions are functions or numpy.ndarray_.\n", + "The functions :func:`Simul.compute_freq_diss` and :func:`Simul.tendencies_nonlin` define the solved equations. Looking at the documentation of the solver module :mod:`fluidsim.solvers.ns2d.solver`, we see that :func:`Simul.tendencies_nonlin` is defined in this module and that :func:`Simul.compute_freq_diss` is inherited from the base class :class:`fluidsim.base.solvers.pseudo_spect.SimulBasePseudoSpectral`. By clicking on these links, you can look at the documentation and the sources of these functions. The documentation explains how this function define the solved equations. I think the sources are quite clear and can be understood by anyone knowing a little bit of Python for science. Most of the objects involved in these functions are functions or numpy.ndarray_.\n", "\n", ".. _numpy.ndarray: http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html" ] @@ -416,5 +416,5 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The `sim.state` object is a :class:`fluidsim.solvers.ns2d.state.StateNS2D`. It contains numpy.ndarray_, actually slightly modified numpy.ndarray_\n", + "`sim.state` is an instance of :class:`fluidsim.solvers.ns2d.state.StateNS2D`. It contains numpy.ndarray_, actually slightly modified numpy.ndarray_ named :class:`fluidsim.base.setofvariables.SetOfVariables`. This class is used to stack variables together in a single numpy.ndarray_.\n", "\n", @@ -420,7 +420,5 @@ "\n", - ":class:`fluidsim.base.setofvariables.SetOfVariables`\n", - "\n", - "The `sim.state` object is also able to other variables. It is an interface hidding the actual way the data are stored." + "The state classes are also able to compute other variables from the state of the simulation. It is an interface hidding the actual way the data are stored." ] }, { @@ -434,7 +432,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The `sim.oper` object is a :class:`fluidsim.operators.operators.OperatorsPseudoSpectral2D`.\n", + "`sim.oper` is an instance of :class:`fluidsim.operators.operators.OperatorsPseudoSpectral2D`.\n", "\n", "It contains the information on the grids (in physical and spectral space) and provides many optimized functions on arrays representing fields on these grids.\n", "\n", @@ -438,7 +436,7 @@ "\n", "It contains the information on the grids (in physical and spectral space) and provides many optimized functions on arrays representing fields on these grids.\n", "\n", - "It has to be fast! It is written in Cython." + "It has to be fast! For the two dimensional Fourier pseudo-spectral solvers, it is written in Cython." ] }, { @@ -452,9 +450,5 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The `sim.time_stepping` object is a :class:`fluidsim.base.time_stepping.pseudo_spect_cy.TimeSteppingPseudoSpectral`.\n", - "\n", - "Loop for time advancement.\n", - "\n", - "Runge-Kutta\n", + "`sim.time_stepping` is an instance of :class:`fluidsim.base.time_stepping.pseudo_spect_cy.TimeSteppingPseudoSpectral`, which is based on :class:`fluidsim.base.time_stepping.pseudo_spect.TimeSteppingPseudoSpectral` and :class:`fluidsim.base.time_stepping.base.TimeSteppingBase`.\n", "\n", @@ -460,3 +454,3 @@ "\n", - "Call `sim.tendencies_nonlin`\n", + "This class contains the functions for the time advancement, i.e. Runge-Kutta functions and the actual loop than increments the time stepping index `sim.time_stepping.it`. The Runge-Kutta functions call the function :func:`sim.tendencies_nonlin` and modify the state in Fourier space `sim.state.state_fft`.\n", "\n", @@ -462,7 +456,5 @@ "\n", - "Modify the state...\n", - "\n", - "Call the output class." + "The loop function also call the function :func:`sim.output.one_time_step`." ] }, { @@ -476,7 +468,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The `sim.output` object is a :class:`fluidsim.solvers.ns2d.output.Output`.\n", + "`sim.output` is an instance of :class:`fluidsim.solvers.ns2d.output.Output`.\n", "\n", "Saving and plotting of anything interesting..." ] @@ -492,5 +484,5 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The `sim.forcing` object is a :class:`fluidsim.solvers.ns2d.forcing.ForcingNS2D`.\n", + "`sim.forcing` is an instance of :class:`fluidsim.solvers.ns2d.forcing.ForcingNS2D`.\n", "\n", @@ -496,5 +488,5 @@ "\n", - "Used by `sim.tendencies_nonlin`\n" + "If `params.FORCING is True`, it is used in :func:`sim.tendencies_nonlin` to add the forcing term." ] } ], @@ -514,7 +506,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", - "version": "2.7.6" + "version": "2.7.9" } }, "nbformat": 4, diff --git a/fluidsim/base/time_stepping/base.py b/fluidsim/base/time_stepping/base.py index 162439412a78d9fa62ac868e7cace4d5dea48ac4_Zmx1aWRzaW0vYmFzZS90aW1lX3N0ZXBwaW5nL2Jhc2UucHk=..0dfd86f4b103b4806a4d30c9cfa244a3ff63a92c_Zmx1aWRzaW0vYmFzZS90aW1lX3N0ZXBwaW5nL2Jhc2UucHk= 100644 --- a/fluidsim/base/time_stepping/base.py +++ b/fluidsim/base/time_stepping/base.py @@ -136,6 +136,7 @@ self.sim.output.end_of_simul(total_time_simul) def one_time_step(self): + """Main time stepping function.""" if self.params.time_stepping.USE_CFL: self._compute_time_increment_CLF() if self.params.FORCING: