hemocell
Loading...
Searching...
No Matches
preInlet.h
Go to the documentation of this file.
1/*
2This file is part of the HemoCell library
3
4HemoCell is developed and maintained by the Computational Science Lab
5in the University of Amsterdam. Any questions or remarks regarding this library
6can be sent to: info@hemocell.eu
7
8When using the HemoCell library in scientific work please cite the
9corresponding paper: https://doi.org/10.3389/fphys.2017.00563
10
11The HemoCell library is free software: you can redistribute it and/or
12modify it under the terms of the GNU Affero General Public License as
13published by the Free Software Foundation, either version 3 of the
14License, or (at your option) any later version.
15
16The library is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU Affero General Public License for more details.
20
21You should have received a copy of the GNU Affero General Public License
22along with this program. If not, see <http://www.gnu.org/licenses/>.
23*/
24#ifndef PREINLET_H
25#define PREINLET_H
26
27class PreInlet;
30
31#include "core/geometry3D.h"
32#include "atomicBlock/atomicBlock3D.h"
33#include "config.h"
34#include "hemocell.h"
35
36#ifndef HEMOCELL_H
37namespace hemo {
38 class HemoCell;
39}
40#endif
41
45
46
47#define DSET_SLICE 1000
48
49namespace hemo {
50
51
52inline plint cellsInBoundingBox(plb::Box3D const & box) {
53 return abs((box.x1 - box.x0)*(box.y1-box.y0)*(box.z1-box.z0));
54}
55
56
57class PreInlet {
58public:
60 void processGenericBlocks(plb::Box3D, std::vector<plb::AtomicBlock3D*>);
63 public:
65 count(count_) {count = 0;}
66 };
68 void processGenericBlocks(plb::Box3D, std::vector<plb::AtomicBlock3D*>);
70 plb::Box3D & boundingBox;
72 public:
73 CreatePreInletBoundingBox(plb::Box3D & b_, bool & fp_) :
74 boundingBox(b_), foundPreInlet(fp_) {}
75 };
76
78 void processGenericBlocks(plb::Box3D, std::vector<plb::AtomicBlock3D*>);
79 FillFlagMatrix * clone() const;
80 };
81
82 PreInlet(hemo::HemoCell * hemocell_, plb::MultiScalarField3D<int> * flagMatrix_);
83 PreInlet(hemo::HemoCell * hemocell_, plb::MultiBlockManagement3D & management);
85 void createBoundary();
87 void setDrivingForce();
88 void setDrivingForceTimeDependent(double t);
90 double interpolate(vector<double> &xData, vector<double> &yData, double x, bool extrapolate);
91 double average(vector<double> values);
99
101 void preInletFromSlice(Direction direction_, Box3D boundary);
102
104 plb::Box3D location;
105 plb::Box3D fluidInlet;
106 int nProcs = 0;
107 bool initialized = false;
108 double drivingForce = 0.0;
109 double average_vel = 0.0;
110 double pulseEndTime = 1.0;
111 double pFrequency = 1.0;
112 std::vector<double> normalizedVelocityTimes;
113 std::vector<double> normalizedVelocityValues;
114 std::map<plint,plint> BlockToMpi;
115 std::map<int,plint> particleSendMpi;
116 std::map<int,bool> particleReceiveMpi;
117 std::vector<plint> communicating_blocks;
118 std::map<int, Box3D> domain_at_rank;
119 std::vector<int> my_send_blocks;
120 std::vector<int> my_recv_blocks;
122 bool partOfpreInlet = false;
126 std::vector<int> particle_receivers;
127 std::vector<int> particle_senders;
129 MultiScalarField3D<int> *flagMatrix = 0;
130};
131
132}
133#endif /* PREINLET_H */
134
Definition hemoCellFunctional.h:36
Definition hemocell.h:68
plint & count
Definition preInlet.h:62
CreateDrivingForceFunctional(plint &count_)
Definition preInlet.h:64
CreateDrivingForceFunctional * clone() const
Definition preInlet.cpp:989
void processGenericBlocks(plb::Box3D, std::vector< plb::AtomicBlock3D * >)
Definition preInlet.cpp:715
bool & foundPreInlet
Definition preInlet.h:71
CreatePreInletBoundingBox(plb::Box3D &b_, bool &fp_)
Definition preInlet.h:73
CreatePreInletBoundingBox * clone() const
Definition preInlet.cpp:988
plb::Box3D & boundingBox
Definition preInlet.h:70
void processGenericBlocks(plb::Box3D, std::vector< plb::AtomicBlock3D * >)
Definition preInlet.cpp:561
Definition preInlet.h:77
void processGenericBlocks(plb::Box3D, std::vector< plb::AtomicBlock3D * >)
Definition preInlet.cpp:728
FillFlagMatrix * clone() const
Definition preInlet.cpp:990
Definition preInlet.h:57
bool initialized
Definition preInlet.h:107
int sendingBlocks
Definition preInlet.h:121
void createBoundary()
Definition preInlet.cpp:940
bool partOfpreInlet
Definition preInlet.h:122
Direction direction
Definition preInlet.h:103
bool readNormalizedVelocities()
Definition preInlet.cpp:802
void autoPreinletFromBoundary(Direction)
Definition preInlet.cpp:591
std::map< int, bool > particleReceiveMpi
Definition preInlet.h:116
std::vector< int > particle_senders
Definition preInlet.h:127
std::map< plint, plint > BlockToMpi
Definition preInlet.h:114
double pFrequency
Definition preInlet.h:111
bool communications_mapped
Definition preInlet.h:125
void applyPreInlet()
Definition preInlet.h:94
double drivingForce
Definition preInlet.h:108
std::vector< double > normalizedVelocityValues
Definition preInlet.h:113
void setDrivingForce()
Definition preInlet.cpp:913
double average_vel
Definition preInlet.h:109
void calculateDrivingForce()
Definition preInlet.cpp:742
double average(vector< double > values)
Definition preInlet.cpp:791
void applyPreInletVelocityBoundary()
Definition preInlet.cpp:353
void initializePreInletVelocityBoundary()
Definition preInlet.cpp:399
std::vector< plint > communicating_blocks
Definition preInlet.h:117
int inflow_length
Definition preInlet.h:123
void setDrivingForceTimeDependent(double t)
Definition preInlet.cpp:874
double interpolate(vector< double > &xData, vector< double > &yData, double x, bool extrapolate)
Definition preInlet.cpp:841
HemoCell * hemocell
Definition preInlet.h:128
std::vector< int > particle_receivers
Definition preInlet.h:126
MultiScalarField3D< int > * flagMatrix
Definition preInlet.h:129
std::vector< double > normalizedVelocityTimes
Definition preInlet.h:112
plb::Box3D fluidInlet
Definition preInlet.h:105
std::vector< int > my_send_blocks
Definition preInlet.h:119
void applyPreInletParticleBoundary()
Definition preInlet.cpp:254
std::map< int, plint > particleSendMpi
Definition preInlet.h:115
void initializePreInletParticleBoundary()
Definition preInlet.cpp:65
int nProcs
Definition preInlet.h:106
double pulseEndTime
Definition preInlet.h:110
plint getNumberOfNodes()
Definition preInlet.h:84
std::map< int, Box3D > domain_at_rank
Definition preInlet.h:118
int preinlet_length
Definition preInlet.h:124
void initializePreInlet()
Definition preInlet.h:98
plb::Box3D location
Definition preInlet.h:104
std::vector< int > my_recv_blocks
Definition preInlet.h:120
void preInletFromSlice(Direction direction_, Box3D boundary)
Definition preInlet.cpp:453
long int plint
Definition constant_defaults.h:127
Definition config.cpp:34
plint cellsInBoundingBox(plb::Box3D const &box)
Definition preInlet.h:52
Direction
Definition preInlet.h:42
@ Xpos
Definition preInlet.h:43
@ Ypos
Definition preInlet.h:43
@ Zneg
Definition preInlet.h:43
@ Xneg
Definition preInlet.h:43
@ Zpos
Definition preInlet.h:43
@ Yneg
Definition preInlet.h:43