BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
assembly_options.hpp
1 // Copyright (C) 2011-2012 by the BEM++ Authors
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 // THE SOFTWARE.
20 
21 #ifndef bempp_assembly_options_hpp
22 #define bempp_assembly_options_hpp
23 
24 #include "../common/common.hpp"
25 
26 #include "aca_options.hpp"
27 
28 #include "../common/deprecated.hpp"
29 #include "../fiber/opencl_options.hpp"
30 #include "../fiber/parallelization_options.hpp"
31 #include "../fiber/verbosity_level.hpp"
32 
33 namespace Bempp
34 {
35 
39 
44 {
45 public:
46  enum Value { AUTO = -1, NO = 0, YES = 1 };
47 
49 
54  enum Mode {
59  };
60 
64  void switchToDenseMode();
65 
71 
76 
82 
87  Mode assemblyMode() const;
88 
93  const AcaOptions& acaOptions() const;
94 
99  // Temporarily removed (OpenCl support is broken).
100  // void enableOpenCl(const OpenClOptions& openClOptions);
101  // void disableOpenCl();
102 
107  void setMaxThreadCount(int maxThreadCount);
108 
112  BEMPP_DEPRECATED void switchToTbb(int maxThreadCount = AUTO);
113 
116 
125  void setVerbosityLevel(VerbosityLevel::Level level);
126 
128  VerbosityLevel::Level verbosityLevel() const;
129 
142  void enableSingularIntegralCaching(bool value = true);
143 
148 
154  void enableSparseStorageOfLocalOperators(bool value = true);
155 
161 
168  void BEMPP_DEPRECATED enableSparseStorageOfMassMatrices(bool value = true);
169 
174 
183  void enableJointAssembly(bool value = true);
184 
189  bool isJointAssemblyEnabled() const;
190 
201  void enableBlasInQuadrature(Value value = AUTO);
202 
207  Value isBlasEnabledInQuadrature() const;
208 
229  void makeQuadratureOrderUniformInEachCluster(bool value = true);
230 
237 
240 private:
242  Mode m_assemblyMode;
243  AcaOptions m_acaOptions;
244  ParallelizationOptions m_parallelizationOptions;
245  VerbosityLevel::Level m_verbosityLevel;
246  bool m_singularIntegralCaching;
247  bool m_sparseStorageOfLocalOperators;
248  bool m_jointAssembly;
249  bool m_uniformQuadrature;
250  Value m_blasInQuadrature;
252 };
253 
254 } // namespace Bempp
255 
256 #endif
VerbosityLevel::Level verbosityLevel() const
Return the verbosity level.
Definition: assembly_options.cpp:106
BEMPP_DEPRECATED void switchToDense()
Use dense-matrix representations of weak forms of boundary integral operators.
Definition: assembly_options.cpp:63
bool isSparseStorageOfLocalOperatorsEnabled() const
Return whether discrete weak forms of local operators should be stored in sparse format.
Definition: assembly_options.cpp:126
Value isBlasEnabledInQuadrature() const
Indicate whether BLAS matrix multiplication routines are used during evaluation of elementary integra...
Definition: assembly_options.cpp:159
Parallel operation settings.
Definition: parallelization_options.hpp:32
void enableJointAssembly(bool value=true)
Enable or disable joint assembly of integral-operator superpositions.
Definition: assembly_options.cpp:141
const AcaOptions & acaOptions() const
Return the current adaptive cross approximation (ACA) settings.
Definition: assembly_options.cpp:77
Adaptive cross approximation (ACA) parameters.
Definition: aca_options.hpp:34
void setVerbosityLevel(VerbosityLevel::Level level)
Set the verbosity level.
Definition: assembly_options.cpp:101
#define BEMPP_DEPRECATED
Macro used to mark deprecated functions or classes.
Definition: deprecated.hpp:41
Verbosity level.
Definition: verbosity_level.hpp:30
BEMPP_DEPRECATED void switchToTbb(int maxThreadCount=AUTO)
Set the maximum number of threads used during the assembly.
Definition: assembly_options.cpp:91
Assemble hierarchical matrices using adaptive cross approximation (ACA).
Definition: assembly_options.hpp:58
Assemble dense matrices.
Definition: assembly_options.hpp:56
bool isQuadratureOrderUniformInEachCluster() const
Return whether the same quadrature order is used for all regular integrals over pairs of test and tri...
Definition: assembly_options.cpp:169
void enableBlasInQuadrature(Value value=AUTO)
Specify whether BLAS matrix multiplication routines should be used during evaluation of elementary in...
Definition: assembly_options.cpp:151
Mode
Possible assembly modes for weak forms of boundary integral operators.
Definition: assembly_options.hpp:54
bool BEMPP_DEPRECATED isSparseStorageOfMassMatricesEnabled() const
Return whether mass matrices should be stored in sparse format.
Definition: assembly_options.cpp:136
bool isSingularIntegralCachingEnabled() const
Return whether singular integrals should be cached during weak-form assembly.
Definition: assembly_options.cpp:116
void enableSparseStorageOfLocalOperators(bool value=true)
Specify whether discrete weak forms of local operators should be stored in sparse format...
Definition: assembly_options.cpp:121
Mode assemblyMode() const
Current assembly mode.
Definition: assembly_options.cpp:73
void BEMPP_DEPRECATED enableSparseStorageOfMassMatrices(bool value=true)
Specify whether discrete weak forms of local operators should be stored in sparse format...
Definition: assembly_options.cpp:131
const ParallelizationOptions & parallelizationOptions() const
Return current parallelization options.
Definition: assembly_options.cpp:96
void enableSingularIntegralCaching(bool value=true)
Specify whether singular integrals are cached during weak-form assembly.
Definition: assembly_options.cpp:111
Definition: opencl_options.hpp:29
bool isJointAssemblyEnabled() const
Return whether joint assembly of integral-operator superpositions is enabled.
Definition: assembly_options.cpp:146
BEMPP_DEPRECATED void switchToAca(const AcaOptions &acaOptions)
Use adaptive cross approximation (ACA) to obtain hierarchical-matrix representations of weak forms of...
Definition: assembly_options.cpp:68
void switchToAcaMode(const AcaOptions &acaOptions)
Use adaptive cross approximation (ACA) to obtain hierarchical-matrix representations of weak forms of...
Definition: assembly_options.cpp:44
void switchToDenseMode()
Use dense-matrix representations of weak forms of boundary integral operators.
Definition: assembly_options.cpp:39
Options determining how weak-form assembly is done.
Definition: assembly_options.hpp:43
void makeQuadratureOrderUniformInEachCluster(bool value=true)
Instruct the ACA assembler to use the same quadrature order for the evaluation of all regular integra...
Definition: assembly_options.cpp:164
void setMaxThreadCount(int maxThreadCount)
Set the maximum number of threads used during the assembly.
Definition: assembly_options.cpp:86