diff --git a/Docs/CMakeLists.txt b/Docs/CMakeLists.txt index 60473151f172afc5ee1ee6fb3fb1a5cc36d1a9be..ac86e77bb8bda845a1149378e9ee3ad620b9dae9 100644 --- a/Docs/CMakeLists.txt +++ b/Docs/CMakeLists.txt @@ -22,13 +22,14 @@ include(MyTools) # ----- CMake project setup ----- # cmake project name -set(PROJECT_NAME "parmesdoc") +set(PROJECT_NAME "hysopdoc") project(${PROJECT_NAME}) # ----- Search required libraries ----- # --- Python --- -include(PythonSetup) +find_package(PythonFull REQUIRED) +include(FindPythonModule) # --- Sphinx --- find_python_module(sphinx REQUIRED) # --- sphinxcontrib.doxylink --- @@ -42,6 +43,8 @@ configure_file ( "${CMAKE_CURRENT_BINARY_DIR}/sphinx_sources/conf.py" ) +file(COPY sphinx_sources DESTINATION .) + set(SPHINX_EXECUTABLE sphinx-build ) set(SPHINX_PARAMETERS -b html -c ${CMAKE_CURRENT_BINARY_DIR}/sphinx_sources/) @@ -49,4 +52,14 @@ add_custom_target(sphinx COMMAND ${SPHINX_EXECUTABLE} ${SPHINX_PARAMETERS} ${CMAKE_CURRENT_SOURCE_DIR}/sphinx_sources ${CMAKE_CURRENT_BINARY_DIR}/sphinx_build/html -) + ) + +set(SPHINX_APIDOC sphinx-apidoc) +set(GENERATED_DOC ${CMAKE_CURRENT_BINARY_DIR}/sphinx_sources/reference) +set(APIDOC_PARAMETERS -e -P -o ${GENERATED_DOC}) + +add_custom_target(apidoc + COMMAND ${SPHINX_APIDOC} ${APIDOC_PARAMETERS} + ${CMAKE_CURRENT_SOURCE_DIR}/../HySoP/hysop + ) + diff --git a/Docs/sphinx_sources/_templates/indexcontent.html b/Docs/sphinx_sources/_templates/indexcontent.html new file mode 100644 index 0000000000000000000000000000000000000000..4a6da35ced43e29235a6e9fc2624c4a738d19013 --- /dev/null +++ b/Docs/sphinx_sources/_templates/indexcontent.html @@ -0,0 +1,39 @@ +{% extends "defindex.html" %} +{% block tables %} + <p><strong>Parts of the documentation:</strong></p> + <table class="contentstable" align="center"><tr> + <td width="50%"> + <p class="biglink"><a class="biglink" href="{{ pathto("user_guide/index") }}">HySoP User Guide</a><br/> + <span class="linkdescr">start here</span></p> + <p class="biglink"><a class="biglink" href="{{ pathto("reference/index") }}">HySoP Reference</a><br/> + <span class="linkdescr">reference documentation</span></p> + <p class="biglink"><a class="biglink" href="{{ pathto("dev/index") }}">HySoP Developer Guide</a><br/> + <span class="linkdescr">contributing to NumPy</span></p> + </td></tr> + </table> + + <p><strong>Indices and tables:</strong></p> + <table class="contentstable" align="center"><tr> + <td width="50%"> + <p class="biglink"><a class="biglink" href="{{ pathto("genindex") }}">General Index</a><br/> + <span class="linkdescr">all functions, classes, terms</span></p> + <p class="biglink"><a class="biglink" href="{{ pathto("glossary") }}">Glossary</a><br/> + <span class="linkdescr">the most important terms explained</span></p> + </td><td width="50%"> + <p class="biglink"><a class="biglink" href="{{ pathto("search") }}">Search page</a><br/> + <span class="linkdescr">search this documentation</span></p> + <p class="biglink"><a class="biglink" href="{{ pathto("contents") }}">Complete Table of Contents</a><br/> + <span class="linkdescr">lists all sections and subsections</span></p> + </td></tr> + </table> + + <table class="contentstable" align="center"><tr> + <td width="50%"> + <p class="biglink"><a class="biglink" href="{{ pathto("about") }}">About HySoP</a></p> + </td><td width="50%"> + <p class="biglink"><a class="biglink" href="{{ pathto("release") }}">Release Notes</a></p> + <p class="biglink"><a class="biglink" href="{{ pathto("license") }}">License of HySoP</a></p> + </td></tr> + </table> + +{% endblock %} diff --git a/Docs/sphinx_sources/conf.py.in b/Docs/sphinx_sources/conf.py.in index 523742cc92ac52db138fd806a113340b63745b3f..68b40c1e84bfd32068570e03f9baf94ea50ff0d4 100644 --- a/Docs/sphinx_sources/conf.py.in +++ b/Docs/sphinx_sources/conf.py.in @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # -# ParMeS documentation build configuration file, created by -# sphinx-quickstart on Tue Jul 15 16:46:52 2014. +# HySoP documentation build configuration file, created by +# sphinx-quickstart on Tue Nov 25 11:54:57 2014. # # This file is execfile()d with the current directory set to its # containing dir. @@ -12,8 +12,6 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -29,15 +27,25 @@ import sys, os # ones. extensions = [ 'sphinx.ext.autodoc', + 'sphinx.ext.autosummary', 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.mathjax', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', - 'sphinxcontrib.doxylink', + 'numpydoc', + 'sphinx.ext.intersphinx', ] + +#numpydoc_class_members_toctree = True +#autosummary_generate = True +# ----------------------------------------------------------------------------- +# Autosummary +# ----------------------------------------------------------------------------- + +#import glob +#autosummary_generate = glob.glob("@CMAKE_CURRENT_BINARY_DIR@/sphinx_source/reference/*.rst") doxylink = { 'doxykernel': @@ -45,6 +53,7 @@ doxylink = { '@CMAKE_INSTALL_PREFIX@/Kernel/'), } +#autoclass_content = 'both' # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -58,17 +67,17 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'ParMeS' -copyright = u'2014, ParMeS development team' +project = u'HySoP' +copyright = u'2014, HySoP development team' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '1.0.0' +version = '1.1.0' # The full version, including alpha/beta/rc tags. -release = '1.0.0' +release = '1.1.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -108,13 +117,16 @@ pygments_style = 'sphinx' # If true, keep warnings as "system message" paragraphs in the built documents. # keep_warnings = False +html_additional_pages = { + 'index': 'indexcontent.html', +} # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -#html_theme = 'mt_ini_gryphon' # 'default' -html_theme = 'sphinxdoc' +html_theme = 'agogo' + # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. @@ -191,8 +203,7 @@ html_static_path = ['_static'] # html_file_suffix = None # Output file base name for HTML help builder. -htmlhelp_basename = 'ParMeSdoc' - +htmlhelp_basename = 'HySoPdoc' # -- Options for LaTeX output --------------------------------------------- @@ -211,8 +222,8 @@ latex_elements = { # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('index', 'ParMeS.tex', u'ParMeS Documentation', - u'ParMeS development team', 'manual'), + ('index', 'HySoP.tex', u'HySoP Documentation', + u'HySoP development team', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -241,8 +252,8 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'parmes', u'ParMeS Documentation', - [u'ParMeS development team'], 1) + ('index', 'hysop', u'HySoP Documentation', + [u'HySoP development team'], 1) ] # If true, show URL addresses after external links. @@ -255,8 +266,8 @@ man_pages = [ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'ParMeS', u'ParMeS Documentation', - u'ParMeS development team', 'ParMeS', 'One line description of project.', + ('index', 'HySoP', u'HySoP Documentation', + u'HySoP development team', 'HySoP', 'One line description of project.', 'Miscellaneous'), ] @@ -276,10 +287,10 @@ texinfo_documents = [ # -- Options for Epub output ---------------------------------------------- # Bibliographic Dublin Core info. -epub_title = u'ParMeS' -epub_author = u'ParMeS development team' -epub_publisher = u'ParMeS development team' -epub_copyright = u'2014, ParMeS development team' +epub_title = u'HySoP' +epub_author = u'HySoP development team' +epub_publisher = u'HySoP development team' +epub_copyright = u'2014, HySoP development team' # The basename for the epub file. It defaults to the project name. # epub_basename = u'Siconos' diff --git a/Docs/sphinx_sources/index.rst b/Docs/sphinx_sources/index.rst index 22de47163a267c3de150a0541e3db357ae81cfbf..b42b619f47fa5d9daeb99cfc0eb26ac9561b5762 100644 --- a/Docs/sphinx_sources/index.rst +++ b/Docs/sphinx_sources/index.rst @@ -1,9 +1,9 @@ -.. ParMeS documentation master file, created by +.. HySoP documentation master file, created by sphinx-quickstart on Tue Jul 15 16:46:52 2014. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to ParMeS's documentation! +Welcome to HySoP's documentation! ================================== Contents: @@ -11,11 +11,7 @@ Contents: .. toctree:: :maxdepth: 2 - introduction - redistribute - parmepy.domain - develnotes - + Indices and tables ================== diff --git a/Docs/sphinx_sources/parmepy.domain.obstacle.rst b/Docs/sphinx_sources/parmepy.domain.obstacle.rst deleted file mode 100644 index f462b51cd4f4925a30c8835c58d8867bc9b1d1c9..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.domain.obstacle.rst +++ /dev/null @@ -1,54 +0,0 @@ -parmepy.domain.obstacle package -=============================== - -Submodules ----------- - -parmepy.domain.obstacle.controlBox module ------------------------------------------ - -.. automodule:: parmepy.domain.obstacle.controlBox - :members: - :undoc-members: - :show-inheritance: - -parmepy.domain.obstacle.disk module ------------------------------------ - -.. automodule:: parmepy.domain.obstacle.disk - :members: - :undoc-members: - :show-inheritance: - -parmepy.domain.obstacle.obstacle module ---------------------------------------- - -.. automodule:: parmepy.domain.obstacle.obstacle - :members: - :undoc-members: - :show-inheritance: - -parmepy.domain.obstacle.planes module -------------------------------------- - -.. automodule:: parmepy.domain.obstacle.planes - :members: - :undoc-members: - :show-inheritance: - -parmepy.domain.obstacle.sphere module -------------------------------------- - -.. automodule:: parmepy.domain.obstacle.sphere - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: parmepy.domain.obstacle - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.domain.rst b/Docs/sphinx_sources/parmepy.domain.rst deleted file mode 100644 index 80659d3d037bd0cd82e33af967295f40bb77cce0..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.domain.rst +++ /dev/null @@ -1,25 +0,0 @@ -.. _domain: - -Domain and other geometries -============================ - -This package is used to describe the physical domain geometry -or to define some obstacles inside this geometry. - -:ref:`IO_params` - -Base class (abstract) ------------------------ - -.. automodule:: parmepy.domain.domain - :members: - :undoc-members: - :show-inheritance: - -Box-shaped domain ------------------- - -.. automodule:: parmepy.domain.box - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.fakef2py.fftw2py.rst b/Docs/sphinx_sources/parmepy.fakef2py.fftw2py.rst deleted file mode 100644 index 97c3b4f9406bcb6f8df97d4f736ea9b9bb8b15e7..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.fakef2py.fftw2py.rst +++ /dev/null @@ -1,10 +0,0 @@ -parmepy.fakef2py.fftw2py package -================================ - -Module contents ---------------- - -.. automodule:: parmepy.fakef2py.fftw2py - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.fakef2py.rst b/Docs/sphinx_sources/parmepy.fakef2py.rst deleted file mode 100644 index 76da79417d308a90ccef64fab2a3acba1a60973b..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.fakef2py.rst +++ /dev/null @@ -1,18 +0,0 @@ -parmepy.fakef2py package -======================== - -Subpackages ------------ - -.. toctree:: - - parmepy.fakef2py.fftw2py - parmepy.fakef2py.scales2py - -Module contents ---------------- - -.. automodule:: parmepy.fakef2py - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.fakef2py.scales2py.rst b/Docs/sphinx_sources/parmepy.fakef2py.scales2py.rst deleted file mode 100644 index f65bfc9d97336bf8f9e4e328a33905248d9feee3..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.fakef2py.scales2py.rst +++ /dev/null @@ -1,10 +0,0 @@ -parmepy.fakef2py.scales2py package -================================== - -Module contents ---------------- - -.. automodule:: parmepy.fakef2py.scales2py - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.fields.rst b/Docs/sphinx_sources/parmepy.fields.rst deleted file mode 100644 index 5baf08c622cec8b574922192eee0a4588cfdc243..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.fields.rst +++ /dev/null @@ -1,45 +0,0 @@ -parmepy.fields package -====================== - -Subpackages ------------ - -.. toctree:: - - parmepy.fields.tests - -Submodules ----------- - -parmepy.fields.continuous module --------------------------------- - -.. automodule:: parmepy.fields.continuous - :members: - :undoc-members: - :show-inheritance: - -parmepy.fields.discrete module ------------------------------- - -.. automodule:: parmepy.fields.discrete - :members: - :undoc-members: - :show-inheritance: - -parmepy.fields.variable_parameter module ----------------------------------------- - -.. automodule:: parmepy.fields.variable_parameter - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: parmepy.fields - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.gpu.rst b/Docs/sphinx_sources/parmepy.gpu.rst deleted file mode 100644 index 1275af6914a5f56af5017a1c75025fd8ff7a86a0..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.gpu.rst +++ /dev/null @@ -1,110 +0,0 @@ -parmepy.gpu package -=================== - -Subpackages ------------ - -.. toctree:: - - parmepy.gpu.tests - parmepy.gpu.visu - -Submodules ----------- - -parmepy.gpu.QtRendering module ------------------------------- - -.. automodule:: parmepy.gpu.QtRendering - :members: - :undoc-members: - :show-inheritance: - -parmepy.gpu.config_cayman module --------------------------------- - -.. automodule:: parmepy.gpu.config_cayman - :members: - :undoc-members: - :show-inheritance: - -parmepy.gpu.config_default module ---------------------------------- - -.. automodule:: parmepy.gpu.config_default - :members: - :undoc-members: - :show-inheritance: - -parmepy.gpu.config_k20m module ------------------------------- - -.. automodule:: parmepy.gpu.config_k20m - :members: - :undoc-members: - :show-inheritance: - -parmepy.gpu.gpu_discrete module -------------------------------- - -.. automodule:: parmepy.gpu.gpu_discrete - :members: - :undoc-members: - :show-inheritance: - -parmepy.gpu.gpu_kernel module ------------------------------ - -.. automodule:: parmepy.gpu.gpu_kernel - :members: - :undoc-members: - :show-inheritance: - -parmepy.gpu.gpu_particle_advection module ------------------------------------------ - -.. automodule:: parmepy.gpu.gpu_particle_advection - :members: - :undoc-members: - :show-inheritance: - -parmepy.gpu.gpu_particle_advection_1k module --------------------------------------------- - -.. automodule:: parmepy.gpu.gpu_particle_advection_1k - :members: - :undoc-members: - :show-inheritance: - -parmepy.gpu.gpu_particle_advection_2k module --------------------------------------------- - -.. automodule:: parmepy.gpu.gpu_particle_advection_2k - :members: - :undoc-members: - :show-inheritance: - -parmepy.gpu.kernel_benchmark module ------------------------------------ - -.. automodule:: parmepy.gpu.kernel_benchmark - :members: - :undoc-members: - :show-inheritance: - -parmepy.gpu.tools module ------------------------- - -.. automodule:: parmepy.gpu.tools - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: parmepy.gpu - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.gpu.visu.rst b/Docs/sphinx_sources/parmepy.gpu.visu.rst deleted file mode 100644 index 00c9759659a2b4cf3c57d99cee9643fec269b001..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.gpu.visu.rst +++ /dev/null @@ -1,22 +0,0 @@ -parmepy.gpu.visu package -======================== - -Submodules ----------- - -parmepy.gpu.visu.marchingcube module ------------------------------------- - -.. automodule:: parmepy.gpu.visu.marchingcube - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: parmepy.gpu.visu - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.mpi.rst b/Docs/sphinx_sources/parmepy.mpi.rst deleted file mode 100644 index b3730c3808704952fbf12103d13e2f106d5c4cc1..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.mpi.rst +++ /dev/null @@ -1,61 +0,0 @@ -parmepy.mpi package -=================== - -Subpackages ------------ - -.. toctree:: - - parmepy.mpi.tests - -Submodules ----------- - -parmepy.mpi.bridge module -------------------------- - -.. automodule:: parmepy.mpi.bridge - :members: - :undoc-members: - :show-inheritance: - -parmepy.mpi.main_var module ---------------------------- - -.. automodule:: parmepy.mpi.main_var - :members: - :undoc-members: - :show-inheritance: - -parmepy.mpi.mesh module ------------------------ - -.. automodule:: parmepy.mpi.mesh - :members: - :undoc-members: - :show-inheritance: - -parmepy.mpi.newBridge module ----------------------------- - -.. automodule:: parmepy.mpi.newBridge - :members: - :undoc-members: - :show-inheritance: - -parmepy.mpi.topology module ---------------------------- - -.. automodule:: parmepy.mpi.topology - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: parmepy.mpi - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.numerics.integrators.rst b/Docs/sphinx_sources/parmepy.numerics.integrators.rst deleted file mode 100644 index 4d0154954d237f0fd9daf2dc39b6f2ae1f37600a..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.numerics.integrators.rst +++ /dev/null @@ -1,54 +0,0 @@ -parmepy.numerics.integrators package -==================================== - -Submodules ----------- - -parmepy.numerics.integrators.euler module ------------------------------------------ - -.. automodule:: parmepy.numerics.integrators.euler - :members: - :undoc-members: - :show-inheritance: - -parmepy.numerics.integrators.odesolver module ---------------------------------------------- - -.. automodule:: parmepy.numerics.integrators.odesolver - :members: - :undoc-members: - :show-inheritance: - -parmepy.numerics.integrators.runge_kutta2 module ------------------------------------------------- - -.. automodule:: parmepy.numerics.integrators.runge_kutta2 - :members: - :undoc-members: - :show-inheritance: - -parmepy.numerics.integrators.runge_kutta3 module ------------------------------------------------- - -.. automodule:: parmepy.numerics.integrators.runge_kutta3 - :members: - :undoc-members: - :show-inheritance: - -parmepy.numerics.integrators.runge_kutta4 module ------------------------------------------------- - -.. automodule:: parmepy.numerics.integrators.runge_kutta4 - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: parmepy.numerics.integrators - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.numerics.rst b/Docs/sphinx_sources/parmepy.numerics.rst deleted file mode 100644 index 3ac022afc7f490ef9320135e196949d9b2fe51d3..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.numerics.rst +++ /dev/null @@ -1,70 +0,0 @@ -parmepy.numerics package -======================== - -Subpackages ------------ - -.. toctree:: - - parmepy.numerics.integrators - parmepy.numerics.tests - -Submodules ----------- - -parmepy.numerics.differential_operations module ------------------------------------------------ - -.. automodule:: parmepy.numerics.differential_operations - :members: - :undoc-members: - :show-inheritance: - -parmepy.numerics.finite_differences module ------------------------------------------- - -.. automodule:: parmepy.numerics.finite_differences - :members: - :undoc-members: - :show-inheritance: - -parmepy.numerics.interpolation module -------------------------------------- - -.. automodule:: parmepy.numerics.interpolation - :members: - :undoc-members: - :show-inheritance: - -parmepy.numerics.method module ------------------------------- - -.. automodule:: parmepy.numerics.method - :members: - :undoc-members: - :show-inheritance: - -parmepy.numerics.remeshing module ---------------------------------- - -.. automodule:: parmepy.numerics.remeshing - :members: - :undoc-members: - :show-inheritance: - -parmepy.numerics.update_ghosts module -------------------------------------- - -.. automodule:: parmepy.numerics.update_ghosts - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: parmepy.numerics - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.operator.discrete.rst b/Docs/sphinx_sources/parmepy.operator.discrete.rst deleted file mode 100644 index 3d27c11e4e524198c6cc98b53c83b717595db052..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.operator.discrete.rst +++ /dev/null @@ -1,134 +0,0 @@ -parmepy.operator.discrete package -================================= - -Submodules ----------- - -parmepy.operator.discrete.adapt_timestep module ------------------------------------------------ - -.. automodule:: parmepy.operator.discrete.adapt_timestep - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.baroclinic module -------------------------------------------- - -.. automodule:: parmepy.operator.discrete.baroclinic - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.curlAndDiffusion_fft module ------------------------------------------------------ - -.. automodule:: parmepy.operator.discrete.curlAndDiffusion_fft - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.density module ----------------------------------------- - -.. automodule:: parmepy.operator.discrete.density - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.differential module ---------------------------------------------- - -.. automodule:: parmepy.operator.discrete.differential - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.diffusion_fft module ----------------------------------------------- - -.. automodule:: parmepy.operator.discrete.diffusion_fft - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.discrete module ------------------------------------------ - -.. automodule:: parmepy.operator.discrete.discrete - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.energy_enstrophy module -------------------------------------------------- - -.. automodule:: parmepy.operator.discrete.energy_enstrophy - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.particle_advection module ---------------------------------------------------- - -.. automodule:: parmepy.operator.discrete.particle_advection - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.penalization module ---------------------------------------------- - -.. automodule:: parmepy.operator.discrete.penalization - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.poisson_fft module --------------------------------------------- - -.. automodule:: parmepy.operator.discrete.poisson_fft - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.reprojection module ---------------------------------------------- - -.. automodule:: parmepy.operator.discrete.reprojection - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.scales_advection module -------------------------------------------------- - -.. automodule:: parmepy.operator.discrete.scales_advection - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.stretching module -------------------------------------------- - -.. automodule:: parmepy.operator.discrete.stretching - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.velocity_correction module ----------------------------------------------------- - -.. automodule:: parmepy.operator.discrete.velocity_correction - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: parmepy.operator.discrete - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.operator.monitors.rst b/Docs/sphinx_sources/parmepy.operator.monitors.rst deleted file mode 100644 index e99d93b7d6e478d058f9a30c5051e5e411063d0c..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.operator.monitors.rst +++ /dev/null @@ -1,54 +0,0 @@ -parmepy.operator.monitors package -================================= - -Submodules ----------- - -parmepy.operator.monitors.compute_forces module ------------------------------------------------ - -.. automodule:: parmepy.operator.monitors.compute_forces - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.monitors.energy_enstrophy module -------------------------------------------------- - -.. automodule:: parmepy.operator.monitors.energy_enstrophy - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.monitors.monitoring module -------------------------------------------- - -.. automodule:: parmepy.operator.monitors.monitoring - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.monitors.printer module ----------------------------------------- - -.. automodule:: parmepy.operator.monitors.printer - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.monitors.reader module ---------------------------------------- - -.. automodule:: parmepy.operator.monitors.reader - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: parmepy.operator.monitors - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.operator.redistribute.rst b/Docs/sphinx_sources/parmepy.operator.redistribute.rst deleted file mode 100644 index 3d27c11e4e524198c6cc98b53c83b717595db052..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.operator.redistribute.rst +++ /dev/null @@ -1,134 +0,0 @@ -parmepy.operator.discrete package -================================= - -Submodules ----------- - -parmepy.operator.discrete.adapt_timestep module ------------------------------------------------ - -.. automodule:: parmepy.operator.discrete.adapt_timestep - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.baroclinic module -------------------------------------------- - -.. automodule:: parmepy.operator.discrete.baroclinic - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.curlAndDiffusion_fft module ------------------------------------------------------ - -.. automodule:: parmepy.operator.discrete.curlAndDiffusion_fft - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.density module ----------------------------------------- - -.. automodule:: parmepy.operator.discrete.density - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.differential module ---------------------------------------------- - -.. automodule:: parmepy.operator.discrete.differential - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.diffusion_fft module ----------------------------------------------- - -.. automodule:: parmepy.operator.discrete.diffusion_fft - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.discrete module ------------------------------------------ - -.. automodule:: parmepy.operator.discrete.discrete - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.energy_enstrophy module -------------------------------------------------- - -.. automodule:: parmepy.operator.discrete.energy_enstrophy - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.particle_advection module ---------------------------------------------------- - -.. automodule:: parmepy.operator.discrete.particle_advection - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.penalization module ---------------------------------------------- - -.. automodule:: parmepy.operator.discrete.penalization - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.poisson_fft module --------------------------------------------- - -.. automodule:: parmepy.operator.discrete.poisson_fft - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.reprojection module ---------------------------------------------- - -.. automodule:: parmepy.operator.discrete.reprojection - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.scales_advection module -------------------------------------------------- - -.. automodule:: parmepy.operator.discrete.scales_advection - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.stretching module -------------------------------------------- - -.. automodule:: parmepy.operator.discrete.stretching - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.discrete.velocity_correction module ----------------------------------------------------- - -.. automodule:: parmepy.operator.discrete.velocity_correction - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: parmepy.operator.discrete - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.operator.rst b/Docs/sphinx_sources/parmepy.operator.rst deleted file mode 100644 index ba97de6bf4b2f5325d63beb2c8828ce10da72b5f..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.operator.rst +++ /dev/null @@ -1,199 +0,0 @@ -parmepy.operator package -======================== - -Subpackages ------------ - -.. toctree:: - - parmepy.operator.discrete - parmepy.operator.monitors - parmepy.operator.tests - -Submodules ----------- - -parmepy.operator.adapt_timestep module --------------------------------------- - -.. automodule:: parmepy.operator.adapt_timestep - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.advection module ---------------------------------- - -.. automodule:: parmepy.operator.advection - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.advectionDir module ------------------------------------- - -.. automodule:: parmepy.operator.advectionDir - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.advold module ------------------------------- - -.. automodule:: parmepy.operator.advold - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.analytic module --------------------------------- - -.. automodule:: parmepy.operator.analytic - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.baroclinic module ----------------------------------- - -.. automodule:: parmepy.operator.baroclinic - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.computational module -------------------------------------- - -.. automodule:: parmepy.operator.computational - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.continuous module ----------------------------------- - -.. automodule:: parmepy.operator.continuous - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.curlAndDiffusion module ----------------------------------------- - -.. automodule:: parmepy.operator.curlAndDiffusion - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.density module -------------------------------- - -.. automodule:: parmepy.operator.density - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.differential module ------------------------------------- - -.. automodule:: parmepy.operator.differential - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.diffusion module ---------------------------------- - -.. automodule:: parmepy.operator.diffusion - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.energy_enstrophy module ----------------------------------------- - -.. automodule:: parmepy.operator.energy_enstrophy - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.hdf_io module ------------------------------- - -.. automodule:: parmepy.operator.hdf_io - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.penalization module ------------------------------------- - -.. automodule:: parmepy.operator.penalization - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.poisson module -------------------------------- - -.. automodule:: parmepy.operator.poisson - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.redistribute module ------------------------------------- - -.. automodule:: parmepy.operator.redistribute - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.redistribute_inter module ------------------------------------------- - -.. automodule:: parmepy.operator.redistribute_inter - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.redistribute_intra module ------------------------------------------- - -.. automodule:: parmepy.operator.redistribute_intra - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.reprojection module ------------------------------------- - -.. automodule:: parmepy.operator.reprojection - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.stretching module ----------------------------------- - -.. automodule:: parmepy.operator.stretching - :members: - :undoc-members: - :show-inheritance: - -parmepy.operator.velocity_correction module -------------------------------------------- - -.. automodule:: parmepy.operator.velocity_correction - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: parmepy.operator - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.problem.rst b/Docs/sphinx_sources/parmepy.problem.rst deleted file mode 100644 index 92d9ff6ca2dffb7a0b41bda8ebcc1e67ba4e73ee..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.problem.rst +++ /dev/null @@ -1,69 +0,0 @@ -parmepy.problem package -======================= - -Subpackages ------------ - -.. toctree:: - - parmepy.problem.tests - -Submodules ----------- - -parmepy.problem.navier_stokes module ------------------------------------- - -.. automodule:: parmepy.problem.navier_stokes - :members: - :undoc-members: - :show-inheritance: - -parmepy.problem.problem module ------------------------------- - -.. automodule:: parmepy.problem.problem - :members: - :undoc-members: - :show-inheritance: - -parmepy.problem.problem_tasks module ------------------------------------- - -.. automodule:: parmepy.problem.problem_tasks - :members: - :undoc-members: - :show-inheritance: - -parmepy.problem.problem_with_GLRendering module ------------------------------------------------ - -.. automodule:: parmepy.problem.problem_with_GLRendering - :members: - :undoc-members: - :show-inheritance: - -parmepy.problem.simulation module ---------------------------------- - -.. automodule:: parmepy.problem.simulation - :members: - :undoc-members: - :show-inheritance: - -parmepy.problem.transport module --------------------------------- - -.. automodule:: parmepy.problem.transport - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: parmepy.problem - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.rst b/Docs/sphinx_sources/parmepy.rst deleted file mode 100644 index 95f27b689fe0f43d18bd0cbb9c0ff910862b003c..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.rst +++ /dev/null @@ -1,62 +0,0 @@ -parmepy package -=============== - -Subpackages ------------ - -.. toctree:: - - parmepy.domain - parmepy.fakef2py - parmepy.fields - parmepy.gpu - parmepy.mpi - parmepy.numerics - parmepy.operator - parmepy.problem - parmepy.test - parmepy.tools - -Submodules ----------- - -parmepy.constants module ------------------------- - -.. automodule:: parmepy.constants - :members: - :undoc-members: - :show-inheritance: - -parmepy.default_methods module ------------------------------- - -.. automodule:: parmepy.default_methods - :members: - :undoc-members: - :show-inheritance: - -parmepy.methods module ----------------------- - -.. automodule:: parmepy.methods - :members: - :undoc-members: - :show-inheritance: - -parmepy.methods_keys module ---------------------------- - -.. automodule:: parmepy.methods_keys - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: parmepy - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/parmepy.tools.rst b/Docs/sphinx_sources/parmepy.tools.rst deleted file mode 100644 index c71e8924d9d3d6f6b38efc1f669fce6486a21d38..0000000000000000000000000000000000000000 --- a/Docs/sphinx_sources/parmepy.tools.rst +++ /dev/null @@ -1,101 +0,0 @@ -parmepy.tools package -===================== - -Subpackages ------------ - -.. toctree:: - - parmepy.tools.tests - -Submodules ----------- - -parmepy.tools.indices module ----------------------------- - -.. automodule:: parmepy.tools.indices - :members: - :undoc-members: - :show-inheritance: - -parmepy.tools.io_utils module ------------------------------ - -.. automodule:: parmepy.tools.io_utils - :members: - :undoc-members: - :show-inheritance: - -parmepy.tools.numpywrappers module ----------------------------------- - -.. automodule:: parmepy.tools.numpywrappers - :members: - :undoc-members: - :show-inheritance: - -parmepy.tools.parameters module -------------------------------- - -.. automodule:: parmepy.tools.parameters - :members: - :undoc-members: - :show-inheritance: - -parmepy.tools.plotDrag module ------------------------------ - -.. automodule:: parmepy.tools.plotDrag - :members: - :undoc-members: - :show-inheritance: - -parmepy.tools.problem2dot module --------------------------------- - -.. automodule:: parmepy.tools.problem2dot - :members: - :undoc-members: - :show-inheritance: - -parmepy.tools.profiling module ------------------------------- - -.. automodule:: parmepy.tools.profiling - :members: - :undoc-members: - :show-inheritance: - -parmepy.tools.remeshing_formula_parsing module ----------------------------------------------- - -.. automodule:: parmepy.tools.remeshing_formula_parsing - :members: - :undoc-members: - :show-inheritance: - -parmepy.tools.sys_utils module ------------------------------- - -.. automodule:: parmepy.tools.sys_utils - :members: - :undoc-members: - :show-inheritance: - -parmepy.tools.timers module ---------------------------- - -.. automodule:: parmepy.tools.timers - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: parmepy.tools - :members: - :undoc-members: - :show-inheritance: diff --git a/Docs/sphinx_sources/reference/index.rst b/Docs/sphinx_sources/reference/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..79977116df47ab4320f5ce34d5a6e679ed775453 --- /dev/null +++ b/Docs/sphinx_sources/reference/index.rst @@ -0,0 +1,11 @@ +.. HySoP reference (auto generated) documentation + +Welcome to HySoP's documentation! +================================== + +Contents: + +.. toctree:: + :maxdepth: 2 + + modules diff --git a/Docs/sphinx_sources/develnotes.rst b/Docs/sphinx_sources/user_guide/develnotes.rst similarity index 100% rename from Docs/sphinx_sources/develnotes.rst rename to Docs/sphinx_sources/user_guide/develnotes.rst diff --git a/Docs/sphinx_sources/forces.rst b/Docs/sphinx_sources/user_guide/forces.rst similarity index 100% rename from Docs/sphinx_sources/forces.rst rename to Docs/sphinx_sources/user_guide/forces.rst diff --git a/Docs/sphinx_sources/user_guide/index.rst b/Docs/sphinx_sources/user_guide/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..54ce631d5b093daba8d0acdc4598145b25366b12 --- /dev/null +++ b/Docs/sphinx_sources/user_guide/index.rst @@ -0,0 +1,25 @@ +.. HySoP documentation master file, created by + sphinx-quickstart on Tue Jul 15 16:46:52 2014. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to HySoP's documentation! +================================== + +Contents: + +.. toctree:: + :maxdepth: 2 + + introduction + redistribute + develnotes + memo_sphinx + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/Docs/sphinx_sources/introduction.rst b/Docs/sphinx_sources/user_guide/introduction.rst similarity index 83% rename from Docs/sphinx_sources/introduction.rst rename to Docs/sphinx_sources/user_guide/introduction.rst index 6fa19c60d3b4a00f6c8bc66dab77bc176ea6402e..af16a0cb11dac0c77eaa22ae69b3caf9c97229d8 100644 --- a/Docs/sphinx_sources/introduction.rst +++ b/Docs/sphinx_sources/user_guide/introduction.rst @@ -3,8 +3,8 @@ Introduction ============ -ParMepy (Particular Methods Software) is a library dedicated to -flow simulation based on particular methods, +HySoP (Hybrid SimulatiOn with Particles) is a library dedicated to +flow simulation based on particles methods, on hybrid (multi CPU-GPU) architecture. It is written in Python (high level functionnalities) and Fortran. diff --git a/Docs/sphinx_sources/user_guide/memo_sphinx.rst b/Docs/sphinx_sources/user_guide/memo_sphinx.rst new file mode 100644 index 0000000000000000000000000000000000000000..2b26176637ec970bc3fa88b3fa47d3136241c5ba --- /dev/null +++ b/Docs/sphinx_sources/user_guide/memo_sphinx.rst @@ -0,0 +1,28 @@ +.. _memo_sphinx: + +Reminder for sphinx utilities +============================= + +To print source Code:: + + for i in xrange(3): + do un_truc() + +Hyperlinks `HySoP Web`_. + +.. _Hysop Web: https://forge.imag.fr + +.. math:: + \begin{eqnarray} + a &=& \frac{1}{2}\\ + \alpha &=& 3 \times \nabla \omega + \end{eqnarray} + +To print a link to some HySoP object: + +.. currentmodule:: hysop.operator.discrete + +An example of a discrete operator, :class:`stretching.Conservative`, used to represent the +stretching part of NS. + + diff --git a/Docs/sphinx_sources/modules.rst b/Docs/sphinx_sources/user_guide/modules.rst similarity index 67% rename from Docs/sphinx_sources/modules.rst rename to Docs/sphinx_sources/user_guide/modules.rst index 3aff027fde3d9902352c96354210099d5b6a3718..6845fe56470ff697e18a2893e11f94c150b85c9f 100644 --- a/Docs/sphinx_sources/modules.rst +++ b/Docs/sphinx_sources/user_guide/modules.rst @@ -1,7 +1,7 @@ -parmepy +hysop ======= .. toctree:: :maxdepth: 4 - parmepy + hysop diff --git a/Docs/sphinx_sources/redistribute.rst b/Docs/sphinx_sources/user_guide/redistribute.rst similarity index 100% rename from Docs/sphinx_sources/redistribute.rst rename to Docs/sphinx_sources/user_guide/redistribute.rst diff --git a/Examples/TaylorGreen3D_debug.py b/Examples/TaylorGreen3D_debug.py index 5a04498d91d0fcda2b67ee6121e466352d632729..7f7eef8871b06252c7237355f9076f1d8884fa25 100644 --- a/Examples/TaylorGreen3D_debug.py +++ b/Examples/TaylorGreen3D_debug.py @@ -11,7 +11,6 @@ from hysop import Box from hysop.f2py import fftw2py import numpy as np from hysop.fields.continuous import Field -from hysop.fields.variable_parameter import VariableParameter from hysop.operator.advection import Advection from hysop.operator.stretching import Stretching from hysop.operator.poisson import Poisson @@ -69,8 +68,6 @@ velo = Field(domain=box, formula=computeVel, vorti = Field(domain=box, formula=computeVort, name='Vorticity', isVector=True) -# ======= Parameter Variable (adaptative timestep) ======= -dt = VariableParameter(data=0.0125, name='dt') # ========= Simulation setup ========= simu = Simulation(tinit=0.0, tend=10.0, timeStep=0.0125, iterMax=50) diff --git a/HySoP/hysop/domain/box.py b/HySoP/hysop/domain/box.py index 0a22d36ce795cfd1beea7f6bf887ec908aff4500..b67c20794e30d513b349af7b91476146c539b62a 100644 --- a/HySoP/hysop/domain/box.py +++ b/HySoP/hysop/domain/box.py @@ -19,18 +19,18 @@ class Box(Domain): def __init__(self, length=None, origin=None, **kwds): """ Create a Periodic Box from a dimension, length and origin. - Parameters dimensions must coincide. Raise ValueError - in case of inconsistent parameters dimensions. + @param length : Box length. Default [1.0, ...] @param origin : Box minimum position. Default [0., ...] - \code + + Example: + >>> import hysop as pp >>> import numpy as np >>> b = pp.Box() >>> (b.end == np.asarray([1.0, 1.0, 1.0])).all() True - \endcode """ if 'dimension' not in kwds: if length is not None or origin is not None: diff --git a/HySoP/hysop/gpu/tests/test_advection_nullVelocity.py b/HySoP/hysop/gpu/tests/test_advection_nullVelocity.py index de2f58dbd1328b51a623c1996c912e4c0a3f3a68..3e73d98bcdf1fbce023289ec16691779a37eab59 100644 --- a/HySoP/hysop/gpu/tests/test_advection_nullVelocity.py +++ b/HySoP/hysop/gpu/tests/test_advection_nullVelocity.py @@ -42,11 +42,13 @@ def assertion_2D(scal, velo, advec): scal_init = scal_d.data[0].copy() scal_d.toDevice() velo_d.toDevice() - + scal_d.wait() + velo_d.wait() + advec.apply(Simulation(tinit=0., tend=0.01, nbIter=1)) scal_d.toHost() - + scal_d.wait() advec.finalize() return np.allclose(scal_init, scal_d.data[0]) @@ -59,17 +61,21 @@ def assertion_2D_withPython(scal, velo, advec, advec_py): scal_d = scal.discreteFields.values()[0] velo_d = velo.discreteFields.values()[0] - scal_d.data[0][...] = npw.asrealarray(np.random.random(scal_d.data[0].shape)) - velo_d.data[0][...] = npw.zeros_like(scal_d.data[0]) - velo_d.data[1][...] = npw.zeros_like(scal_d.data[0]) + scal_d.data[0][...] = npw.asrealarray( + np.random.random(scal_d.data[0].shape)) + velo_d.data[0][...] = npw.zeros(scal_d.data[0].shape) + velo_d.data[1][...] = npw.zeros(scal_d.data[0].shape) scal_d.toDevice() velo_d.toDevice() + scal_d.wait() + velo_d.wait() advec_py.apply(Simulation(tinit=0., tend=0.01, nbIter=1)) advec.apply(Simulation(tinit=0., tend=0.01, nbIter=1)) py_res = scal_d.data[0].copy() scal_d.toHost() + scal_d.wait() advec.finalize() print py_res, scal_d.data[0] @@ -90,10 +96,13 @@ def assertion_3D(scal, velo, advec): scal_init = scal_d.data[0].copy() scal_d.toDevice() velo_d.toDevice() + scal_d.wait() + velo_d.wait() advec.apply(Simulation(tinit=0., tend=0.01, nbIter=1)) scal_d.toHost() + scal_d.wait() advec.finalize() return np.allclose(scal_init, scal_d.data[0]) @@ -113,12 +122,15 @@ def assertion_3D_withPython(scal, velo, advec, advec_py): velo_d.data[2][...] = npw.zeros_like(scal_d.data[0]) scal_d.toDevice() velo_d.toDevice() + scal_d.wait() + velo_d.wait() advec_py.apply(Simulation(tinit=0., tend=0.01, nbIter=1)) advec.apply(Simulation(tinit=0., tend=0.01, nbIter=1)) py_res = scal_d.data[0].copy() scal_d.toHost() + scal_d.wait() advec.finalize() return np.allclose(py_res, scal_d.data[0]) @@ -130,7 +142,7 @@ d3d = Discretization([17, 17, 17]) # M6 tests def test_2D_m6_1k(): """ - Testing M6 remeshing formula in 2D, 1 kernel, simple precision, + Testing M6 remeshing formula in 2D, 1 kernel, o2 splitting. """ scal, velo = setup_2D() @@ -156,7 +168,7 @@ def test_2D_m6_1k(): def test_2D_m6_2k(): """ - Testing M6 remeshing formula in 2D, 2 kernel, simple precision, + Testing M6 remeshing formula in 2D, 2 kernel, o2 splitting. """ scal, velo = setup_2D() @@ -174,7 +186,7 @@ def test_2D_m6_2k(): def test_2D_m6_1k_sFH(): """ - Testing M6 remeshing formula in 2D, 1 kernel, simple precision, + Testing M6 remeshing formula in 2D, 1 kernel, o2_FullHalf splitting. """ scal, velo = setup_2D() @@ -192,7 +204,7 @@ def test_2D_m6_1k_sFH(): def test_2D_m6_2k_sFH(): """ - Testing M6 remeshing formula in 2D, 2 kernel, simple precision, + Testing M6 remeshing formula in 2D, 2 kernel, o2_FullHalf splitting. """ scal, velo = setup_2D() @@ -210,7 +222,7 @@ def test_2D_m6_2k_sFH(): def test_3D_m6_1k(): """ - Testing M6 remeshing formula in 3D, 1 kernel, simple precision, + Testing M6 remeshing formula in 3D, 1 kernel, o2 splitting. """ scal, velo = setup_3D() @@ -228,7 +240,7 @@ def test_3D_m6_1k(): def test_3D_m6_2k(): """ - Testing M6 remeshing formula in 3D, 2 kernel, simple precision, + Testing M6 remeshing formula in 3D, 2 kernel, o2 splitting. """ scal, velo = setup_3D() @@ -246,7 +258,7 @@ def test_3D_m6_2k(): def test_3D_m6_1k_sFH(): """ - Testing M6 remeshing formula in 3D, 1 kernel, simple precision, + Testing M6 remeshing formula in 3D, 1 kernel, o2_FullHalf splitting. """ scal, velo = setup_3D() @@ -264,7 +276,7 @@ def test_3D_m6_1k_sFH(): def test_3D_m6_2k_sFH(): """ - Testing M6 remeshing formula in 3D, 2 kernel, simple precision, + Testing M6 remeshing formula in 3D, 2 kernel, o2_FullHalf splitting. """ scal, velo = setup_3D() @@ -283,7 +295,7 @@ def test_3D_m6_2k_sFH(): # M4 testing def test_2D_m4_1k(): """ - Testing M4 remeshing formula in 2D, 1 kernel, simple precision, + Testing M4 remeshing formula in 2D, 1 kernel, o2 splitting. """ scal, velo = setup_2D() @@ -308,7 +320,7 @@ def test_2D_m4_1k(): def test_2D_m4_2k(): """ - Testing M4 remeshing formula in 2D, 2 kernel, simple precision, + Testing M4 remeshing formula in 2D, 2 kernel, o2 splitting. """ scal, velo = setup_2D() @@ -334,7 +346,7 @@ def test_2D_m4_2k(): def test_2D_m4_1k_sFH(): """ - Testing M4 remeshing formula in 2D, 1 kernel, simple precision, + Testing M4 remeshing formula in 2D, 1 kernel, o2_FullHalf splitting. """ scal, velo = setup_2D() @@ -359,7 +371,7 @@ def test_2D_m4_1k_sFH(): def test_2D_m4_2k_sFH(): """ - Testing M4 remeshing formula in 2D, 2 kernel, simple precision, + Testing M4 remeshing formula in 2D, 2 kernel, o2_FullHalf splitting. """ scal, velo = setup_2D() @@ -383,7 +395,7 @@ def test_2D_m4_2k_sFH(): def test_3D_m4_1k(): """ - Testing M4 remeshing formula in 3D, 1 kernel, simple precision, + Testing M4 remeshing formula in 3D, 1 kernel, o2 splitting. """ scal, velo = setup_3D() @@ -407,7 +419,7 @@ def test_3D_m4_1k(): def test_3D_m4_2k(): """ - Testing M4 remeshing formula in 3D, 2 kernel, simple precision, + Testing M4 remeshing formula in 3D, 2 kernel, o2 splitting. """ scal, velo = setup_3D() @@ -431,7 +443,7 @@ def test_3D_m4_2k(): def test_3D_m4_1k_sFH(): """ - Testing M4 remeshing formula in 3D, 1 kernel, simple precision, + Testing M4 remeshing formula in 3D, 1 kernel, o2_FullHalf splitting. """ scal, velo = setup_3D() @@ -454,7 +466,7 @@ def test_3D_m4_1k_sFH(): def test_3D_m4_2k_sFH(): """ - Testing M4 remeshing formula in 3D, 2 kernel, simple precision, + Testing M4 remeshing formula in 3D, 2 kernel, o2_FullHalf splitting. """ scal, velo = setup_3D() @@ -479,7 +491,7 @@ def test_3D_m4_2k_sFH(): # M8 testing def test_2D_m8_1k(): """ - Testing M8 remeshing formula in 2D, 1 kernel, simple precision, + Testing M8 remeshing formula in 2D, 1 kernel, o2 splitting. """ scal, velo = setup_2D() @@ -503,7 +515,7 @@ def test_2D_m8_1k(): def test_2D_m8_2k(): """ - Testing M8 remeshing formula in 2D, 2 kernel, simple precision, + Testing M8 remeshing formula in 2D, 2 kernel, o2 splitting. """ scal, velo = setup_2D() @@ -527,12 +539,12 @@ def test_2D_m8_2k(): def test_2D_m8_1k_sFH(): """ - Testing M8 remeshing formula in 2D, 1 kernel, simple precision, + Testing M8 remeshing formula in 2D, 1 kernel, o2_FullHalf splitting. """ scal, velo = setup_2D() - advec = Advection(velo, scal,discretization=d2d, + advec = Advection(velo, scal, discretization=d2d, method={TimeIntegrator: RK2, Interpolation: Linear, Remesh: M8Prime, @@ -551,7 +563,7 @@ def test_2D_m8_1k_sFH(): def test_2D_m8_2k_sFH(): """ - Testing M8 remeshing formula in 2D, 2 kernel, simple precision, + Testing M8 remeshing formula in 2D, 2 kernel, o2_FullHalf splitting. """ scal, velo = setup_2D() @@ -575,7 +587,7 @@ def test_2D_m8_2k_sFH(): def test_3D_m8_1k(): """ - Testing M8 remeshing formula in 3D, 1 kernel, simple precision, + Testing M8 remeshing formula in 3D, 1 kernel, o2 splitting. """ scal, velo = setup_3D() @@ -599,7 +611,7 @@ def test_3D_m8_1k(): def test_3D_m8_2k(): """ - Testing M8 remeshing formula in 3D, 2 kernel, simple precision, + Testing M8 remeshing formula in 3D, 2 kernel, o2 splitting. """ scal, velo = setup_3D() @@ -623,7 +635,7 @@ def test_3D_m8_2k(): def test_3D_m8_1k_sFH(): """ - Testing M8 remeshing formula in 3D, 1 kernel, simple precision, + Testing M8 remeshing formula in 3D, 1 kernel, o2_FullHalf splitting. """ scal, velo = setup_3D() @@ -647,7 +659,7 @@ def test_3D_m8_1k_sFH(): def test_3D_m8_2k_sFH(): """ - Testing M8 remeshing formula in 3D, 2 kernel, simple precision, + Testing M8 remeshing formula in 3D, 2 kernel, o2_FullHalf splitting. """ scal, velo = setup_3D() @@ -671,7 +683,7 @@ def test_3D_m8_2k_sFH(): def test_2D_l6_2k(): """ - Testing Lambda6star remeshing formula in 2D, 2 kernel, simple precision, + Testing Lambda6star remeshing formula in 2D, 2 kernel, o2 splitting. """ scal, velo = setup_2D() @@ -688,7 +700,7 @@ def test_2D_l6_2k(): def test_2D_l6_1k_sFH(): """ - Testing Lambda6star remeshing formula in 2D, 1 kernel, simple precision, + Testing Lambda6star remeshing formula in 2D, 1 kernel, o2_FullHalf splitting. """ scal, velo = setup_2D() @@ -705,7 +717,7 @@ def test_2D_l6_1k_sFH(): def test_2D_l6_2k_sFH(): """ - Testing Lambda6star remeshing formula in 2D, 2 kernel, simple precision, + Testing Lambda6star remeshing formula in 2D, 2 kernel, o2_FullHalf splitting. """ scal, velo = setup_2D() @@ -722,7 +734,7 @@ def test_2D_l6_2k_sFH(): def test_3D_l6_1k(): """ - Testing Lambda6star remeshing formula in 3D, 1 kernel, simple precision, + Testing Lambda6star remeshing formula in 3D, 1 kernel, o2 splitting. """ scal, velo = setup_3D() @@ -739,7 +751,7 @@ def test_3D_l6_1k(): def test_3D_l6_2k(): """ - Testing Lambda6star remeshing formula in 3D, 2 kernel, simple precision, + Testing Lambda6star remeshing formula in 3D, 2 kernel, o2 splitting. """ scal, velo = setup_3D() @@ -756,7 +768,7 @@ def test_3D_l6_2k(): def test_3D_l6_1k_sFH(): """ - Testing Lambda6star remeshing formula in 3D, 1 kernel, simple precision, + Testing Lambda6star remeshing formula in 3D, 1 kernel, o2_FullHalf splitting. """ scal, velo = setup_3D() @@ -773,7 +785,7 @@ def test_3D_l6_1k_sFH(): def test_3D_l6_2k_sFH(): """ - Testing Lambda6star remeshing formula in 3D, 2 kernel, simple precision, + Testing Lambda6star remeshing formula in 3D, 2 kernel, o2_FullHalf splitting. """ scal, velo = setup_3D() diff --git a/HySoP/hysop/numerics/integrators/euler.py b/HySoP/hysop/numerics/integrators/euler.py index c65192afc17d0468a09a8fdf3e82cf324eac9693..4151970e0fdfcee63d85605a101fe49973d0a236 100755 --- a/HySoP/hysop/numerics/integrators/euler.py +++ b/HySoP/hysop/numerics/integrators/euler.py @@ -51,7 +51,7 @@ class Euler(ODESolver): # result = y + dt * work0 # result = y + work0 - [np.add(y[i], self.work[i] * dt, result[i]) + [np.add(y[i], self.work[i] * dt, result[i]) for i in xrange(self._nbComponents)] return result diff --git a/HySoP/hysop/operator/discrete/drag_and_lift.py b/HySoP/hysop/operator/discrete/drag_and_lift.py index 7782cf0056127a1b600703ecb2eb9af0f4f88690..ebe521df43a3008709ee5cbbdbe1e6dfc7ae942e 100644 --- a/HySoP/hysop/operator/discrete/drag_and_lift.py +++ b/HySoP/hysop/operator/discrete/drag_and_lift.py @@ -179,6 +179,7 @@ class MomentumForces(Forces): for d in xrange(nbc)] self.force[...] = 1. / dt * (self._buffer - self._previous) # Update previous for next time step ... + # Which value must we choose for previous?? self._previous[...] = self._buffer[...] @@ -593,18 +594,18 @@ class NocaIII(NocaForces): dsurf = npw.prod(self._topology.mesh.space_step[i_t]) self._buffer[...] = 0.0 # First, part relative to "du/dt" - self._compute_gamma_impulse(dt, s_x0, -1, 2 * d, self._buffer) + self._compute_gamma_flux(dt, s_x0, -1, 2 * d, self._buffer) self._compute_gamma_common(s_x0, -1, 2 * d, self._buffer) self.force += self._buffer * dsurf self._buffer[...] = 0.0 - self._compute_gamma_impulse(dt, s_xn, 1, 2 * d + 1, self._buffer) + self._compute_gamma_flux(dt, s_xn, 1, 2 * d + 1, self._buffer) self._compute_gamma_common(s_xn, 1, 2 * d + 1, self._buffer) self.force += self._buffer * dsurf self.force *= self._normalization self._update_buffers() - def _compute_gamma_impulse(self, dt, surf, normal, s_id, res): + def _compute_gamma_flux(self, dt, surf, normal, s_id, res): # i_n : normal dir # i_t : other dirs i_n = surf.n_dir diff --git a/HySoP/hysop/operator/discrete/penalization_and_curl.py b/HySoP/hysop/operator/discrete/penalize_vorticity.py similarity index 87% rename from HySoP/hysop/operator/discrete/penalization_and_curl.py rename to HySoP/hysop/operator/discrete/penalize_vorticity.py index e4830a206ffd502acbe747d428bbbe1c4e786c40..f0fa15ddf5d60fd51be889e724134909b7b20a03 100644 --- a/HySoP/hysop/operator/discrete/penalization_and_curl.py +++ b/HySoP/hysop/operator/discrete/penalize_vorticity.py @@ -7,7 +7,7 @@ from hysop.constants import debug from hysop.operator.discrete.penalization import Penalization -class PenalizationAndCurl(Penalization): +class PenalizeVorticity(Penalization): """ Discretized penalisation operator. See details in hysop.operator.penalization @@ -21,7 +21,7 @@ class PenalizationAndCurl(Penalization): somebuffer = curl(penalized vorticity) """ assert 'variables' not in kwds, 'variables parameter is useless.' - super(PenalizationAndCurl, self).__init__(variables=[vorticity, + super(PenalizeVorticity, self).__init__(variables=[vorticity, curl.invar], **kwds) self.velocity = curl.invar @@ -33,10 +33,11 @@ class PenalizationAndCurl(Penalization): def _apply_single_coeff(self, dt): coeff = -dt * self._coeff / (1.0 + dt * self._coeff) + print coeff self._penalize(self.velocity, coeff, self._cond) self._curl.apply() for d in xrange(self.vorticity.nbComponents): - self.vorticity[d][...] += self._curl.invar[d] + self.vorticity[d][self._cond] += self._curl.outvar[d][self._cond] coeff = -1. / (dt * self._coeff) self._penalize(self.velocity, coeff, self._cond) @@ -47,7 +48,7 @@ class PenalizationAndCurl(Penalization): self._penalize(self.velocity, coeff, cond) self._curl.apply() for d in xrange(self.vorticity.nbComponents): - self.vorticity[d][...] += self._curl.invar[d] + self.vorticity[d][self._cond] += self._curl.outvar[d][self._cond] for i in xrange(len(self._cond)): coeff = -1. / dt * self._coeff[i] cond = self._cond[i] diff --git a/HySoP/hysop/operator/discrete/stretching.py b/HySoP/hysop/operator/discrete/stretching.py index 66236a7cc4c88191144d040ea883db7801a0ed16..38f6e52f2d994b63c21d073c05322881c9ce539e 100755 --- a/HySoP/hysop/operator/discrete/stretching.py +++ b/HySoP/hysop/operator/discrete/stretching.py @@ -2,7 +2,7 @@ """ @file operator/discrete/stretching.py -Discretisation of the stretching operator for two different formulations. +Discretisation of the stretching operator for different formulations. """ from hysop.constants import debug, WITH_GUESS @@ -25,9 +25,10 @@ ceil = math.ceil class Stretching(DiscreteOperator): """ Abstract interface to stretching discrete operators. - Two formulations are available: + Three formulations are available: - conservative, see operator.discrete.stretching.Conservative - 'Grad(UxW), see operator.discrete.stretching.GradUW + - Symmetric, see operator.discrete.stretching.Symmetric """ __metaclass__ = ABCMeta @@ -242,3 +243,49 @@ class GradUW(Stretching): subdt[:] = dt_stab subdt[-1] = dt - (nb_cycles - 1) * dt_stab return nb_cycles, subdt + + +class Symmetric(Stretching): + """ + Discretisation of the following problem : + \f{eqnarray*} \frac{\partial\omega}{\partial t} = \frac{1}{2}(\nabla(v) + \nabla(v)^T)\omega \f} + """ + def __init__(self, **kwds): + super(Symmetric, self).__init__(formulation=diff_op.DivWV, **kwds) + + # Time integration scheme. + def rhs(t, y, result): + result = self.strFunc(y, self.velocity.data, result) + return result + + # Create the time integrator + self.timeIntegrator = \ + self.method[TimeIntegrator](self.nbComponents, + self._ti_work, + self.velocity.topology, + f=rhs, + optim=WITH_GUESS) + + @debug + @profile + def apply(self, simulation=None): + assert simulation is not None, \ + "Missing simulation value for computation." + + # time step + dt = simulation.timeStep + # current time + t = simulation.time + # Synchronize ghost points of velocity and vorticity + self._synchronize(self.velocity.data + self.vorticity.data) + # - Call time integrator - + # Init workspace with a first evaluation of the + # rhs of the integrator + self._ti_work[:self.nbComponents] = \ + self.timeIntegrator.f(t, self.vorticity.data, + self._ti_work[:self.nbComponents]) + # perform integration and save result in-place + self.vorticity.data = self.timeIntegrator(t, self.vorticity.data, dt, + result=self.vorticity.data) + + diff --git a/HySoP/hysop/operator/penalization_and_curl.py b/HySoP/hysop/operator/penalize_vorticity.py similarity index 90% rename from HySoP/hysop/operator/penalization_and_curl.py rename to HySoP/hysop/operator/penalize_vorticity.py index 2bdccc7a34646ac4503dbcb7152c3d9fa6eba83c..1cd39ab43f03cd606eba48b3c62ec6130443c8ac 100644 --- a/HySoP/hysop/operator/penalization_and_curl.py +++ b/HySoP/hysop/operator/penalize_vorticity.py @@ -5,8 +5,8 @@ Compute the vorticity field from velocity using penalization. """ from hysop.operator.penalization import Penalization -from hysop.operator.discrete.penalization_and_curl\ - import PenalizationAndCurl as PAC +from hysop.operator.discrete.penalize_vorticity\ + import PenalizeVorticity as PW from hysop.constants import debug from hysop.operator.continuous import opsetup import hysop.default_methods as default @@ -17,7 +17,7 @@ from hysop.operator.differential import Curl from hysop.fields.continuous import Field -class PenalizationAndCurl(Penalization): +class PenalizeVorticity(Penalization): """ Solve \f{eqnarray*} @@ -33,7 +33,7 @@ class PenalizationAndCurl(Penalization): @param[in,out] vorticity : vorticity field """ assert 'variables' not in kwds, 'variables parameter is useless.' - super(PenalizationAndCurl, self).__init__(variables=[velocity, + super(PenalizeVorticity, self).__init__(variables=[velocity, vorticity], **kwds) ## velocity field @@ -57,7 +57,7 @@ class PenalizationAndCurl(Penalization): else: raise ValueError("Unknown method for space discretization of the\ differential operator in penalization.") - super(PenalizationAndCurl, self)._standard_discretize(nbGhosts) + super(PenalizeVorticity, self)._standard_discretize(nbGhosts) # all variables must have the same resolution assert self._single_topo, 'multi-resolution case not allowed.' topo = self.variables[self.velocity] @@ -78,7 +78,7 @@ class PenalizationAndCurl(Penalization): @opsetup def setup(self, rwork=None, iwork=None): self._curl.setup(rwork, iwork) - self.discrete_op = PAC( + self.discrete_op = PW( vorticity=self.discreteFields[self.vorticity], curl=self._curl.discrete_op, obstacles=self.obstacles, diff --git a/HySoP/hysop/operator/tests/Testing/Temporary/CTestCostData.txt b/HySoP/hysop/operator/tests/Testing/Temporary/CTestCostData.txt deleted file mode 100644 index ed97d539c095cf1413af30cc23dea272095b97dd..0000000000000000000000000000000000000000 --- a/HySoP/hysop/operator/tests/Testing/Temporary/CTestCostData.txt +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/HySoP/hysop/operator/tests/Testing/Temporary/LastTest.log b/HySoP/hysop/operator/tests/Testing/Temporary/LastTest.log deleted file mode 100644 index b448b0555ed69bab888caa8f66c3534ccd6779ed..0000000000000000000000000000000000000000 --- a/HySoP/hysop/operator/tests/Testing/Temporary/LastTest.log +++ /dev/null @@ -1,3 +0,0 @@ -Start testing: Mar 12 09:26 CET ----------------------------------------------------------- -End testing: Mar 12 09:26 CET diff --git a/HySoP/hysop/operator/tests/parmesfftw.log b/HySoP/hysop/operator/tests/parmesfftw.log deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/HySoP/hysop/operator/tests/ref_files/p1/penal_vort_2d_sphere_00000.h5 b/HySoP/hysop/operator/tests/ref_files/p1/penal_vort_2d_sphere_00000.h5 index d0779a1c34acf4208bcfbe548bcd0590d303e055..19a24964eface15840a192db6f330388f07117dc 100644 Binary files a/HySoP/hysop/operator/tests/ref_files/p1/penal_vort_2d_sphere_00000.h5 and b/HySoP/hysop/operator/tests/ref_files/p1/penal_vort_2d_sphere_00000.h5 differ diff --git a/HySoP/hysop/operator/tests/ref_files/p1/penal_vort_3d_sphere_00000.h5 b/HySoP/hysop/operator/tests/ref_files/p1/penal_vort_3d_sphere_00000.h5 index f24b078890d67f888944759308dccf7f3bce961d..c0287248cf6f7a0591091629dc0792362aef4b2b 100644 Binary files a/HySoP/hysop/operator/tests/ref_files/p1/penal_vort_3d_sphere_00000.h5 and b/HySoP/hysop/operator/tests/ref_files/p1/penal_vort_3d_sphere_00000.h5 differ diff --git a/HySoP/hysop/operator/tests/ref_files/p8/penal_vort_2d_sphere_00000.h5 b/HySoP/hysop/operator/tests/ref_files/p8/penal_vort_2d_sphere_00000.h5 index 4498067bae1dd707b895bf3d0a014eac1ca34afe..4cda70e51b59a4f2140fa3249bd81aaafdcf0179 100644 Binary files a/HySoP/hysop/operator/tests/ref_files/p8/penal_vort_2d_sphere_00000.h5 and b/HySoP/hysop/operator/tests/ref_files/p8/penal_vort_2d_sphere_00000.h5 differ diff --git a/HySoP/hysop/operator/tests/ref_files/p8/penal_vort_3d_sphere_00000.h5 b/HySoP/hysop/operator/tests/ref_files/p8/penal_vort_3d_sphere_00000.h5 index 37f3155499a58ba5a077b0aa8665f4b079c6b806..adaff3819b40dd732f71a244602e4b6cd72a8890 100644 Binary files a/HySoP/hysop/operator/tests/ref_files/p8/penal_vort_3d_sphere_00000.h5 and b/HySoP/hysop/operator/tests/ref_files/p8/penal_vort_3d_sphere_00000.h5 differ diff --git a/HySoP/hysop/operator/tests/test_drag_and_lift.py b/HySoP/hysop/operator/tests/test_drag_and_lift.py index cebb1eb2c8589f6b9435120cca42379539d97247..dbce593d3384346ec70e3bf27c9068be35974bf3 100644 --- a/HySoP/hysop/operator/tests/test_drag_and_lift.py +++ b/HySoP/hysop/operator/tests/test_drag_and_lift.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- from hysop.domain.subsets.sphere import Sphere -from hysop.operator.penalization import Penalization -from hysop.operator.penalization_and_curl import PenalizationAndCurl +from hysop.operator.penalize_vorticity import PenalizeVorticity from hysop.problem.simulation import Simulation from hysop.tools.parameters import Discretization, IO_params from hysop.mpi.topology import Cartesian @@ -104,9 +103,9 @@ def test_momentum_forces_3D(): vorti = Field(domain=topo.domain, formula=v3d, name='Vorti', isVector=True) velo = Field(domain=topo.domain, formula=v3d, name='Velo', isVector=True) hsphere = Sphere(parent=topo.domain, origin=xpos, radius=rd) - penal = PenalizationAndCurl(velocity=velo, vorticity=vorti, - discretization=topo, - obstacles=[hsphere], coeff=1e8) + penal = PenalizeVorticity(velocity=velo, vorticity=vorti, + discretization=topo, + obstacles=[hsphere], coeff=1e8) penal.discretize() penal.setup() diff --git a/HySoP/hysop/operator/tests/test_hdf5/testIO_scal.xmf b/HySoP/hysop/operator/tests/test_hdf5/testIO_scal.xmf deleted file mode 100644 index 167c44c016c1bae9db38c54b879c7400eaa3d5f1..0000000000000000000000000000000000000000 --- a/HySoP/hysop/operator/tests/test_hdf5/testIO_scal.xmf +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" ?> -<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd"> -<Xdmf Version="2.0"> - <Domain> - <Grid Name="CellTime" GridType="Collection" CollectionType="Temporal"> - <Grid Name="Iteration 000" GridType="Uniform"> - <Time Value="0.0" /> - <Topology TopologyType="3DCORECTMesh" NumberOfElements="64 64 64 "/> - <Geometry GeometryType="ORIGIN_DXDYDZ"> - <DataItem Dimensions="3 " NumberType="Float" Precision="4" Format="XML"> - -1.0 -1.0 -1.0 - </DataItem> - <DataItem Dimensions="3 " NumberType="Float" Precision="8" Format="XML"> - 0.03125 0.03125 0.03125 - </DataItem> - </Geometry> - <Attribute Name="ScalRef3D_0_X" AttributeType="Scalar" Center="Node"> - <DataItem Dimensions="64 64 64 " NumberType="Float" Precision="8" Format="HDF" Compression="Raw"> - testIO_scal_00000.h5:/ScalRef3D_0_X - </DataItem> - </Attribute> - </Grid> - <Grid Name="Iteration 001" GridType="Uniform"> - <Time Value="0.3" /> - <Topology TopologyType="3DCORECTMesh" NumberOfElements="64 64 64 "/> - <Geometry GeometryType="ORIGIN_DXDYDZ"> - <DataItem Dimensions="3 " NumberType="Float" Precision="4" Format="XML"> - -1.0 -1.0 -1.0 - </DataItem> - <DataItem Dimensions="3 " NumberType="Float" Precision="8" Format="XML"> - 0.03125 0.03125 0.03125 - </DataItem> - </Geometry> - <Attribute Name="ScalRef3D_0_X" AttributeType="Scalar" Center="Node"> - <DataItem Dimensions="64 64 64 " NumberType="Float" Precision="8" Format="HDF" Compression="Raw"> - testIO_scal_00001.h5:/ScalRef3D_0_X - </DataItem> - </Attribute> - </Grid> - </Grid> - </Domain> -</Xdmf> diff --git a/HySoP/hysop/operator/tests/test_hdf5/testIO_scal_00000.h5 b/HySoP/hysop/operator/tests/test_hdf5/testIO_scal_00000.h5 deleted file mode 100644 index 3a2446225bd61bbf04a60851a154984eae08d2fc..0000000000000000000000000000000000000000 Binary files a/HySoP/hysop/operator/tests/test_hdf5/testIO_scal_00000.h5 and /dev/null differ diff --git a/HySoP/hysop/operator/tests/test_hdf5/testIO_scal_00001.h5 b/HySoP/hysop/operator/tests/test_hdf5/testIO_scal_00001.h5 deleted file mode 100644 index 3a2446225bd61bbf04a60851a154984eae08d2fc..0000000000000000000000000000000000000000 Binary files a/HySoP/hysop/operator/tests/test_hdf5/testIO_scal_00001.h5 and /dev/null differ diff --git a/HySoP/hysop/operator/tests/test_penalization.py b/HySoP/hysop/operator/tests/test_penalization.py index 8c94c52928a2b375c0bbebe5dc1b01a56e6c676e..d85d72d04de9a09f2529238e73f8531c2ef4b825 100644 --- a/HySoP/hysop/operator/tests/test_penalization.py +++ b/HySoP/hysop/operator/tests/test_penalization.py @@ -3,7 +3,7 @@ from hysop.domain.subsets.sphere import HemiSphere, Sphere from hysop.domain.subsets.cylinder import Cylinder from hysop.domain.subsets.porous import Porous from hysop.operator.penalization import Penalization -from hysop.operator.penalization_and_curl import PenalizationAndCurl +from hysop.operator.penalize_vorticity import PenalizeVorticity from hysop.problem.simulation import Simulation from hysop.tools.parameters import Discretization, IO_params from hysop.mpi.topology import Cartesian @@ -275,14 +275,13 @@ def check_penal_vort(penal, wref, vref, vorti, velo): velo.initialize(topo=topo) vd = velo.discretize(topo) wd = vorti.discretize(topo) - simu = Simulation(nbIter=3) - penal.apply(simu) ind = topo.mesh.iCompute + + simu = Simulation(nbIter=200) + penal.apply(simu) for d in xrange(vd.nbComponents): - print np.max(np.abs(vd.data[d][ind]- vref.data[d][ind])),np.max(np.abs((vd.data[d][ind]- vref.data[d][ind])/vd.data[d][ind])) assert np.allclose(vd.data[d][ind], vref.data[d][ind]) for d in xrange(wd.nbComponents): - print np.max(np.abs(wd.data[d][ind]- wref.data[d][ind])),np.max(np.abs((wd.data[d][ind]- wref.data[d][ind])/wd.data[d][ind])) assert np.allclose(wd.data[d][ind], wref.data[d][ind]) @@ -299,9 +298,9 @@ def test_penal_vort_2D(): vorti = Field(domain=topo.domain, formula=s2d, name='Vorti') velo = Field(domain=topo.domain, formula=v2d, name='Velo', isVector=True) hsphere = HemiSphere(parent=topo.domain, origin=xpos[:2], radius=rd) - penal = PenalizationAndCurl(velocity=velo, vorticity=vorti, - discretization=topo, - obstacles=[hsphere], coeff=1e8) + penal = PenalizeVorticity(velocity=velo, vorticity=vorti, + discretization=topo, + obstacles=[hsphere], coeff=1e8) hsphere.discretize(topo) check_penal_vort(penal, wref, vref, vorti, velo) @@ -319,9 +318,9 @@ def test_penal_vort_3D(): vorti = Field(domain=topo.domain, formula=v3d, name='Vorti', isVector=True) velo = Field(domain=topo.domain, formula=v3d, name='Velo', isVector=True) hsphere = HemiSphere(parent=topo.domain, origin=xpos, radius=rd) - penal = PenalizationAndCurl(velocity=velo, vorticity=vorti, - discretization=topo, - obstacles=[hsphere], coeff=1e8) + penal = PenalizeVorticity(velocity=velo, vorticity=vorti, + discretization=topo, + obstacles=[hsphere], coeff=1e8) check_penal_vort(penal, wref, vref, vorti, velo)