24#ifndef IMMERSEDBOUNDARYMETHOD_H
25#define IMMERSEDBOUNDARYMETHOD_H
33 return x[0]>=box.x0 && x[0]<=box.x1 &&
34 x[1]>=box.y0 && x[1]<=box.y1 &&
35 x[2]>=box.z0 && x[2]<=box.z1;
52template<
typename T,
template<
typename U>
class Descriptor>
55 std::vector<Dot3D>& cellPos, std::vector<T>& weights);
57template<
typename T,
template<
typename U>
class Descriptor>
60 std::vector<Dot3D>& cellPos, std::vector<T>& weights);
69 #ifdef INTERIOR_VISCOSITY
70 particle.kernelCoordinates.clear();
71 particle.kernelCoordinates.reserve(8);
75 const plint x0=-1, x1=2;
78 const Dot3D tmpDot = block.getLocation();
83 const hemo::Array<T,3> position = {position_tmp[0] -relLoc[0], position_tmp[1]-relLoc[1],position_tmp[2]-relLoc[2]};
89 const Box3D boundingBox = block.getBoundingBox();
99 for (
int dx = x0; dx < x1; ++dx) {
100 for (
int dy = x0; dy < x1; ++dy) {
101 for (
int dz = x0; dz < x1; ++dz) {
102 posInBlock = {center[0] + dx, center[1] + dy, center[2] + dz};
109 phi[0] = (position[0] - posInBlock[0]);
110 phi[1] = (position[1] - posInBlock[1]);
111 phi[2] = (position[2] - posInBlock[2]);
118 if (block.get(posInBlock[0],posInBlock[1],posInBlock[2]).getDynamics().isBoundary()) {
122 total_weight+=weight;
125 particle.
kernelLocations.push_back(&block.get(posInBlock[0],posInBlock[1],posInBlock[2]));
127 #ifdef INTERIOR_VISCOSITY
129 particle.kernelCoordinates.push_back({posInBlock[0],posInBlock[1],posInBlock[2]});
134 const T weight_coeff = 1.0 / total_weight;
136 weight_ *= weight_coeff;
140template<
typename T,
template<
typename U>
class Descriptor>
143 BlockLattice3D<T,Descriptor>
const& block,
hemo::Array<T,3> const& position,
144 std::vector<Dot3D>& cellPos, std::vector<T>& weights);
148 std::vector<Dot3D>& cellPos, std::vector<double>& weights);
150template<
typename T,
template<
typename U>
class Descriptor>
152 BlockLattice3D<T,Descriptor>
const& block,
hemo::Array<T,3> const& position,
153 std::vector<Dot3D>& cellPos, std::vector<T>& weights);
159template<
typename T,
template<
typename U>
class Descriptor>
161 std::vector<Dot3D>& cellPos, std::vector<T>& weights) ;
Definition hemoCellParticle.h:40
std::vector< T > kernelWeights
Definition hemoCellParticle.h:76
serializeValues_t sv
Definition hemoCellParticle.h:65
std::vector< plb::Cell< T, DESCRIPTOR > * > kernelLocations
Definition hemoCellParticle.h:75
double T
Definition constant_defaults.h:118
long int plint
Definition constant_defaults.h:127
void curateInterpolationCoefficients(BlockLattice3D< T, Descriptor > &fluid, std::vector< Dot3D > &cellPos, std::vector< T > &weights)
bool contained_sane(hemo::Array< plint, 3 > const &x, Box3D const &box)
Decide if a Lagrangian point is contained in 3D box, boundaries exclusive.
Definition immersedBoundaryMethod.h:32
void interpolationCoefficientsPhi3(BlockLattice3D< T, Descriptor > const &block, hemo::Array< T, 3 > const &position, std::vector< Dot3D > &cellPos, std::vector< T > &weights)
void interpolationCoefficientsPhi4(BlockLattice3D< double, DESCRIPTOR > const &block, hemo::Array< double, 3 > const &position, std::vector< Dot3D > &cellPos, std::vector< double > &weights)
void interpolationCoefficientsPhi2(BlockLattice3D< T, DESCRIPTOR > &block, HemoCellParticle &particle)
Definition immersedBoundaryMethod.h:62
T phi2(T x)
Definition immersedBoundaryMethod.h:37
void interpolationCoefficients(BlockLattice3D< T, Descriptor > const &block, hemo::Array< T, 3 > const &position, std::vector< Dot3D > &cellPos, std::vector< T > &weights)
void interpolationCoefficientsPhi4c(BlockLattice3D< T, Descriptor > const &block, hemo::Array< T, 3 > const &position, std::vector< Dot3D > &cellPos, std::vector< T > &weights)
void interpolationCoefficientsPhi1(BlockLattice3D< T, Descriptor > const &block, hemo::Array< T, 3 > const &position, std::vector< Dot3D > &cellPos, std::vector< T > &weights)
hemo::Array< T, 3 > position
Definition hemoCellParticle.h:47