Skip to content

Commit

Permalink
review/test/typos
Browse files Browse the repository at this point in the history
  • Loading branch information
albansouche committed Nov 26, 2019
1 parent 8929740 commit d3a2707
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ through the terminal by typing::
$ turtleFSI

followed by any additional options, for instance, which problem to run and the time step size.
Use ``-h`` to see all availeble options. A detailed explanation for usage of turtleFSI can be found
Use ``-h`` to see all available options. A detailed explanation for usage of turtleFSI can be found
`here <https://turtlefsi2.readthedocs.io/en/latest/using_turtleFSI.html>`.


Expand Down
21 changes: 9 additions & 12 deletions docs/source/using_turtleFSI.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,32 @@ To get an overview of all parameters, please run::

Built-in functionality
======================
We have designed turtleFSI to be lightweight and focus around solving the equiations, not additional
functionality. However, we have added two functions: checkpointing/restart, and storing files for visualization.
Two important functions are available in the current version of turtleFSI: checkpointing/restart, and storing files for visualization.

For checkpointing you can set the variable ``--checkpoint-step`` to set how often a checkpoint should
be stored. To restart the from a previous run set ``--restart-folder [folder/sub-folder]``. Note that
be stored. To restart from a previous checkpoint step use the command ``--restart-folder [folder/sub-folder]``. Note that
the variables from the previous simulation will overwrite any parameters set in the ``set_problem_parameters``
or on the commandline. To overwrite any parameters from the previous run, for instance, end time ``T``, you can
use the ``initiate`` function.
or on the commandline. If you need to change a parameter from the previous checkpoint file (for instance, end time ``T``), you can
still do it by explicitly redefining it within the ``initiate`` function.

To set how often you save files for visualization you can set ``--save-step``. Note that the default is ``1``.


Setting parameters
==================
All the the default parameters are set in the ``problem/__init__.py`` file. Problem specific parameters
are then overwritten in the problem file under ``set_problem_parameters``. Then any parameters given on the
command line overwrites those given in the problem file. In summary; we have that defualt parameters <
problem file < command line.
All the default parameters are set in the ``problem/__init__.py`` file. Problem specific parameters
are then overwritten in the problem file under ``set_problem_parameters`` or by defining them in the command line. In summary;
the priority is as follow: default parameters < problem file < command line < (checkpointing).


Create your own problem file
============================

The number of problem files in turtleFSI is somewhat limited. We have, therefore, created a step-by-step
explanation, see the below, on how you can create your own problem file.
We have created a step-by-step explanation, see the below, on how you can create your own problem file.

For all numerical problems we have to specify a set parameters, provide a mesh and boundary conditions,
how to solve the equations, and finally specify which metric we are interested in measuring.
In turtleFSI problem file you can define upto seven functions which provides the solver with
In turtleFSI problem file you can define up to seven functions which provides the solver with
the above mentioned information. Listed in the order they are first executed:

- ``set_problem_parameters``
Expand Down
9 changes: 4 additions & 5 deletions turtleFSI/problems/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
Um=0.8, # Maximum velocity at inlet

# Variational formulations
fluid="fluid", # ["fluid", "no-fluid"] Turn off fluid and only solve the solid problem
solid="solid", # ["solid", "no-solid"] Turn off solid and only solve the fluid problem
extrapolation="laplace", # laplace, elastic, biharmonic, no-extrapolation
fluid="fluid", # ["fluid", "no_fluid"] Turn off fluid and only solve the solid problem
solid="solid", # ["solid", "no_solid"] Turn off solid and only solve the fluid problem
extrapolation="laplace", # laplace, elastic, biharmonic, no_extrapolation
extrapolation_sub_type="constant", # small_constant, volume, constant, constrained_disp, constrained_disp_vel
bc_ids=[], # List of ids for weak form of biharmonic mesh lifting operator with 'constrained_disp_vel'

Expand Down Expand Up @@ -104,8 +104,7 @@ def create_folders(folder, sub_folder, restart_folder, **namespace):


def checkpoint(dvp_, default_variables, checkpoint_folder, mesh, **namespace):
"""Utility function for storing the current parameters and the last two timesteps to
restart from later"""
"""Utility function for storing the current parameters and the last two timesteps"""
# Only update variables that exists in default_variables
default_variables.update((k, namespace[k]) for k in (default_variables.keys() & namespace.keys()))

Expand Down
13 changes: 6 additions & 7 deletions turtleFSI/utils/argpar.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def return_typed(self, s):
tmp_dict[k] = return_types(v)
return tmp_dict

else: # A string
else: # A string
return s

def __call__(self, parser, namespace, values, option_string=None):
Expand Down Expand Up @@ -146,11 +146,11 @@ def parse():
choices=["fluid", "no_fluid"], metavar="Fluid",
help="Turn off fluid and only solve the solid problem")
parser.add_argument("-s", "--solid", type=str, default=None, metavar="Solid",
choices=["solid", "no-solid"],
choices=["solid", "no_solid"],
help="Turn off solid and only solve the fluid problem")
parser.add_argument("-e", "--extrapolation", type=str, default=None,
metavar="Extrapolation method",
choices=["laplace", "elastic", "biharmonic", "no-extrapolation"],
choices=["laplace", "elastic", "biharmonic", "no_extrapolation"],
help="Set approach for extrapolating the deformation into the fluid" +
"domain")
parser.add_argument("-et", "--extrapolation-sub-type", type=str,
Expand Down Expand Up @@ -223,15 +223,14 @@ def parse():
parser.add_argument("--save-step", type=int, default=None,
help="Saving frequency of the files defined in the problem file")
parser.add_argument("--checkpoint-step", type=int, default=None,
help="How often to store a checkpoint to restart the simulation from")
help="How often to store a checkpoint (use to later restart a simulation)")
parser.add_argument("--folder", type=str, default=None,
help="Path to store the results. You can store multiple" +
" simulations in one folder")
parser.add_argument("--sub-folder", type=str, default=None,
help="Over write the standard 1, 2, 3 name of the sub folders")
help="Over write the standard 1, 2, 3 name of the sub folders")
parser.add_argument("--restart-folder", type=str, default=None,
help="Path to subfolder to restart from.")

help="Path to subfolder to restart from")

# Set spatial and temporal resolution
parser.add_argument("-dt", metavar="Time step", type=float,
Expand Down

0 comments on commit d3a2707

Please sign in to comment.