OpenLB 1.7
Loading...
Searching...
No Matches
smoothIndicatorF2D.hh
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2016 Thomas Henn, Cyril Masquelier, Jan Marquardt, Mathias J. Krause
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
24#ifndef SMOOTH_INDICATOR_F_2D_HH
25#define SMOOTH_INDICATOR_F_2D_HH
26
27#include "utilities/omath.h"
28
29#include "smoothIndicatorF2D.h"
32
33#ifndef M_PI
34#define M_PI 3.14159265358979323846
35#endif
36#define M_PI2 1.57079632679489661923
37
38namespace olb {
39
40template <typename T, typename S, bool PARTICLE>
42 : SmoothIndicatorCuboid2D<T,S,PARTICLE>(ind.getCenter(), ind.getxLength(), ind.getyLength(), epsilon, theta)
43{ }
44
45template <typename T, typename S, bool PARTICLE>
47 : _ind(xLength, yLength, center)
48{
49 this->_epsilon = epsilon;
50 if constexpr (!PARTICLE) {
51 this->_pos = _ind.getCenter();
52 this->_theta = util::degreeToRadian(theta);
53 }
54
55 this->_circumRadius = .5*(util::sqrt(util::pow( xLength, 2)+util::pow( yLength, 2))) + 0.5*epsilon;
56 if constexpr (!PARTICLE) {
57 this->_myMin = {
58 this->_pos[0] - this->getCircumRadius(),
59 this->_pos[1] - this->getCircumRadius()
60 };
61 this->_myMax = {
62 this->_pos[0] + this->getCircumRadius(),
63 this->_pos[1] + this->getCircumRadius()
64 };
65 this->init();
66 }
67}
68
69template <typename T, typename S, bool PARTICLE>
73
74template <typename T, typename S, bool PARTICLE>
76{
77 return _ind.getxLength()*_ind.getyLength();
78}
79
80template <typename T, typename S, bool PARTICLE>
82{
83 const T xLength = _ind.getxLength();
84 const T yLength = _ind.getyLength();
85 const T mass = getArea()*density;
86 const T mofi = 1./12.*mass*(xLength*xLength+yLength*yLength);
87 return Vector<S,2>(mofi, mass);
88}
89
90template <typename T, typename S, bool PARTICLE>
92{
93 return _ind.surfaceNormal(pos, meshSize);
94}
95
96template <typename T, typename S, bool PARTICLE>
98{
100 if constexpr(!PARTICLE) {
101 // rotation & translation
102 p = util::executeRotation<S,2,true>(input, this->_rotMat, this->getPos());
103 }
104 else {
105 p = input;
106 }
107 return _ind.signedDistance(p + _ind.getCenter());
108}
109
110template <typename T, typename S, bool PARTICLE>
111bool SmoothIndicatorCuboid2D<T, S, PARTICLE>::distance(S& distance, const Vector<S,2>& origin, const Vector<S,2>& direction, S precision, S pitch)
112{
113 Vector<S,2> p;
114 if constexpr(!PARTICLE) {
115 // rotation & translation
116 p = util::executeRotation<S,2,true>(origin, this->_rotMat, this->getPos());
117 }
118 else {
119 p = origin;
120 }
121 return _ind.distance(distance, p, direction, precision, pitch);
122}
123
124
125template <typename T, typename S, bool PARTICLE>
127 : SmoothIndicatorCircle2D(ind.getCenter(), ind.getRadius(), epsilon)
128{ }
129
130template <typename T, typename S, bool PARTICLE>
132 : _ind(center, radius)
133{
134 this->_epsilon = epsilon;
135 if constexpr (!PARTICLE) {
136 this->_pos = _ind.getCenter();
137 }
138
139 this->_circumRadius = radius + 0.5*epsilon;
140 if constexpr (!PARTICLE) {
141 this->_myMin = {this->_pos[0] - this->getCircumRadius(), this->_pos[1] - this->getCircumRadius()};
142 this->_myMax = {this->_pos[0] + this->getCircumRadius(), this->_pos[1] + this->getCircumRadius()};
143 this->_theta = 0.;
144 this->init();
145 }
146}
147
148template <typename T, typename S, bool PARTICLE>
152
153template <typename T, typename S, bool PARTICLE>
155{
156 return M_PI*_ind.getRadius()*_ind.getRadius();
157}
158
159template <typename T, typename S, bool PARTICLE>
161{
162 const T radius = _ind.getRadius();
163 const T mass = getArea()*density;
164 const T mofi = 0.5 * mass * radius * radius;
165 return Vector<S,2>(mofi, mass);
166}
167
168template <typename T, typename S, bool PARTICLE>
170{
171 return _ind.surfaceNormal(pos, meshSize);
172}
173
174template <typename T, typename S, bool PARTICLE>
176{
177 Vector<S,2> dist = input;
178 if constexpr(!PARTICLE) {
179 dist -= this->_pos;
180 }
181 return _ind.signedDistance(dist + _ind.getCenter());
182}
183
184template <typename T, typename S, bool PARTICLE>
185bool SmoothIndicatorCircle2D<T, S, PARTICLE>::distance(S& distance, const Vector<S,2>& origin, const Vector<S,2>& direction, S precision, S pitch)
186{
187 Vector<S,2> dist = origin;
188 if constexpr(!PARTICLE) {
189 dist -= this->_pos;
190 }
191 return _ind.distance(distance, dist, direction, precision, pitch);
192}
193
194
195template <typename T, typename S, bool PARTICLE>
197 : SmoothIndicatorTriangle2D(ind.getCenter(), ind.getRadius(), epsilon, theta)
198{ }
199
200template <typename T, typename S, bool PARTICLE>
202 : _ind(center, radius)
203{
204 this->_epsilon = epsilon;
205 if constexpr (!PARTICLE) {
206 this->_pos = _ind.getCenter();
207 this->_theta = util::degreeToRadian(theta);
208 }
209
210 this->_circumRadius = radius + 0.5*epsilon;
211 if constexpr (!PARTICLE) {
212 this->_myMin = {center[0] - this->getCircumRadius(), center[1] - this->getCircumRadius()};
213 this->_myMax = {center[0] + this->getCircumRadius(), center[1] + this->getCircumRadius()};
214 this->init();
215 }
216}
217
218template <typename T, typename S, bool PARTICLE>
222
223template <typename T, typename S, bool PARTICLE>
225{
226 const T radius = _ind.getRadius();
227 const T altitude = 1.5*radius;
228 const T base = util::sqrt(3)*radius;
229 return 0.5*base*altitude;
230}
231
232template <typename T, typename S, bool PARTICLE>
234{
235 const T radius = _ind.getRadius();
236 const T altitude = 1.5*radius;
237 const T base = util::sqrt(3)*radius;
238 const T mass = density*getArea();
239 const T mofi = mass*((altitude*altitude/18.)+(base*base/24.));
240 return Vector<S,2>(mofi, mass);
241}
242
243template <typename T, typename S, bool PARTICLE>
245{
246 return _ind.surfaceNormal(pos, meshSize);
247}
248
249template <typename T, typename S, bool PARTICLE>
251{
252 Vector<S,2> p;
253 if constexpr(!PARTICLE) {
254 // rotation & translation
255 p = util::executeRotation<S,2,true>(input, this->_rotMat, this->getPos());
256 }
257 else {
258 p = input;
259 }
260 return _ind.signedDistance(p + _ind.getCenter());
261}
262
263template <typename T, typename S, bool PARTICLE>
264bool SmoothIndicatorTriangle2D<T, S, PARTICLE>::distance(S& distance, const Vector<S,2>& origin, const Vector<S,2>& direction, S precision, S pitch)
265{
266 Vector<S,2> p;
267 if constexpr(!PARTICLE) {
268 // rotation
269 p = util::executeRotation<S,2>(origin, this->_rotMat, this->getPos());
270 // translation
271 p -= this->getPos();
272 }
273 else {
274 p = origin;
275 }
276 return _ind.distance(distance, p, direction, precision, pitch);
277}
278
279
280//TODO: TO Be Repaired
281//TODO: Check for consitency
282template <typename T, typename S, bool PARTICLE>
284 std::shared_ptr<IndicatorF2D<T>> indPtr,
285 Vector<T,2> pos,
286 T epsilon,
287 T theta)
288 :_indPtr(indPtr),
289 _latticeSpacing(latticeSpacing)
290{
291 OstreamManager clout(std::cout,"createIndicatorCustom2D");
292 this->_name = "custom2D";
293 this->_epsilon = epsilon;
294 if constexpr(!PARTICLE) {
295 this->_pos = pos; // global position of the local center
296 this->_theta = util::degreeToRadian(theta);
297 this->init();
298 }
299
300 initData(*_indPtr);
301}
302
303template <typename T, typename S, bool PARTICLE>
305{
306 initBlockData(ind);
307
308 // calculate mass and centerpoint for rotation
309 calcCenter();
310 // calculate min and max from circumRadius
311 calcCircumRadius();
312}
313
314template <typename T, typename S, bool PARTICLE>
315void SmoothIndicatorCustom2D<T,S,PARTICLE>::initBlockData(IndicatorF2D<T>& ind)
316{
317 OstreamManager clout(std::cout,"createIndicatorCustom2D");
318
319 // initialize temporary values
320 Vector<int,2> blockDataSize;
321 Vector<int,2 >blockDataPadding;
322 for (unsigned iD=0; iD<2; ++iD) {
323 blockDataSize[iD] = util::max(
324 util::ceil( (ind.getMax()[iD] - ind.getMin()[iD]) / _latticeSpacing ), 1);
325 // Add a padding so that the distance can be cached in the vicinity of the geometry
326 blockDataPadding[iD] = 2*util::ceil(0.2*blockDataSize[iD]);
327 blockDataSize[iD] += blockDataPadding[iD];
328 }
329
330 // create blockData containing signed distance information
331 _cuboid = std::make_unique<Cuboid2D<T>>(PhysR<T,2>(0.), _latticeSpacing, blockDataSize);
332 this->_blockData.reset(new BlockData<2,T,BaseType<T>>(*_cuboid));
333 int iX[2];
334 for (iX[0]=0; iX[0] < this->_blockData->getNx(); ++iX[0]) {
335 for (iX[1]=0; iX[1] < this->_blockData->getNy(); ++iX[1]) {
336 Vector<T,2> input;
337 for (unsigned iD=0; iD<2; ++iD) {
338 input[iD] = (iX[iD]-blockDataPadding[iD]/2)*_latticeSpacing+ind.getMin()[iD];
339 }
340 this->_blockData->get(iX) = ind.signedDistance(input);
341 }
342 }
343
344 this->_cacheFunctor = std::make_unique<BlockDataF2D<T,BaseType<T>>>(*(this->_blockData));
345 this->_interpolateCache = std::make_unique<AnalyticalFfromBlockF2D<T,T>>(*(this->_cacheFunctor), *_cuboid);
346}
347
348template <typename T, typename S, bool PARTICLE>
349void SmoothIndicatorCustom2D<T,S,PARTICLE>::calcCenter()
350{
351 // TODO check again for correctness of center due to smooth boundary and coordinate system
352 unsigned nCells = 0;
353 int input[2];
354 this->_center = Vector<T,2>(0.);
355 for (input[0] = 0; input[0] < this->_blockData->getNx(); ++input[0]) {
356 for (input[1] = 0; input[1] < this->_blockData->getNy(); ++input[1]) {
357 if (regardCell(input)) {
358 // Always use real boundary as in other geometries too
359 const unsigned short porosity = 1;
360 this->_center[0] += porosity*this->_latticeSpacing*input[0];
361 this->_center[1] += porosity*this->_latticeSpacing*input[1];
362 nCells += porosity;
363 }
364 }
365 }
366 this->_center *= 1./nCells;
367}
368
369template <typename T, typename S, bool PARTICLE>
371{
372 return _area;
373}
374
376template <typename T, typename S, bool PARTICLE>
378{
379 // TODO - calculation
380 T mofi = 0.;
381 T mass;
382 unsigned nCells = 0;
383 int input[2];
384 for (input[0] = 0; input[0] < this->_blockData->getNx(); ++input[0]) {
385 const T dx = util::abs(input[0]*_latticeSpacing - this->_center[0]);
386 for (input[1] = 0; input[1] < this->_blockData->getNy(); ++input[1]) {
387 if (regardCell(input)) {
388 const T dy = util::abs(input[1]*_latticeSpacing - this->_center[1]);
389 mofi += (dx*dx+dy*dy);
390 ++nCells;
391 }
392 }
393 }
394 _area = nCells * util::pow(_latticeSpacing, 2);
395 mass = rhoP * _area;
396 mofi += util::pow(_latticeSpacing, 4)/ 6.0;
397 mofi *= mass/nCells;
398
399 return Vector<T,2>(mofi,mass);
400}
401
402template <typename T, typename S, bool PARTICLE>
404{
405 Vector<T,2> min(std::numeric_limits<olb::BaseType<T>>::max());
406 Vector<T,2> max(-std::numeric_limits<olb::BaseType<T>>::max());
407 Vector<T,2> distance;
408 T maxDistance{0};
409
410 int input[2];
411 for (input[0] = 0; input[0] < this->_blockData->getNx(); ++input[0]) {
412 distance[0] = this->_latticeSpacing*input[0] - this->_center[0];
413 for (input[1] = 0; input[1] < this->_blockData->getNy(); ++input[1]) {
414 distance[1] = this->_latticeSpacing*input[1] - this->_center[1];
415 if (regardCell(input)) {
416 if constexpr (!PARTICLE) {
417 for (unsigned iD=0; iD<2; ++iD) {
418 min[iD] = util::min(distance[iD], min[iD]);
419 max[iD] = util::max(distance[iD], max[iD]);
420 }
421 }
422 maxDistance = util::max(norm(distance), maxDistance);
423 }
424 }
425 }
426
427 if constexpr (!PARTICLE) {
428 min -= Vector<T,2>(0.5 * this->_epsilon + _latticeSpacing);
429 max += Vector<T,2>(0.5 * this->_epsilon + _latticeSpacing);
430 this->_myMin = this->_pos + min;
431 this->_myMax = this->_pos + max;
432 }
433
434 this->_circumRadius = maxDistance + T{0.5} * (this->_epsilon + util::sqrt(2) * _latticeSpacing);
435}
436
437template <typename T, typename S, bool PARTICLE>
442
443template <typename T, typename S, bool PARTICLE>
445{
446 return _indPtr->surfaceNormal(pos, meshSize);
447}
448
449template <typename T, typename S, bool PARTICLE>
451{
452 PhysR<T,2> position = input;
453 if constexpr (!PARTICLE) {
454 // translation, counter-clockwise rotation by _theta=-theta around (0/0) and movement from rotation center to local center
455 position = util::executeRotation<T,2,true>(input, this->_rotMat, this->getPos());
456 }
457 // The block data originates in (0,0,0) therefore we translate the input position which is relative to center of mass
458 const PhysR<T,2> positionInCache = this->_center + position;
459
460 T signedDistance(0.);
461 if(_interpolateCache->operator()(&signedDistance, positionInCache.data())) {
462 return signedDistance;
463 }
464
465 // If all points were outside return an estimation instead
466 LatticeR<2> latticePosition;
467 PhysR<T,2> extraDistance;
468 for(unsigned iDim=0; iDim<2; ++iDim) {
469 latticePosition[iDim] = util::round( positionInCache[iDim] / this->_latticeSpacing );
470 latticePosition[iDim] = util::max(0, latticePosition[iDim]);
471 latticePosition[iDim] = util::min(this->_blockData->getExtent()[iDim] - 1, latticePosition[iDim]);
472 // The extra distance is always positive because it must be outside the geometry
473 extraDistance[iDim] = util::abs(_latticeSpacing * latticePosition[iDim] - positionInCache[iDim]);
474 }
475 return this->_blockData->get(latticePosition.data()) + norm(extraDistance);
476}
477
478template <typename T, typename S, bool PARTICLE>
480{
481 return this->_blockData->get(input) < std::numeric_limits<T>::epsilon();
482}
483
484template <typename T, typename S, bool PARTICLE>
486{
487 PhysR<T,2> pos(input[0], input[1]);
488 if constexpr(!PARTICLE) {
489 pos = util::executeRotation<S,2,true>(pos, this->_rotMat, this->getPos());
490 }
491 if(norm(pos) < this->_circumRadius) {
493 }
494 output[0] = T{0};
495 return false;
496}
497
498
499//Geng2019:
500template <typename T, typename S, bool PARTICLE>
502 : _radius(radius)
503{
504 this->_epsilon = epsilon;
505 if constexpr (!PARTICLE) {
506 this->_pos = center;
507 }
508
509 this->_circumRadius = radius + 0.5*epsilon;
510 if constexpr (!PARTICLE) {
511 this->_myMin = {center[0] - this->getCircumRadius(), center[1] - this->getCircumRadius()};
512 this->_myMax = {center[0] + this->getCircumRadius(), center[1] + this->getCircumRadius()};
513 this->_theta = 0.;
514 this->init();
515 }
516
517 T mass = M_PI*radius*radius*density;
518 T mofi = 0.5 * mass * radius * radius;
519}
520
521template <typename T, typename S, bool PARTICLE>
523{
524 T mass = M_PI*_radius*_radius*density;
525 T mofi = 0.5 * mass * _radius * _radius;
526 return Vector<S,2>(mofi, mass);
527}
528
529// returns true if x is inside the sphere
530template <typename T, typename S, bool PARTICLE>
532{
533 double distToCenter2 = util::pow(this->getPos()[0]-input[0], 2) +
534 util::pow(this->getPos()[1]-input[1], 2);
535
536
537 double d = util::sqrt(distToCenter2) - this->_radius;
538 output[0] = T((1.-tanh(d/this->getEpsilon()))/2.);
539 return true;
540}
541
542//Factored-Indicator for circular boundary layer:
543template <typename T, typename S, bool PARTICLE>
545 : _radius(radius), _factor(factor)
546{
547 this->_epsilon = epsilon;
548 if constexpr (!PARTICLE) {
549 this->_pos = center;
550 }
551
552 this->_circumRadius = radius + 0.5*epsilon;
553 if constexpr (!PARTICLE) {
554 this->_myMin = {center[0] - this->getCircumRadius(), center[1] - this->getCircumRadius()};
555 this->_myMax = {center[0] + this->getCircumRadius(), center[1] + this->getCircumRadius()};
556 this->init();
557 }
558}
559
560template <typename T, typename S, bool PARTICLE>
562{
563 T mass = M_PI*_radius*_radius*density;
564 T mofi = 0.5 * mass * _radius * _radius;
565 return Vector<S,2>(mofi, mass);
566}
567
568// returns true if x is inside the sphere
569template <typename T, typename S, bool PARTICLE>
571{
572 double distToCenter2 = util::pow(this->getPos()[0]-input[0], 2) +
573 util::pow(this->getPos()[1]-input[1], 2);
574 /*double d = util::sqrt(distToCenter2) - this->_radius + this->getEpsilon()/2;
575
576 if(d <= 0){
577 output[0] = T(this->_factor);
578 return true;
579 }
580 else if(d > 0 && d <= this->getEpsilon()){
581 output[0] = T(- this->_factor*(d-this->getEpsilon())/this->getEpsilon());
582 return true;
583 }
584 else{
585 output[0] = 0;
586 return false;
587 }*/
588
589 double d = util::sqrt(distToCenter2) - this->_radius;
590 output[0] = T(this->_factor*(1.-tanh(d/this->getEpsilon()))/2.);
591 return true;
592}
593
594//Factored-Indicator for flat boundary layer:
595template <typename T, typename S, bool PARTICLE>
596SmoothIndicatorFactoredCuboid2D<T,S,PARTICLE>::SmoothIndicatorFactoredCuboid2D(Vector<S,2> center, S xLength, S yLength, S epsilon, S density, Vector<S,2> vel, S omega, S factor)
597 : _xLength(xLength), _yLength(yLength), _factor(factor)
598{
599 this->_epsilon = epsilon;
600 if constexpr (!PARTICLE) {
601 this->_pos = center;
602 }
603
604 this->_circumRadius = .5*(util::sqrt(util::pow( xLength, 2)+util::pow( yLength, 2))) + 0.5*epsilon;
605 if constexpr (!PARTICLE) {
606 this->_myMin = {
607 this->_pos[0] - this->getCircumRadius(),
608 this->_pos[1] - this->getCircumRadius()
609 };
610 this->_myMax = {
611 this->_pos[0] + this->getCircumRadius(),
612 this->_pos[1] + this->getCircumRadius()
613 };
614 this->init();
615 }
616}
617
618template <typename T, typename S, bool PARTICLE>
620{
621 T mass = _xLength*_yLength*density;
622 T mofi = 1./12.*mass*(_xLength*_xLength+_yLength*_yLength);
623 return Vector<S,2>(mofi, mass);
624}
625
626// returns true if x is inside the sphere
627template <typename T, typename S, bool PARTICLE>
629{
630 T d;
631 if(_xLength == 0){
632 T distToCenter2 = util::pow(this->getPos()[1]-input[1], 2);
633 d = util::sqrt(distToCenter2) - this->_yLength/2. /*+ this->getEpsilon()/2*/;
634 }
635 else if(_yLength == 0){
636 T distToCenter2 = util::pow(this->getPos()[0]-input[0], 2);
637 d = util::sqrt(distToCenter2) - this->_xLength/2. + this->getEpsilon()/2;
638 }
639 else{
640 T distToCenter2x = util::pow(this->getPos()[0]-input[0], 2);
641 T distToCenter2y = util::pow(this->getPos()[1]-input[1], 2);
642 T ratio = util::sqrt(distToCenter2y)/util::sqrt(distToCenter2x);
643 if(ratio >= _yLength/_xLength){
644 d = util::sqrt(distToCenter2y) - this->_yLength/2. + this->getEpsilon()/2;
645 }
646 else{
647 d = util::sqrt(distToCenter2x) - this->_xLength/2. + this->getEpsilon()/2;
648 }
649 }
650
651 /*if(d <= 0){
652 output[0] = T(this->_factor);
653 return true;
654 }
655 else if(d > 0 && d <= this->getEpsilon()){
656 output[0] = T(- this->_factor*(d-this->getEpsilon())/this->getEpsilon());
657 return true;
658 }
659 else{
660 output[0] = 0;
661 return false;
662 }*/
663 output[0] = T(this->_factor*(1.-tanh(d/this->getEpsilon()))/2.);
664 return true;
665}
666
667
668} // namespace olb
669
670#endif
#define M_PI
indicator function for a 2D circle
S const getRadius() const
indicator function for a 2D-cuboid, parallel to the planes x=0, y=0; theta rotates cuboid around its ...
S const getxLength() const
indicator function for a 2D equilateral triangle
IndicatorF2D is an application from .
class for marking output with some text
implements a smooth circle in 2D with an _epsilon sector
Vector< S, 2 > surfaceNormal(const Vector< S, 2 > &pos, const S meshSize) override
IndicatorCircle2D< S > & getIndicator()
Vector< S, 2 > calcMofiAndMass(const S density) override
SmoothIndicatorCircle2D(IndicatorCircle2D< S > &indPtr, S epsilon)
const S signedDistance(const Vector< S, 2 > input) override
bool distance(S &distance, const Vector< S, 2 > &origin, const Vector< S, 2 > &direction, S precision, S pitch) override
implements a smooth cuboid in 2D with an _epsilon sector.
bool distance(S &distance, const Vector< S, 2 > &origin, const Vector< S, 2 > &direction, S precision, S pitch) override
IndicatorCuboid2D< S > & getIndicator()
Vector< S, 2 > surfaceNormal(const Vector< S, 2 > &pos, const S meshSize) override
const S signedDistance(const Vector< S, 2 > input) override
Vector< S, 2 > calcMofiAndMass(const S density) override
SmoothIndicatorCuboid2D(IndicatorCuboid2D< S > &ind, S epsilon, S theta=0)
Vector< S, 2 > surfaceNormal(const Vector< S, 2 > &pos, const S meshSize) override
bool operator()(T output[], const S input[]) override
SmoothIndicatorCustom2D(T latticeSpacing, std::shared_ptr< IndicatorF2D< T > > indPtr, Vector< T, 2 > pos, T epsilon, T theta=0.)
const S signedDistance(const Vector< S, 2 > input) override
Vector< T, 2 > calcMofiAndMass(T rhoP) override
calculates and returns mofi and mass of the particle (mofi is at index 0 and mass at index 1)
Vector< S, 2 > calcMofiAndMass(const S density) override
SmoothIndicatorFactoredCircle2D(Vector< S, 2 > center, S radius, S epsilon, S density=0, Vector< S, 2 > vel=Vector< S, 2 >(0., 0.), S omega=0, S factor=1.)
bool operator()(T output[], const S input[]) override
Vector< S, 2 > calcMofiAndMass(const S density) override
SmoothIndicatorFactoredCuboid2D(Vector< S, 2 > center, S xLength, S yLength, S epsilon, S density=0, Vector< S, 2 > vel=Vector< S, 2 >(0., 0.), S omega=0, S factor=1.)
bool operator()(T output[], const S input[]) override
Vector< S, 2 > calcMofiAndMass(const S density) override
SmoothIndicatorHTCircle2D(Vector< S, 2 > center, S radius, S epsilon, S density=0, Vector< S, 2 > vel=Vector< S, 2 >(0., 0.), S omega=0)
bool operator()(T output[], const S input[]) override
implements a smooth triangle in 2D with an _epsilon sector
Vector< S, 2 > surfaceNormal(const Vector< S, 2 > &pos, const S meshSize) override
IndicatorEquiTriangle2D< S > & getIndicator()
SmoothIndicatorTriangle2D(IndicatorEquiTriangle2D< S > &indPtr, S epsilon, S theta=0)
Vector< S, 2 > calcMofiAndMass(const S density) override
bool distance(S &distance, const Vector< S, 2 > &origin, const Vector< S, 2 > &direction, S precision, S pitch) override
const S signedDistance(const Vector< S, 2 > input) override
Plain old scalar vector.
Definition vector.h:47
constexpr const T * data() const any_platform
Definition vector.h:161
Pack< T > min(Pack< T > rhs, Pack< T > lhs)
Definition 256.h:406
Pack< T > max(Pack< T > rhs, Pack< T > lhs)
Definition 256.h:416
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
ADf< T, DIM > abs(const ADf< T, DIM > &a)
Definition aDiff.h:1019
ADf< T, DIM > ceil(const ADf< T, DIM > &a)
Definition aDiff.h:900
cpu::simd::Pack< T > min(cpu::simd::Pack< T > rhs, cpu::simd::Pack< T > lhs)
Definition pack.h:124
ADf< T, DIM > round(const ADf< T, DIM > &a)
Definition aDiff.h:928
cpu::simd::Pack< T > max(cpu::simd::Pack< T > rhs, cpu::simd::Pack< T > lhs)
Definition pack.h:130
decltype(Vector< decltype(util::sqrt(T())), D >()) degreeToRadian(const Vector< T, D > &angle)
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112
Top level namespace for all of OpenLB.
typename util::BaseTypeHelper< T >::type BaseType
Definition baseType.h:59
constexpr T norm(const ScalarVector< T, D, IMPL > &a)
Euclidean vector norm.