periodize.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef _PERIODIZE_HPP_
  2. #define _PERIODIZE_HPP_
  3. #include <csbq.hpp>
  4. /**
  5. * Gives the far-field component to periodize Stokes flow.
  6. */
  7. template <class Real> class Periodize {
  8. //using PrecompReal = long double;
  9. using PrecompReal = double;
  10. public:
  11. /**
  12. * @return Coordinates (in AoS order) of proxy points around unit box [0,1]^3.
  13. */
  14. static const sctl::Vector<Real>& GetProxySurf();
  15. /**
  16. * Return the far-field requires to periodize the flow.
  17. *
  18. * @param[out] U_far the far-field potential evaluated at Xt.
  19. *
  20. * @param[in] Xt the target coordinates in the unit box [0,1]^3
  21. *
  22. * @param[in] U_proxy the outgoing field from the unit box evaluated at the proxy points.
  23. */
  24. static void EvalFarField(sctl::Vector<Real>& U_far, const sctl::Vector<Real>& Xt, const sctl::Vector<Real>& U_proxy);
  25. private:
  26. // Notation:
  27. // UC: upward-check (outgoing field evaluated at the upward-check points)
  28. // UE: upward-equivalent (equivalent density at the proxy points that produces the same outgoing field)
  29. // DC: downward-check (incoming field evaluated at the downward-check points)
  30. // DE: downward-equivalent (equivalent density at the proxy points that produces the same incoming field)
  31. //
  32. // The operator matrix is split in two factors for backward stability: GetMat_UC2DE0() and GetMat_UC2DE1().
  33. // If we multiply the two matrices together then we lose accuracy.
  34. static const sctl::Matrix<Real>& GetMat_UC2DE0();
  35. static const sctl::Matrix<Real>& GetMat_UC2DE1();
  36. };
  37. #include "periodize.cpp"
  38. #endif