Skip to content

Commit

Permalink
Multipole: add a complex field to surface
Browse files Browse the repository at this point in the history
  • Loading branch information
lwJi committed Jun 26, 2024
1 parent d4deca9 commit b5d03f6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Multipole/src/surface.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public:
x_.resize(arraySize);
y_.resize(arraySize);
z_.resize(arraySize);
real_.resize(arraySize);
imag_.resize(arraySize);

// Add an offset for midpoint integration.
const CCTK_REAL is_midpoint = static_cast<CCTK_REAL>(isMidPoint);
Expand All @@ -45,19 +47,22 @@ public:
const std::vector<CCTK_REAL> &getPhi() const { return phi_; }

protected:
inline int index2D(int it, int ip) { return it + (nTheta_ + 1) * ip; }
inline int index2D(int it, int ip) const { return it + (nTheta_ + 1) * ip; }

const int nTheta_, nPhi_;

std::vector<CCTK_REAL> theta_, phi_;
std::vector<CCTK_REAL> x_, y_, z_; // embedding map

// a complex field to be integrated on the surface
std::vector<CCTK_REAL> real_, imag_;
};

// 2D Sphere
class Sphere : public Surface {
public:
Sphere(int nTheta, int nPhi, bool isMidPoint, std::vector<int> spinWeights,
int lmax)
Sphere(int nTheta, int nPhi, bool isMidPoint,
const std::vector<int> &spinWeights, int lmax)
: Surface(nTheta, nPhi, isMidPoint), spin_weights_(spinWeights),
lmax_(lmax) {
xhat_.resize(theta_.size());
Expand Down

0 comments on commit b5d03f6

Please sign in to comment.