Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding of the math_tools/ folder and renaming of utils/math_tools.hpp into math_tools/Lnorm_tools.hpp #11

Closed
wants to merge 10 commits into from
Closed
2 changes: 1 addition & 1 deletion simulations/geometryRTheta/diocotron/diocotron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "euler.hpp"
#include "geometry.hpp"
#include "input.hpp"
#include "math_tools.hpp"
#include "l_norm_tools.hpp"
#include "output.hpp"
#include "paraconfpp.hpp"
#include "params.yaml.hpp"
Expand Down
2 changes: 1 addition & 1 deletion simulations/geometryRTheta/vortex_merger/vortex_merger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "euler.hpp"
#include "geometry.hpp"
#include "input.hpp"
#include "math_tools.hpp"
#include "l_norm_tools.hpp"
#include "paraconfpp.hpp"
#include "params.yaml.hpp"
#include "pdi_out.yml.hpp"
Expand Down
2 changes: 1 addition & 1 deletion simulations/geometryXY/guiding_center/guiding_center.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "geometry.hpp"
#include "initialization_Kelvin_Helmholtz.hpp"
#include "input.hpp"
#include "math_tools.hpp"
#include "l_norm_tools.hpp"
#include "output.hpp"
#include "paraconfpp.hpp"
#include "params.yaml.hpp"
Expand Down
17 changes: 9 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# SPDX-License-Identifier: MIT

add_subdirectory(advection)
add_subdirectory(collisions)
add_subdirectory(data_types)
add_subdirectory(utils)
add_subdirectory(speciesinfo)
add_subdirectory(io)
add_subdirectory(paraconfpp)
add_subdirectory(quadrature)
add_subdirectory(geometryXVx)
add_subdirectory(geometryXY)
add_subdirectory(geometryRTheta)
add_subdirectory(geometryXYVxVy)
add_subdirectory(geometryVparMu)
add_subdirectory(interpolation)
add_subdirectory(mapping)
add_subdirectory(multipatch)
add_subdirectory(advection)
add_subdirectory(timestepper)
add_subdirectory(collisions)
add_subdirectory(math_tools)
add_subdirectory(mpi_parallelisation)
add_subdirectory(multipatch)
add_subdirectory(paraconfpp)
add_subdirectory(pde_solvers)
add_subdirectory(quadrature)
add_subdirectory(speciesinfo)
add_subdirectory(timestepper)
add_subdirectory(utils)
1 change: 1 addition & 0 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [interpolation](./interpolation/README.md) - Code describing interpolation methods.
- [io](./io/README.md) - Code describing tools for inputting and outputting data in a simulation.
- [mapping](./mapping/README.md) - Code describing tools for handling different coordinate systems.
- [math_tools](./math_tools/README.md) - Code describing math tools functions.

Check failure on line 16 in src/README.md

View workflow job for this annotation

GitHub Actions / Markdown format check

Found non-escaped underscore. Please escape underscores and use *a* to indicate italics. (./src/README.md: Line 16, position 8)
- [multipatch](./multipatch/README.md) - Code describing multipatch geometry.
<!-- - [paraconfpp](./paraconfpp/README.md) - Paraconf utility functions. -->
- [mpi\_parallelisation](./mpi_parallelisation/README.md) - Code describing the MPI parallelisation.
Expand Down
1 change: 1 addition & 0 deletions src/geometryRTheta/advection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ target_link_libraries(advection_rp
gslx::geometry_RTheta
gslx::interpolation_2D_rp
gslx::mapping
gslx::math_tools
gslx::utils
)
add_library(gslx::advection_rp ALIAS advection_rp)
2 changes: 1 addition & 1 deletion src/geometryRTheta/advection/advection_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "directional_tag.hpp"
#include "geometry.hpp"
#include "geometry_pseudo_cartesian.hpp"
#include "math_tools.hpp"
#include "l_norm_tools.hpp"
#include "vector_field.hpp"
#include "vector_field_mem.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "ddc_alias_inline_functions.hpp"
#include "ddc_aliases.hpp"
#include "geometry.hpp"
#include "math_tools.hpp"
#include "l_norm_tools.hpp"
#include "poisson_like_rhs_function.hpp"
#include "polarpoissonlikesolver.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/geometryRTheta/time_solver/bsl_predcorr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "geometry.hpp"
#include "ifoot_finder.hpp"
#include "itimesolver.hpp"
#include "math_tools.hpp"
#include "l_norm_tools.hpp"
#include "poisson_like_rhs_function.hpp"
#include "polarpoissonlikesolver.hpp"
#include "rk2.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/geometryXY/time_integration/predcorr_RK2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "ddc_aliases.hpp"
#include "directional_tag.hpp"
#include "geometry.hpp"
#include "math_tools.hpp"
#include "l_norm_tools.hpp"
#include "paraconfpp.hpp"
#include "rk2.hpp"
#include "vector_field.hpp"
Expand Down
16 changes: 16 additions & 0 deletions src/math_tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SPDX-License-Identifier: MIT

add_library("math_tools" INTERFACE)

target_include_directories("math_tools"
INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}"
)

target_link_libraries("math_tools"
INTERFACE
DDC::DDC
gslx::data_types
)

add_library("gslx::math_tools" ALIAS "math_tools")

9 changes: 9 additions & 0 deletions src/math_tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Utility Functions

This folder contains mathematical classes and functions.

## Utility tools

The l\_norm\_tools.hpp file contains functions computing the infinity norm. For now, it computes the infinity norm of
- a double: $`\Vert x \Vert_{\infty} = x`$;
- a coordinate: $`\Vert x \Vert_{\infty} = \max_{i} (|x_i|)`$.
4 changes: 2 additions & 2 deletions src/utils/math_tools.hpp → src/math_tools/l_norm_tools.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
/**
* @file math_tools.hpp
* File Describing useful mathematical functions.
* @file l_norm_tools.hpp
* File Describing useful mathematical functions to compute Lnorms
*/

#pragma once
Expand Down
2 changes: 0 additions & 2 deletions src/multipatch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ The `multipatch` folder contains all the code describing methods and classes whi

- [data\_types](./data_types/README.md) - Defines classes to handle objects on a multipatch domain more conveniently.

- [interface\_derivatives](./interface_derivatives/README.md) - Ongoing work only available on GitLab.

- [spline](./spline/README.md) - Defines structures and methods to deal with different splines on every patches.

- [utils](./utils/README.md) - Defines utility functions to operate over multiple patches.
2 changes: 1 addition & 1 deletion src/multipatch/utils/multipatch_math_tools.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
#pragma once
#include "math_tools.hpp"
#include "l_norm_tools.hpp"
#include "multipatch_field.hpp"

/**
Expand Down
3 changes: 1 addition & 2 deletions src/timestepper/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@



add_library(timestepper INTERFACE)
target_include_directories(timestepper
INTERFACE
Expand All @@ -9,6 +7,7 @@ target_include_directories(timestepper
target_link_libraries(timestepper INTERFACE
DDC::core
gslx::data_types
gslx::math_tools
gslx::multipatch_data_types
gslx::multipatch_utils
gslx::utils
Expand Down
2 changes: 1 addition & 1 deletion src/timestepper/crank_nicolson.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "ddc_aliases.hpp"
#include "ddc_helper.hpp"
#include "itimestepper.hpp"
#include "math_tools.hpp"
#include "l_norm_tools.hpp"
#include "multipatch_math_tools.hpp"
#include "vector_field_common.hpp"

Expand Down
6 changes: 0 additions & 6 deletions src/utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,3 @@ This folder contains classes and functions which facilitate the writing of the r
The class ddcHelper exists to provide functionalities which are currently missing from DDC.

The class NDTag exists to provide a way to group directional tags together. This is notably useful in order to create a vector field.

## Utility tools

The utils\_tools.hpp file contains functions computing the infinity norm. For now, it computes the infinity norm of
- a double: $`\Vert x \Vert_{\infty} = x`$;
- a coordinate: $`\Vert x \Vert_{\infty} = \max_{i} (|x_i|)`$.
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ add_subdirectory(geometryRTheta)
add_subdirectory(geometryVparMu)
add_subdirectory(multipatch)
add_subdirectory(mpi_parallelisation)
add_subdirectory(math_tools)
add_subdirectory(pde_solvers)
add_subdirectory(quadrature)
add_subdirectory(timestepper)
Expand Down
1 change: 1 addition & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- geometryVparMu - Tests in the vpar-mu geometry.
- geometryXVx - Tests in the x-vx geometry.
- geometryXYVxVy - Tests in the x,y-vx,vy geometry.
- math_tools - Test for mathematical functions.

Check failure on line 13 in tests/README.md

View workflow job for this annotation

GitHub Actions / Markdown format check

Found non-escaped underscore. Please escape underscores and use *a* to indicate italics. (./tests/README.md: Line 13, position 9)
- MPI parallelism - Tests for the templated MPI operators.
- [multipatch](./multipatch/README.md) - Tests for the classes that work over multipatch geometries.
- PDE solvers - Tests for the templated Partial Differential Equation solvers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "bsl_advection_rp.hpp"
#include "directional_tag.hpp"
#include "geometry.hpp"
#include "math_tools.hpp"
#include "l_norm_tools.hpp"
#include "paraconfpp.hpp"
#include "params.yaml.hpp"
#include "quadrature.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "crank_nicolson.hpp"
#include "euler.hpp"
#include "geometry.hpp"
#include "math_tools.hpp"
#include "l_norm_tools.hpp"
#include "mesh_builder.hpp"
#include "quadrature.hpp"
#include "rk3.hpp"
Expand Down
1 change: 1 addition & 0 deletions tests/geometryRTheta/quadrature/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ target_link_libraries(Li_norms_spline_quadrature_tests
sll::SLL
gslx::geometry_RTheta
gslx::quadrature
gslx::math_tools
gslx::utils

)
Expand Down
2 changes: 1 addition & 1 deletion tests/geometryRTheta/quadrature/tests_L1_and_L2_norms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <gtest/gtest.h>

#include "geometry.hpp"
#include "math_tools.hpp"
#include "l_norm_tools.hpp"
#include "mesh_builder.hpp"
#include "quadrature.hpp"
#include "spline_quadrature.hpp"
Expand Down
20 changes: 20 additions & 0 deletions tests/math_tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-License-Identifier: MIT


include(GoogleTest)

add_executable(unit_tests_math_tools
test_lnorm_tools.cpp
../main.cpp
)
target_link_libraries(unit_tests_math_tools
PUBLIC
DDC::pdi
GTest::gtest
GTest::gmock
paraconf::paraconf
gslx::math_tools
gslx::utils
)

gtest_discover_tests(unit_tests_math_tools DISCOVERY_MODE PRE_TEST)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "ddc_alias_inline_functions.hpp"
#include "ddc_aliases.hpp"
#include "ddc_helper.hpp"
#include "math_tools.hpp"
#include "l_norm_tools.hpp"

namespace {

Expand Down
1 change: 1 addition & 0 deletions tests/timestepper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ target_link_libraries(unit_tests_timestepper
GTest::gtest
GTest::gmock
paraconf::paraconf
gslx::math_tools
gslx::multipatch_data_types
gslx::multipatch_geometries
gslx::timestepper
Expand Down
2 changes: 1 addition & 1 deletion tests/timestepper/crank_nicolson_2d_mixed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "crank_nicolson.hpp"
#include "directional_tag.hpp"
#include "math_tools.hpp"
#include "l_norm_tools.hpp"
#include "vector_field.hpp"
#include "vector_field_mem.hpp"

Expand Down
2 changes: 1 addition & 1 deletion tests/timestepper/euler_2d_mixed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "crank_nicolson.hpp"
#include "directional_tag.hpp"
#include "euler.hpp"
#include "math_tools.hpp"
#include "l_norm_tools.hpp"
#include "vector_field.hpp"
#include "vector_field_mem.hpp"

Expand Down
1 change: 0 additions & 1 deletion tests/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ include(GoogleTest)

add_executable(unit_tests_utils
test_ddcHelpers.cpp
test_math_tools.cpp
transpose.cpp
../main.cpp
)
Expand Down
Loading