preCICE v3.1.2
Loading...
Searching...
No Matches
GinkgoRadialBasisFctSolverTest.cpp
Go to the documentation of this file.
1#ifndef PRECICE_NO_GINKGO
2
6#include "mesh/Data.hpp"
7#include "mesh/Mesh.hpp"
9#include "mesh/Utils.hpp"
10#include "mesh/Vertex.hpp"
12#include "testing/Testing.hpp"
13
14using namespace precice;
15using namespace precice::mesh;
16using namespace precice::mapping;
17using namespace precice::testing;
19
20BOOST_AUTO_TEST_SUITE(MappingTests)
21BOOST_AUTO_TEST_SUITE(GinkgoRadialBasisFunctionSolver)
22
23#undef doLocalCode
24#define doLocalCode(Type, function, polynomial, EXECUTOR, SOLVER) \
25 { \
26 MappingConfiguration::GinkgoParameter gpm; \
27 gpm.executor = EXECUTOR; \
28 gpm.deviceId = 0; \
29 gpm.solver = SOLVER; \
30 gpm.maxIterations = 100; \
31 gpm.usePreconditioner = false; \
32 RadialBasisFctMapping<GinkgoRadialBasisFctSolver<Type>, MappingConfiguration::GinkgoParameter> consistentMap2D(Mapping::CONSISTENT, 2, function, {{false, false, false}}, polynomial, gpm); \
33 perform2DTestConsistentMapping(consistentMap2D); \
34 RadialBasisFctMapping<GinkgoRadialBasisFctSolver<Type>, MappingConfiguration::GinkgoParameter> consistentMap2DVector(Mapping::CONSISTENT, 2, function, {{false, false, false}}, polynomial, gpm); \
35 perform2DTestConsistentMappingVector(consistentMap2DVector); \
36 RadialBasisFctMapping<GinkgoRadialBasisFctSolver<Type>, MappingConfiguration::GinkgoParameter> consistentMap3D(Mapping::CONSISTENT, 3, function, {{false, false, false}}, polynomial, gpm); \
37 perform3DTestConsistentMapping(consistentMap3D); \
38 RadialBasisFctMapping<GinkgoRadialBasisFctSolver<Type>, MappingConfiguration::GinkgoParameter> scaledConsistentMap2D(Mapping::SCALED_CONSISTENT_SURFACE, 2, function, {{false, false, false}}, polynomial, gpm); \
39 perform2DTestScaledConsistentMapping(scaledConsistentMap2D); \
40 RadialBasisFctMapping<GinkgoRadialBasisFctSolver<Type>, MappingConfiguration::GinkgoParameter> scaledConsistentMap3D(Mapping::SCALED_CONSISTENT_SURFACE, 3, function, {{false, false, false}}, polynomial, gpm); \
41 perform3DTestScaledConsistentMapping(scaledConsistentMap3D); \
42 RadialBasisFctMapping<GinkgoRadialBasisFctSolver<Type>, MappingConfiguration::GinkgoParameter> conservativeMap2D(Mapping::CONSERVATIVE, 2, function, {{false, false, false}}, polynomial, gpm); \
43 perform2DTestConservativeMapping(conservativeMap2D); \
44 RadialBasisFctMapping<GinkgoRadialBasisFctSolver<Type>, MappingConfiguration::GinkgoParameter> conservativeMap2DVector(Mapping::CONSERVATIVE, 2, function, {{false, false, false}}, polynomial, gpm); \
45 perform2DTestConservativeMappingVector(conservativeMap2DVector); \
46 RadialBasisFctMapping<GinkgoRadialBasisFctSolver<Type>, MappingConfiguration::GinkgoParameter> conservativeMap3D(Mapping::CONSERVATIVE, 3, function, {{false, false, false}}, polynomial, gpm); \
47 perform3DTestConservativeMapping(conservativeMap3D); \
48 }
49
50#define TEST_FOR_ALL_RBFS(EXECUTOR, SOLVER) \
51 BOOST_AUTO_TEST_CASE(MapThinPlateSplines) \
52 { \
53 PRECICE_TEST(1_rank); \
54 ThinPlateSplines fct; \
55 doLocalCode(ThinPlateSplines, fct, Polynomial::SEPARATE, EXECUTOR, SOLVER); \
56 } \
57 BOOST_AUTO_TEST_CASE(MapMultiquadrics) \
58 { \
59 PRECICE_TEST(1_rank); \
60 Multiquadrics fct(1e-3); \
61 doLocalCode(Multiquadrics, fct, Polynomial::SEPARATE, EXECUTOR, SOLVER); \
62 } \
63 BOOST_AUTO_TEST_CASE(MapInverseMultiquadrics) \
64 { \
65 PRECICE_TEST(1_rank); \
66 InverseMultiquadrics fct(1e-3); \
67 doLocalCode(InverseMultiquadrics, fct, Polynomial::SEPARATE, EXECUTOR, SOLVER); \
68 } \
69 BOOST_AUTO_TEST_CASE(MapVolumeSplines) \
70 { \
71 PRECICE_TEST(1_rank); \
72 VolumeSplines fct; \
73 doLocalCode(VolumeSplines, fct, Polynomial::SEPARATE, EXECUTOR, SOLVER); \
74 } \
75 BOOST_AUTO_TEST_CASE(MapGaussian) \
76 { \
77 PRECICE_TEST(1_rank); \
78 Gaussian fct(1.0); \
79 doLocalCode(Gaussian, fct, Polynomial::SEPARATE, EXECUTOR, SOLVER); \
80 } \
81 BOOST_AUTO_TEST_CASE(MapCompactThinPlateSplinesC2) \
82 { \
83 PRECICE_TEST(1_rank); \
84 double supportRadius = 1.2; \
85 CompactThinPlateSplinesC2 fct(supportRadius); \
86 doLocalCode(CompactThinPlateSplinesC2, fct, Polynomial::SEPARATE, EXECUTOR, SOLVER); \
87 } \
88 BOOST_AUTO_TEST_CASE(MapCompactPolynomialC0) \
89 { \
90 PRECICE_TEST(1_rank); \
91 double supportRadius = 1.2; \
92 CompactPolynomialC0 fct(supportRadius); \
93 doLocalCode(CompactPolynomialC0, fct, Polynomial::SEPARATE, EXECUTOR, SOLVER); \
94 } \
95 BOOST_AUTO_TEST_CASE(MapCompactPolynomialC2) \
96 { \
97 PRECICE_TEST(1_rank); \
98 double supportRadius = 1.2; \
99 CompactPolynomialC2 fct(supportRadius); \
100 doLocalCode(CompactPolynomialC2, fct, Polynomial::SEPARATE, EXECUTOR, SOLVER); \
101 } \
102 BOOST_AUTO_TEST_CASE(MapCompactPolynomialC4) \
103 { \
104 PRECICE_TEST(1_rank); \
105 double supportRadius = 1.2; \
106 CompactPolynomialC4 fct(supportRadius); \
107 doLocalCode(CompactPolynomialC4, fct, Polynomial::SEPARATE, EXECUTOR, SOLVER); \
108 } \
109 BOOST_AUTO_TEST_CASE(MapCompactPolynomialC6) \
110 { \
111 PRECICE_TEST(1_rank); \
112 double supportRadius = 1.2; \
113 CompactPolynomialC6 fct(supportRadius); \
114 doLocalCode(CompactPolynomialC6, fct, Polynomial::SEPARATE, EXECUTOR, SOLVER); \
115 } \
116 BOOST_AUTO_TEST_CASE(MapCompactPolynomialC8) \
117 { \
118 PRECICE_TEST(1_rank); \
119 double supportRadius = 1.2; \
120 CompactPolynomialC8 fct(supportRadius); \
121 doLocalCode(CompactPolynomialC8, fct, Polynomial::SEPARATE, EXECUTOR, SOLVER); \
122 }
123
124BOOST_AUTO_TEST_SUITE(Reference)
125TEST_FOR_ALL_RBFS("reference-executor", "gmres-solver");
127
128#ifdef PRECICE_WITH_OMP
130TEST_FOR_ALL_RBFS("omp-executor", "gmres-solver");
132#endif
133
134#ifdef PRECICE_WITH_CUDA
136TEST_FOR_ALL_RBFS("cuda-executor", "gmres-solver");
138#endif
139
140#ifdef PRECICE_WITH_CUDA
141BOOST_AUTO_TEST_SUITE(cuSolver)
142TEST_FOR_ALL_RBFS("cuda-executor", "qr-solver");
144#endif
145
146#ifdef PRECICE_WITH_HIP
148TEST_FOR_ALL_RBFS("hip-executor", "gmres-solver");
150#endif
151
152#ifdef PRECICE_WITH_HIP
153BOOST_AUTO_TEST_SUITE(hipSolver)
154TEST_FOR_ALL_RBFS("hip-executor", "qr-solver");
156#endif
157
158#undef TEST_FOR_ALL_RBFS
159#undef doLocalCode
160
161BOOST_AUTO_TEST_SUITE_END() // RadialBasisFunctionMapping
163
164#endif
#define TEST_FOR_ALL_RBFS(EXECUTOR, SOLVER)
gko::solver::Gmres<> gmres
BOOST_AUTO_TEST_SUITE(PreProcess)
BOOST_AUTO_TEST_SUITE_END()
contains data mapping from points to meshes.
provides Mesh, Data and primitives.
contains the testing framework.
Definition helper.hpp:9
Main namespace of the precice library.