G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsAssemblerOptions.h
Go to the documentation of this file.
1 
14 #pragma once
15 
16 namespace gismo
17 {
18 
19 struct dirichlet
20 {
21  enum strategy
22  {
23  elimination = 11,
24 
25  penalize = 13,
26 
27  nitsche = 12,
28 
31  eliminatNormal = 14,
32 
33  none = 0
34  };
35 
36  enum values
37  {
38  homogeneous = 100,
39 
40  interpolation = 101,
41 
42  l2Projection = 102,
43 
44  user = 103
45  };
46 };
47 
48 struct iFace
49 {
50  enum strategy
51  {
55  conforming = 1,
56  glue = 1,
57 
60  dg = 2,
61 
63  smooth = 3,
64 
66  none = 0
67  };
68 
69 };
70 
71 /*
72  enum iFaceTopology
73  {
74  nested = 1,
75 
76  clamped = 2,
77  }
78 */
79 
80 struct transform
81 {
82  enum type
83  {
84  Hgrad = 1, // covariant, inverse_composition
85  Hdiv = 2, // Piola
86  Hcurl = 3
87  };
88 };
89 
90 // for mixed formulations
91 struct discreteSpace
92 {
93  enum type
94  {
95  taylorHood = 1,
96  //instead of raviartThomas, there should be nested_Space and BubbleElement
97  //raviartThomas should go away here.
98  raviartThomas = 2,
99 
100  none = 0
101  };
102 };
103 
243 {
244 public:
245  // Default constructor
247  : dirValues (dirichlet::l2Projection ),
248  dirStrategy (dirichlet::elimination ),
249  intStrategy (iFace ::conforming ),
250  transformType(transform::Hgrad ),
251  spaceType (discreteSpace::taylorHood ),
252 
253  bdA(2.0),
254  bdB(1 ),
255  memOverhead(0.33334),
256  quA(1.0),
257  quB(1 )
258  { }
259 
260 public:
261  //gsAssemblerSetup info;
262 
263  dirichlet::values dirValues;
264 
265  dirichlet::strategy dirStrategy;
266 
267  iFace::strategy intStrategy;
268 
269  transform::type transformType;
270  discreteSpace::type spaceType;
271 
272  // If set to a value different than zero, it controls the
273  // allocation of the sparse matrix, ie. the maximum number of
274  // non-zero entries per column (set to: A * p + B)
275  double bdA;
276  int bdB;
277 
278  // more memory is allocated then required for efficency reasons,
279  // more precise, (1+memOverhead) times the original memory is allocated
280  // default value is 0.33334 -> 75% of the allocated memory is used.
281  double memOverhead;
282 
283  // The formula for the number of quadrature points for all
284  // integral computations will be set to the integer which is
285  // closest to (A * p + B), where \a p is the (coordinate-wise)
286  // degree of the basis
287  double quA;
288  int quB;
289 
290 public: // Utility functions that return values implied by the settings
291 
292 
293  index_t numQuNodes(const gsBasis<real_t> & b) const
294  {
295  return numQuNodes(b,quA,quB);
296  }
297 
298  static index_t numQuNodes(const gsBasis<real_t> & b,
299  double _quA, int _quB)
300  {
301  index_t res = 1;
302  for(short_t i=0; i<b.domainDim(); ++i )
303  {
304  res *= static_cast<index_t>(_quA * b.degree(i) + _quB + 0.5);
305  }
306 
307  return res;
308  }
309 
310 
311  index_t numColNz(const gsBasis<real_t> & b) const
312  {
313  return numColNz(b,bdA,bdB,memOverhead);
314  }
315 
316  static index_t numColNz(const gsBasis<real_t> & b,
317  double _bdA, int _bdB, double _mem)
318  {
319  index_t nz = 1;
320  for (short_t i = 0; i != b.dim(); ++i)
321  nz *= static_cast<index_t>(_bdA * b.degree(i) + _bdB + 0.5);
322  return static_cast<index_t>(nz*(1.0+_mem));
323  }
324 
325 };
326 
327 
328 
329 }
#define short_t
Definition: gsConfig.h:35
virtual short_t degree(short_t i) const
Degree with respect to the i-th variable. If the basis is a tensor product of (piecewise) polynomial ...
Definition: gsBasis.hpp:650
#define index_t
Definition: gsConfig.h:32
virtual short_t domainDim() const =0
Dimension of the (source) domain.
Definition: gsAssemblerOptions.h:242