Changelog¶
New in version 1.5 (2022-12-13)¶
Major changes¶
The
XieDelhommeauimplementation of the Green function has been improved. The implementation used to be almost the same as the defaultDelhommeaumethod. A missing key element has been added and theXieDelhommeauis now actually more accurate near the free surface. (PR180 and PR216)New default linear solver
LUSolverWithCache: the LU decomposition of the matrix is now cached to be reused for other similar problems, diminishing the total computation time up to 40%. (PR235)New functions to generate simple geometric meshes have been implemented in
capytaine.meshes.predefined. They are similar to the former geometric bodies (Sphere,HorizontalCylinder, etc.), except that they return a mesh and do not create aFloatingBody. The geometric body classes are considered deprecated, although they should still work as expected. (PR233)Changed the behavior of
compute_hydrostatics(). The mesh is not silently modified anymore. The stiffness and inertia matrices are stored in the body for inclusion in the output dataset. The inertia matrix is now computed on the full mesh (GH197, GH249, GH258 and PR262).
Minor changes¶
Add
floating_point_precisionargument toDelhommeau()andXieDelhommeau()that accepts either"float32"for single precision computations or"float64"for double precision computations (the latter is the default). (PR224).Passing the argument
tabulation_nr=0ortabulation_nz=0toDelhommeauorXieDelhommeaunow allows to run the code without interpolating the Green function from a precomputed tabulation. This is meant as a tools for benchmarks and validation, since it decreases the performance of the code for often no accuracy gain. (PR229)load_mesh()is now exported by the main namespace:from capytaine import load_mesh. The documentation has been changed to recommend the use of this function instead offrom_file(). (PR231)When initializing a
FloatingBody, one can now pass directly a mesh object frommeshio. The documentation has been changed to recommend this approach instead offrom_meshio(). (GH259 and PR261)When joining two bodies as e.g.
body1 + body2, some hydrostatic properties are passed to the resulting body: if all the bodies have hydrostatic stiffness matrices or inertia matrices defined, then they are assigned to the joined body as a larger block diagonal matrix (PR243).Add
immersed_part()method to clip the body without modifying it in place (PR244).Add
rigid_body_dofs()method returning a placeholder that can be given at the creation ofFloatingBodyto initialize the six rigid body dofs (PR245).Custom classes from the
capytaine.matricesmodule storing block matrices or data-sparse matrices can be transformed into full Numpy arrays withnp.array(...)(PR99)Add
Dockerfileand instructions to install with Docker (PR137)Add optional arguments to
write_GDF()to write parametersulen, grav, isx, isyto the mesh file (PR241)Several surface integrals properties of
FloatingBodiesare also defined on meshes, such asvolumeorcenter_of_buoyancy(pull:263).
Internals¶
The integration of the pressure on the mesh of the body was implemented twice independently. It has been factored out in
integrate_pressure()(PR218)__rmatmul__ has been implemented for low rank matrices (PR222).
New implementation of the GDF mesh file reader
load_GDF()(PR241)
New in version 1.4.2 (2022-10-03)¶
Bug fixes¶
Raise error message when calling
compute_hydrostatics()without a center of mass defined (PR207).Fix bug when cropping body with a dof defined manually as a list of tuples (GH204 and PR206).
Documentation¶
Internals¶
Replace the Fortran core by a git submodule pointing to libDelhommeau (PR208). Future developments of the Green function will take place there.
Move from Travis CI to Github Actions for continuous integration (PR209)
New in version 1.4.1 (2022-09-05)¶
Bug fixes¶
Fix bug in hydrostatics of rigid bodies: the hydrostatic matrices were always assuming that the rotation dofs were defined around the \((0, 0, 0)\) point. The stiffness and inertia matrix are now invariant by horizontal translation of the body, as they should be. (GH178 and PR196).
Removed outdated volume/area methods from pre-defined bodies (PR183).
Added symmetric realization and reflection to gdf mesh import (GH186 and PR187).
Fix some automatic mesh names (PR195)
Fix ordering of the dofs when using
assemble_regular_array()(GH198 and PR199)Return more explicit error message when the center of mass is missing for the computation of rigid-body hydrostatics (PR201).
Return error message when trying to animate a body with a dof that has not been defined. Previously, undefined dofs were silently ignored. (PR202)
New in version 1.4 (2022-07-07)¶
Major changes¶
The function that used to be called
impedanceis now namedrao_transfer_function(). The new functionimpedance()is the actual impedance matrix (PR142, GH147, PR149).The mass matrix of a floating body used to be denoted
mass. It is now denoteinertia_matrix. The attributebody.massis now used instead for the (scalar) mass of the body. (PR165)Implementation of
Spherehas changed. The use of symmetry is now controlled by theaxial_symmetrykeyword argument. Thecleverkeyword argument is deprecated forSphereand should be replaced by the more explicit keyword argumentsaxial_symmetry. Meanwhile, a bug has been fixed with itsgeometric_center(PR150).The default linear solver is the direct solver and not the iterative solver GMRES, because it is more robust and more predictable. Nothing changes when users explicitely choose a linear solver. (PR171)
Bug fixes¶
Fix major bug in impedance matrix and RAO computation: the sign of the dissipation matrix was wrong in previous versions (GH102 and PR140).
Fix major inaccuracy for deep panels or high frequencies, that is panels deeper than \(1.2\lambda\) below the free surface where \(\lambda\) is the wavelength (GH38 and PR156)
Wave directions in
Nemoh.calare interpreted as degrees as they should be (and then converted to radians to be handled by the rest of the code). (PR141)Fix bug in rotations around axis that does not pass by (0, 0, 0) (GH151 and PR152).
New implementation of the mesh importer for
hstfiles. (PR90) It should be more robust and support more variants of thehstmesh file format.Support for quadratures from quadpy has been updated to support the version 0.16.16 of quadpy (PR164).
New features¶
Add method to compute some of the hydrostatic parameters such as volume, buoyancy center, wet surface area, hydrostatic stiffness, inertia matrix etc.
compute_hydrostaticsmethod is created to return all hydrostatic parameters similar tomeshmagick.hydrostatics.compute_hydrostatics(PR106). By default, the hydrostatics are computed assuming a neutrally buoyant body (its mass is the displaced mass of water). Non-neutrally buoyant are partially supported, by setting themassattribute of the body (PR166)Add new parallelization using the joblib library as a new optional dependency. The optional keyword-argument
n_jobsin thesolve_all()andfill_dataset()controls the number of processes running in parallel (PR136). By default, this parallelisation is disabled (PR172).Refactor Delhommeau’s method for the Green function evaluation. The size of the tabulation is not hard-coded anymore and can be changed by users. (GH20 and PR157)
Method
show_matplotlibcan now colour mesh faces based on a specified scalar field (e.g. pressure) (PR122).The functions
problems_from_dataset()andfill_dataset()accept a body alone as input. That is, one can usefill_dataset(test_matrix, body)and not onlyfill_dataset(test_matrix, [body])(PR144).
Documentation and error handling¶
- Improve feedback to users:
Print a warning if the user provides a
wave_directionthat is not in the range [-2π, 2π]. (PR141)Raise an error when the Green function evaluation returns a
NaN(PR143).Improve message when the GMRES did not converge (PR143).
Raise an error when a body with an empty mesh is given to
LinearPotentialFlowProblem(GH128 and PR145).Print a warning when a key is unknown in the test matrix provided to
fill_dataset()(PR155).Raise an error if neither
radiating_dof(for radiation problems) norwave_direction(for diffraction problems) is provided in the test matrix infill_dataset()(PR155).
A new example using Haskind’s relation has been added to the cookbook (PR129).
Miscellaneous improvements of the documentation.
New in version 1.3 (2021-10-07)¶
Major changes¶
The mesh are always “healed” when a new
FloatingBodyis initialised (i.e. unused vertices are removed, degenerate triangles are removed, etc.). See for instance GH46.Implementation of symmetries for
HorizontalCylinderhas changed. The cylinder is now a reflection of two halves containing translational repetition of half rings, instead of a translational repetition of symmetric ring. By default, only reflection symmetry is used. (PR91) The use of symmetries can be controlled withtranslation_symmetryandreflection_symmetryoptional keyword arguments. Thecleverkeyword argument is deprecated forHorizontalCylinderand should be replaced by the new more explicit keyword arguments above.
New features¶
Add method
FloatingBody.from_meshioto import meshio and pygmsh mesh objects (PR62)Add method
FloatingBody.assemble_arbitrary_arrayto make an array of bodies with arbitrary layout (PR71).Break out impedance from RAO to separate function (GH61 and PR63).
Method problems_from_dataset can now use a list of gravitational acceleration g values in the test matrix (PR86).
Add example in cookbook for computing hydrostatics and mass properties with Meshmagick 2 (PR70).
Bug fixes¶
Fix bug in free surface elevation computation when the number of faces in the free surface mesh is not a multiple of the chunk size, that is by default a multiple of 50 (PR82).
The function
assemble_datasetdid not support well the problems without a free surface. In the new version, such problems are explicitly ignored and a warning message is displayed. (GH88 and PR89).Fix bug in some of the mesh readers/writers when using pathlib path objects (PR87).
Function
load_GDFhas been rewritten to accept any GDF file format (PR97).
Internal and development¶
New in version 1.2.1 (2021-04-14)¶
New in version 1.2 (2020-04-24)¶
Experimental implementation of higher order quadratures for the integration of the Green function on the mesh. Default behavior is still the first order integration as in Nemoh.
Add method
FloatingBody.animateto quickly visualize the motion of a body and add methodAnimation.embed_in_notebookto embed animations in Jupyter notebooks.Keep the order of the dofs in xarray’s Datasets. This patch uses the CategoricalIndex feature of xarray which was buggy before version 0.15.1 of xarray. Thus this minimal version is now required.
Add missing Kochin function for the diffraction. (See GH22.) In previous version the variable named
kochinin the dataset was only the Kochin function for the radiated waves. A new variable nameskochin_diffractionhas been added. The existing variablekochinhas not been renamed, for backward compatibility, but might be in a future release of Capytaine.Improvement of caching to limit RAM usage for large problems.
Make optional the dependency to graphical packages (matplotlib and vtk). They were causing issues to some users.
problems_and_results.pyhas been rewritten to be slightly more readable and remove the dependency to attrs.
New in version 1.1 (2019-09-24)¶
Major changes¶
Refactoring of the implementation of the solver. The new implementation separates the solver itself from the evaluation of the Green function and the matrix building engine. This more modular structure allows user to choose separately the Green function and the matrix engine that they want to use.
The former API (
Nemoh()object) has been kept for backward compatibility. In most cases, replacingNemoh()byBEMSolver()is sufficient to migrate to the new structure.See Resolution for the full documentation of the new structure and Cookbook for examples.
Add Xie’s variant of Delhommeau’s Green function
XieDelhommeau[X18].The option cache_rankine_matrices has been removed. It was impeding the performance and modularity of the code for a very low gain. It might be reimplemented in a future version if there is really a need for it.
Minor changes¶
Minor performance improvements.
Fix Github issue #18.
Improve test suite.
New in version 1.0.1 (2019-03-28)¶
Minor changes¶
Fix compilation flags for OpenMP
Minor corrections in the documentation.
New in version 1.0 (2019-03-14)¶
Major changes¶
The
angleparameter has been renamed to the more accurate namewave_direction.Most of the modules have been reorganized in several packages. See the Overview of the modules for some details.
Test compatibility of the code with Python 3.7 and numpy 1.16.
Remove a couple of unmaintained or unfinished submodules.
Minor changes¶
General¶
Many improvements of the documentation.
Reorganization of some of the tests.
Various small performance improvement.
Mesh and bodies¶
Rename
centerinto eithergeometric_centerorcenter_of_massdepending of the case.New method for geometric bodies
rotate_around_center_to_align_vectorsreplacingrotate_to_align_axes.Add methods
sliced_by_planeandmincedfor hierarchical decomposition of the mesh.Symmetric meshes classes have been renamed:
ReflectionSymmetry -> ReflectionSymmetricMesh etc.
Plane are now oriented: they are equal only if their normal point in the same direction.
Solver¶
Store solver settings in output dataset.
Rename setting
use_symmetriesintohierarchical_toeplitz_matrices.Fix bugs and improve implementation of the Adaptive Cross Approximation.
New in version 0.6 (2019-02-11)¶
Major changes¶
Full rewrite of the matrices and linear solvers implementation. All the relevant code is now in the submodule
capytaine.matrices.Refactored implementation of block Toeplitz matrices, block symmetric Toeplitz matrices and block circulant matrices. Refactoring of the block diagonalization of block circulant matrices through FFT.
Low rank approximation of the matrices with Adaptive Cross Approximation for the use of hierarchical matrices.
Option to solve the linear system with GMRES instead of a direct solver.
Refactoring of the 3D animation module for animation of the body motions, animated colormap of the pressure, free-surface elevation and export as a video. See cookbook for an example of the new API.
Minor changes¶
General¶
Reorganization of the
pytestdirectory.Add an experimental
capytaine.tools.raomodule to compute Response Amplitude Operators.Various bug fixes and improvements of the documentation.
Solver¶
More options to set the behavior of the solver at run time
Nemoh(use of symmetries, use of caching, choice of the linear solver, …). See its docstring for details.Change of default behavior: the solver stores the details in the
Resultcontainer when usingsolve, not when usingsolve_allorfill_dataset.The water density can be specified in the test matrix when using
fill_dataset.Function
kochin_datasetto build a xarray of Kochin function.Add the option
chunk_sizeto the computation of the free surface elevation in order to limit the RAM consumption.Minor refactoring of the solver and the computation of the Green function.
Meshes and bodies¶
CollectionOfMeshes is not a subclass of Tuple anymore.
New method
assemble_regular_arrayto build an array of identical bodies.Harmonize naming of functions that are not in-place:
symmetrize -> symmetrized,merge -> mergedRefactoring of the internals of the mesh clipper. New
clipandclippedmethods for meshes and bodies. When a body is clipped withcliporkeep_immersed_part, the dofs are updated.Change naming of dof when bodies are joined:
body_name__dof_nameinstead ofbody_name_dof_name.The combination of bodies with
+is associative with respect to the names of the dofs.Minor improvements of meshes and bodies
repr.
New in version 0.5.1 (2018-10-17)¶
Minor bugs fixes.
Small performance improvements.
Update documentation.
New in version 0.5 (2018-09-18)¶
Major changes¶
Experimental OpenMP parallelization of the computation of the influence matrices. The parallelization in
solve_allhas been removed.Integration of a refactored subset of Meshmagick into Capytaine as the
meshsubmodule. Meshmagick is not a dependency any more.Reorganization of the submodules:
capytaine.mesh_collection -> capytaine.mesh.meshes_collection
capytaine.symmetries -> capytaine.mesh.symmetries
capytaine.cli -> capytaine.ui.cli
capytaine.tools.vtk -> capytaine.ui.vtk
capytaine.tools.mpl_free_surface_animation -> capytaine.ui.mpl_free_surface_animation
capytaine.tools.import_export -> capytaine.io.legacy
capytaine.tools.bemio -> capytaine.io.bemio
meshmagick.mmio -> capytaine.io.mesh_loaders and capytaine.io.mesh_writers
Minor changes¶
Solver¶
Reorganization of the internals of the solver
Nemoh.pyandNemohCore. The initialization optionskeep_matricesandmax_stored_exponential_decompositionshave been removed. The former has been replaced by amatrix_cache_sizeoptional argument (default value: 1).Support of \(\omega=0\) and \(\omega=\infty\) in the infinite depth case.
The wavenumber is not computed in Fortran anymore.
Outputs¶
Some body properties are stored in xarray dataset if they are available. New functions
add_wavenumber_coordsandkochin_data_arrayallow the storage of wavenumbers and Kochin function in the dataset.New functions
separate_complex_valuesandmerge_complex_valuesincapytaine.io.xarrayto better handle complex values when saving datasets.New function
problems_from_datasetto generate a list of problems from the coordinates of a xarray dataset. New methodfill_datasetincapytaine.Nemoh.Nemohusing the above.New function
write_dataset_as_tecplot_files()incapytaine.toolsfor legacy Tecplot output.
Meshes¶
Refactoring of the transformation methods (
translate,rotate,mirror, …).They are still in place by default, although they now return a reference to the modified object.
They can return a new object by passing the argument
inplace=Falseor by using the variantstranslated,rotated,mirrored.rotateandrotatedrequires anAxisobject as argument. Old behavior can be found inrotate_anglesandrotated_angles.get_immersed_partis inplace by default. Useinplace=Falseto return a new object.
add_rotation_dofnow requires an Axis object.New method
tree_view()for meshes to display the structure of hierarchical collections of meshes.CollectionOfMeshesandSymmetricBodiesare now subclasses fromtuple. New methodsjoin_meshesto merge several symmetric bodies with the same symmetries as a single symmetric body.Various improvements in
geometric_bodiessubmodule, especially forRectangleandRectangularParallelepiped. They can now be generated with reflections symmetries instead of translation symmetries. NewVerticalCylinderclass.Refactored mesh objects can be checked for equality and are hashable. The method is experimental and can be improved.
New in version 0.4 (2018-08-04)¶
New features¶
Documentation and new usage examples.
Computation of Kochin coefficients.
Cleverer helper functions to define degrees of freedom.
Major changes¶
Backward-incompatible change of the way the degrees of freedom are stored.
Minor changes¶
Double precision computations.
Improvement of
assemble_datasetfor parametric studies.Support clipping of collections of meshes.
Fixes in geometrical bodies generation.