37#include "ImmersedBoundary2dArrays.hpp"
44 mActiveSources(activeSources)
50 assert(num_gridpts_y % 2 == 0);
56 unsigned reduced_y = 1 + (num_gridpts_y/2);
59 mForceGrids.resize(extents[2][num_gridpts_x][num_gridpts_y]);
71 mOperator1.resize(extents[num_gridpts_x][reduced_y]);
72 mOperator2.resize(extents[num_gridpts_x][reduced_y]);
76 mSin2x.resize(num_gridpts_x);
83 double x_spacing = 1.0 / (
double) num_gridpts_x;
84 double y_spacing = 1.0 / (
double) num_gridpts_y;
86 for (
unsigned x = 0; x < num_gridpts_x; x++)
88 mSin2x[x] = sin(2 * M_PI * (
double) x * x_spacing);
91 for (
unsigned y = 0; y < reduced_y; y++)
93 mSin2y[y] = sin(2 * M_PI * (
double) y * y_spacing);
96 for (
unsigned x = 0; x < num_gridpts_x; x++)
98 for (
unsigned y = 0; y < reduced_y; y++)
103 double sin_x = sin(M_PI * (
double) x * x_spacing);
104 double sin_y = sin(M_PI * (
double) y * y_spacing);
106 mOperator2[x][y] = (sin_x * sin_x / (x_spacing * x_spacing)) + (sin_y * sin_y / (y_spacing * y_spacing));
107 mOperator2[x][y] *= 4.0 * dt / reynoldsNumber;
113template<
unsigned DIM>
118template<
unsigned DIM>
124template<
unsigned DIM>
127 return mRightHandSideGrids;
130template<
unsigned DIM>
133 return mSourceGradientGrids;
136template<
unsigned DIM>
139 return mFourierGrids;
142template<
unsigned DIM>
145 return mPressureGrid;
148template<
unsigned DIM>
154template<
unsigned DIM>
160template<
unsigned DIM>
166template<
unsigned DIM>
172template<
unsigned DIM>
178template<
unsigned DIM>
181 return mActiveSources;
multi_array< std::complex< double >, 3 > mFourierGrids
multi_array< double, 2 > mOperator2
virtual ~ImmersedBoundary2dArrays()
const std::vector< double > & rGetSin2x() const
multi_array< double, 3 > mRightHandSideGrids
multi_array< std::complex< double >, 2 > & rGetModifiablePressureGrid()
std::vector< double > mSin2x
const multi_array< double, 2 > & rGetOperator2() const
multi_array< double, 3 > mForceGrids
multi_array< std::complex< double >, 2 > mPressureGrid
multi_array< std::complex< double >, 3 > & rGetModifiableFourierGrids()
const multi_array< double, 2 > & rGetOperator1() const
ImmersedBoundary2dArrays()=delete
ImmersedBoundaryMesh< DIM, DIM > * GetMesh()
multi_array< double, 3 > & rGetModifiableSourceGradientGrids()
multi_array< double, 2 > mOperator1
ImmersedBoundaryMesh< DIM, DIM > * mpMesh
multi_array< double, 3 > mSourceGradientGrids
multi_array< double, 3 > & rGetModifiableRightHandSideGrids()
std::vector< double > mSin2y
const std::vector< double > & rGetSin2y() const
multi_array< double, 3 > & rGetModifiableForceGrids()
unsigned GetNumGridPtsX() const
unsigned GetNumGridPtsY() const