template const sctl::Vector& Periodize::GetProxySurf() { static const sctl::Vector proxy_surf = [](){ sctl::Vector X; X.template Read("data/dn_equiv_surf.mat"); return X; }(); return proxy_surf; } template void Periodize::EvalFarField(sctl::Vector& U_far, const sctl::Vector& Xt, const sctl::Vector& U_proxy) { const auto& Mbc0 = GetMat_UC2DE0(); const auto& Mbc1 = GetMat_UC2DE1(); const sctl::Long N = Mbc0.Dim(0); SCTL_ASSERT(U_proxy.Dim() == N); // Compute the equivalent density at proxy points auto proxy_density = (sctl::Matrix(1,N,(sctl::Iterator)U_proxy.begin(),false) * Mbc0) * Mbc1; // Evaluate the potential from proxy points at the targets Xt U_far = 0; static const sctl::Stokes3D_FxU stokeslet; stokeslet.template Eval(U_far, Xt, GetProxySurf(), sctl::Vector(), sctl::Vector(N,proxy_density.begin(),false)); } template const sctl::Matrix& Periodize::GetMat_UC2DE0() { static sctl::Matrix Mbc = [](){ sctl::Matrix Mbc_ue2dc, M_dc2de0, M_uc2ue0, M_uc2ue1; M_uc2ue0.template Read("data/M_uc2ue0.mat"); M_uc2ue1.template Read("data/M_uc2ue1.mat"); Mbc_ue2dc.template Read("data/Mbc_ue2dc.mat"); M_dc2de0.template Read("data/M_dc2de0.mat"); return (M_uc2ue0 * (M_uc2ue1 * Mbc_ue2dc)) * M_dc2de0; }(); return Mbc; } template const sctl::Matrix& Periodize::GetMat_UC2DE1() { static sctl::Matrix Mbc = [](){ sctl::Matrix M_dc2de1; M_dc2de1.template Read("data/M_dc2de1.mat"); return M_dc2de1; }(); return Mbc; }