Reuse mass integrand across detector radii
This commit is contained in:
@@ -7118,6 +7118,10 @@ void bssn_class::AnalysisStuff(int lev, double dT_lev)
|
||||
IP = new double[NN];
|
||||
RoutMAP = new double[7];
|
||||
double Rex = maxrex;
|
||||
bool patch_mass_prepared = false;
|
||||
#ifdef WithShell
|
||||
bool shell_mass_prepared = false;
|
||||
#endif
|
||||
for (int i = 0; i < decn; i++)
|
||||
{
|
||||
#ifdef Point_Psi4
|
||||
@@ -7145,7 +7149,8 @@ void bssn_class::AnalysisStuff(int lev, double dT_lev)
|
||||
gxx0, gxy0, gxz0, gyy0, gyz0, gzz0,
|
||||
Axx0, Axy0, Axz0, Ayy0, Ayz0, Azz0,
|
||||
Gmx0, Gmy0, Gmz0, Sfx1, Sfy1, Sfz1, // here we can not touch rhs variables, but 1 variables
|
||||
RoutMAP, ErrorMonitor);
|
||||
RoutMAP, ErrorMonitor, !patch_mass_prepared);
|
||||
patch_mass_prepared = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -7153,14 +7158,16 @@ void bssn_class::AnalysisStuff(int lev, double dT_lev)
|
||||
gxx0, gxy0, gxz0, gyy0, gyz0, gzz0,
|
||||
Axx0, Axy0, Axz0, Ayy0, Ayz0, Azz0,
|
||||
Gmx0, Gmy0, Gmz0, Sfx1, Sfy1, Sfz1, // here we can not touch rhs variables, but 1 variables
|
||||
RoutMAP, ErrorMonitor);
|
||||
RoutMAP, ErrorMonitor, !shell_mass_prepared);
|
||||
shell_mass_prepared = true;
|
||||
}
|
||||
#else
|
||||
Waveshell->surf_MassPAng(Rex, lev, GH, phi0, trK0,
|
||||
gxx0, gxy0, gxz0, gyy0, gyz0, gzz0,
|
||||
Axx0, Axy0, Axz0, Ayy0, Ayz0, Azz0,
|
||||
Gmx0, Gmy0, Gmz0, Sfx1, Sfy1, Sfz1, // here we can not touch rhs variables, but 1 variables
|
||||
RoutMAP, ErrorMonitor);
|
||||
RoutMAP, ErrorMonitor, !patch_mass_prepared);
|
||||
patch_mass_prepared = true;
|
||||
#endif
|
||||
#else
|
||||
// misc::tillherecheck(GH->Commlev[lev],GH->start_rank[lev],"before surface integral");
|
||||
@@ -7172,7 +7179,8 @@ void bssn_class::AnalysisStuff(int lev, double dT_lev)
|
||||
gxx0, gxy0, gxz0, gyy0, gyz0, gzz0,
|
||||
Axx0, Axy0, Axz0, Ayy0, Ayz0, Azz0,
|
||||
Gmx0, Gmy0, Gmz0, Sfx1, Sfy1, Sfz1, // here we can not touch rhs variables, but 1 variables
|
||||
RoutMAP, ErrorMonitor);
|
||||
RoutMAP, ErrorMonitor, !patch_mass_prepared);
|
||||
patch_mass_prepared = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -7181,7 +7189,8 @@ void bssn_class::AnalysisStuff(int lev, double dT_lev)
|
||||
gxx0, gxy0, gxz0, gyy0, gyz0, gzz0,
|
||||
Axx0, Axy0, Axz0, Ayy0, Ayz0, Azz0,
|
||||
Gmx0, Gmy0, Gmz0, Sfx1, Sfy1, Sfz1, // here we can not touch rhs variables, but 1 variables
|
||||
RoutMAP, ErrorMonitor);
|
||||
RoutMAP, ErrorMonitor, !shell_mass_prepared);
|
||||
shell_mass_prepared = true;
|
||||
}
|
||||
#else
|
||||
#if (PSTR == 0)
|
||||
@@ -7190,7 +7199,8 @@ void bssn_class::AnalysisStuff(int lev, double dT_lev)
|
||||
gxx0, gxy0, gxz0, gyy0, gyz0, gzz0,
|
||||
Axx0, Axy0, Axz0, Ayy0, Ayz0, Azz0,
|
||||
Gmx0, Gmy0, Gmz0, Sfx1, Sfy1, Sfz1, // here we can not touch rhs variables, but 1 variables
|
||||
RoutMAP, ErrorMonitor);
|
||||
RoutMAP, ErrorMonitor, !patch_mass_prepared);
|
||||
patch_mass_prepared = true;
|
||||
#elif (PSTR == 1 || PSTR == 2)
|
||||
Waveshell->surf_Wave(Rex, lev, GH, Rpsi4, Ipsi4, 2, maxl, NN, RP, IP, ErrorMonitor, GH->Commlev[lev]);
|
||||
// misc::tillherecheck(GH->Commlev[lev],GH->start_rank[lev],"after surf_Wave");
|
||||
@@ -7198,7 +7208,8 @@ void bssn_class::AnalysisStuff(int lev, double dT_lev)
|
||||
gxx0, gxy0, gxz0, gyy0, gyz0, gzz0,
|
||||
Axx0, Axy0, Axz0, Ayy0, Ayz0, Azz0,
|
||||
Gmx0, Gmy0, Gmz0, Sfx1, Sfy1, Sfz1, // here we can not touch rhs variables, but 1 variables
|
||||
RoutMAP, ErrorMonitor, GH->Commlev[lev]);
|
||||
RoutMAP, ErrorMonitor, GH->Commlev[lev], !patch_mass_prepared);
|
||||
patch_mass_prepared = true;
|
||||
#endif
|
||||
#endif
|
||||
// misc::tillherecheck(GH->Commlev[lev],GH->start_rank[lev],"end surface integral");
|
||||
|
||||
@@ -2319,7 +2319,7 @@ void surface_integral::surf_MassPAng(double rex, int lev, cgh *GH, var *chi, var
|
||||
var *Axx, var *Axy, var *Axz, var *Ayy, var *Ayz, var *Azz,
|
||||
var *Gmx, var *Gmy, var *Gmz,
|
||||
var *Sfx_rhs, var *Sfy_rhs, var *Sfz_rhs, // temparay memory for mass^i
|
||||
double *Rout, monitor *Monitor)
|
||||
double *Rout, monitor *Monitor, bool refresh_mass_fields)
|
||||
{
|
||||
if (myrank == 0 && GH->grids[lev] != 1)
|
||||
if (Monitor && Monitor->outfile)
|
||||
@@ -2329,28 +2329,31 @@ void surface_integral::surf_MassPAng(double rex, int lev, cgh *GH, var *chi, var
|
||||
|
||||
double mass, px, py, pz, sx, sy, sz;
|
||||
|
||||
MyList<Patch> *Pp = GH->PatL[lev];
|
||||
while (Pp)
|
||||
if (refresh_mass_fields)
|
||||
{
|
||||
MyList<Block> *BP = Pp->data->blb;
|
||||
while (BP)
|
||||
MyList<Patch> *Pp = GH->PatL[lev];
|
||||
while (Pp)
|
||||
{
|
||||
Block *cg = BP->data;
|
||||
if (myrank == cg->rank)
|
||||
MyList<Block> *BP = Pp->data->blb;
|
||||
while (BP)
|
||||
{
|
||||
f_admmass_bssn(cg->shape, cg->X[0], cg->X[1], cg->X[2],
|
||||
cg->fgfs[chi->sgfn], cg->fgfs[trK->sgfn],
|
||||
cg->fgfs[gxx->sgfn], cg->fgfs[gxy->sgfn], cg->fgfs[gxz->sgfn], cg->fgfs[gyy->sgfn], cg->fgfs[gyz->sgfn], cg->fgfs[gzz->sgfn],
|
||||
cg->fgfs[Axx->sgfn], cg->fgfs[Axy->sgfn], cg->fgfs[Axz->sgfn], cg->fgfs[Ayy->sgfn], cg->fgfs[Ayz->sgfn], cg->fgfs[Azz->sgfn],
|
||||
cg->fgfs[Gmx->sgfn], cg->fgfs[Gmy->sgfn], cg->fgfs[Gmz->sgfn],
|
||||
cg->fgfs[Sfx_rhs->sgfn], cg->fgfs[Sfy_rhs->sgfn], cg->fgfs[Sfz_rhs->sgfn],
|
||||
Symmetry);
|
||||
Block *cg = BP->data;
|
||||
if (myrank == cg->rank)
|
||||
{
|
||||
f_admmass_bssn(cg->shape, cg->X[0], cg->X[1], cg->X[2],
|
||||
cg->fgfs[chi->sgfn], cg->fgfs[trK->sgfn],
|
||||
cg->fgfs[gxx->sgfn], cg->fgfs[gxy->sgfn], cg->fgfs[gxz->sgfn], cg->fgfs[gyy->sgfn], cg->fgfs[gyz->sgfn], cg->fgfs[gzz->sgfn],
|
||||
cg->fgfs[Axx->sgfn], cg->fgfs[Axy->sgfn], cg->fgfs[Axz->sgfn], cg->fgfs[Ayy->sgfn], cg->fgfs[Ayz->sgfn], cg->fgfs[Azz->sgfn],
|
||||
cg->fgfs[Gmx->sgfn], cg->fgfs[Gmy->sgfn], cg->fgfs[Gmz->sgfn],
|
||||
cg->fgfs[Sfx_rhs->sgfn], cg->fgfs[Sfy_rhs->sgfn], cg->fgfs[Sfz_rhs->sgfn],
|
||||
Symmetry);
|
||||
}
|
||||
if (BP == Pp->data->ble)
|
||||
break;
|
||||
BP = BP->next;
|
||||
}
|
||||
if (BP == Pp->data->ble)
|
||||
break;
|
||||
BP = BP->next;
|
||||
Pp = Pp->next;
|
||||
}
|
||||
Pp = Pp->next;
|
||||
}
|
||||
|
||||
const int InList = 17;
|
||||
@@ -2581,7 +2584,7 @@ void surface_integral::surf_MassPAng(double rex, int lev, cgh *GH, var *chi, var
|
||||
var *Axx, var *Axy, var *Axz, var *Ayy, var *Ayz, var *Azz,
|
||||
var *Gmx, var *Gmy, var *Gmz,
|
||||
var *Sfx_rhs, var *Sfy_rhs, var *Sfz_rhs, // temparay memory for mass^i
|
||||
double *Rout, monitor *Monitor, MPI_Comm Comm_here)
|
||||
double *Rout, monitor *Monitor, MPI_Comm Comm_here, bool refresh_mass_fields)
|
||||
{
|
||||
int lmyrank;
|
||||
MPI_Comm_rank(Comm_here, &lmyrank);
|
||||
@@ -2593,28 +2596,31 @@ void surface_integral::surf_MassPAng(double rex, int lev, cgh *GH, var *chi, var
|
||||
|
||||
double mass, px, py, pz, sx, sy, sz;
|
||||
|
||||
MyList<Patch> *Pp = GH->PatL[lev];
|
||||
while (Pp)
|
||||
if (refresh_mass_fields)
|
||||
{
|
||||
MyList<Block> *BP = Pp->data->blb;
|
||||
while (BP)
|
||||
MyList<Patch> *Pp = GH->PatL[lev];
|
||||
while (Pp)
|
||||
{
|
||||
Block *cg = BP->data;
|
||||
if (myrank == cg->rank)
|
||||
MyList<Block> *BP = Pp->data->blb;
|
||||
while (BP)
|
||||
{
|
||||
f_admmass_bssn(cg->shape, cg->X[0], cg->X[1], cg->X[2],
|
||||
cg->fgfs[chi->sgfn], cg->fgfs[trK->sgfn],
|
||||
cg->fgfs[gxx->sgfn], cg->fgfs[gxy->sgfn], cg->fgfs[gxz->sgfn], cg->fgfs[gyy->sgfn], cg->fgfs[gyz->sgfn], cg->fgfs[gzz->sgfn],
|
||||
cg->fgfs[Axx->sgfn], cg->fgfs[Axy->sgfn], cg->fgfs[Axz->sgfn], cg->fgfs[Ayy->sgfn], cg->fgfs[Ayz->sgfn], cg->fgfs[Azz->sgfn],
|
||||
cg->fgfs[Gmx->sgfn], cg->fgfs[Gmy->sgfn], cg->fgfs[Gmz->sgfn],
|
||||
cg->fgfs[Sfx_rhs->sgfn], cg->fgfs[Sfy_rhs->sgfn], cg->fgfs[Sfz_rhs->sgfn],
|
||||
Symmetry);
|
||||
Block *cg = BP->data;
|
||||
if (myrank == cg->rank)
|
||||
{
|
||||
f_admmass_bssn(cg->shape, cg->X[0], cg->X[1], cg->X[2],
|
||||
cg->fgfs[chi->sgfn], cg->fgfs[trK->sgfn],
|
||||
cg->fgfs[gxx->sgfn], cg->fgfs[gxy->sgfn], cg->fgfs[gxz->sgfn], cg->fgfs[gyy->sgfn], cg->fgfs[gyz->sgfn], cg->fgfs[gzz->sgfn],
|
||||
cg->fgfs[Axx->sgfn], cg->fgfs[Axy->sgfn], cg->fgfs[Axz->sgfn], cg->fgfs[Ayy->sgfn], cg->fgfs[Ayz->sgfn], cg->fgfs[Azz->sgfn],
|
||||
cg->fgfs[Gmx->sgfn], cg->fgfs[Gmy->sgfn], cg->fgfs[Gmz->sgfn],
|
||||
cg->fgfs[Sfx_rhs->sgfn], cg->fgfs[Sfy_rhs->sgfn], cg->fgfs[Sfz_rhs->sgfn],
|
||||
Symmetry);
|
||||
}
|
||||
if (BP == Pp->data->ble)
|
||||
break;
|
||||
BP = BP->next;
|
||||
}
|
||||
if (BP == Pp->data->ble)
|
||||
break;
|
||||
BP = BP->next;
|
||||
Pp = Pp->next;
|
||||
}
|
||||
Pp = Pp->next;
|
||||
}
|
||||
|
||||
const int InList = 17;
|
||||
@@ -2853,7 +2859,7 @@ void surface_integral::surf_MassPAng(double rex, int lev, ShellPatch *GH, var *c
|
||||
var *Axx, var *Axy, var *Axz, var *Ayy, var *Ayz, var *Azz,
|
||||
var *Gmx, var *Gmy, var *Gmz,
|
||||
var *Sfx_rhs, var *Sfy_rhs, var *Sfz_rhs, // temparay memory for mass^i
|
||||
double *Rout, monitor *Monitor)
|
||||
double *Rout, monitor *Monitor, bool refresh_mass_fields)
|
||||
{
|
||||
if (lev != 0)
|
||||
{
|
||||
@@ -2869,39 +2875,42 @@ void surface_integral::surf_MassPAng(double rex, int lev, ShellPatch *GH, var *c
|
||||
|
||||
double mass, px, py, pz, sx, sy, sz;
|
||||
|
||||
MyList<ss_patch> *Pp = GH->PatL;
|
||||
while (Pp)
|
||||
if (refresh_mass_fields)
|
||||
{
|
||||
MyList<Block> *BL = Pp->data->blb;
|
||||
int fngfs = Pp->data->fngfs;
|
||||
while (BL)
|
||||
MyList<ss_patch> *Pp = GH->PatL;
|
||||
while (Pp)
|
||||
{
|
||||
Block *cg = BL->data;
|
||||
if (myrank == cg->rank)
|
||||
MyList<Block> *BL = Pp->data->blb;
|
||||
int fngfs = Pp->data->fngfs;
|
||||
while (BL)
|
||||
{
|
||||
f_admmass_bssn_ss(cg->shape, cg->X[0], cg->X[1], cg->X[2],
|
||||
cg->fgfs[fngfs + ShellPatch::gx], cg->fgfs[fngfs + ShellPatch::gy], cg->fgfs[fngfs + ShellPatch::gz],
|
||||
cg->fgfs[fngfs + ShellPatch::drhodx], cg->fgfs[fngfs + ShellPatch::drhody], cg->fgfs[fngfs + ShellPatch::drhodz],
|
||||
cg->fgfs[fngfs + ShellPatch::dsigmadx], cg->fgfs[fngfs + ShellPatch::dsigmady], cg->fgfs[fngfs + ShellPatch::dsigmadz],
|
||||
cg->fgfs[fngfs + ShellPatch::dRdx], cg->fgfs[fngfs + ShellPatch::dRdy], cg->fgfs[fngfs + ShellPatch::dRdz],
|
||||
cg->fgfs[fngfs + ShellPatch::drhodxx], cg->fgfs[fngfs + ShellPatch::drhodxy], cg->fgfs[fngfs + ShellPatch::drhodxz],
|
||||
cg->fgfs[fngfs + ShellPatch::drhodyy], cg->fgfs[fngfs + ShellPatch::drhodyz], cg->fgfs[fngfs + ShellPatch::drhodzz],
|
||||
cg->fgfs[fngfs + ShellPatch::dsigmadxx], cg->fgfs[fngfs + ShellPatch::dsigmadxy], cg->fgfs[fngfs + ShellPatch::dsigmadxz],
|
||||
cg->fgfs[fngfs + ShellPatch::dsigmadyy], cg->fgfs[fngfs + ShellPatch::dsigmadyz], cg->fgfs[fngfs + ShellPatch::dsigmadzz],
|
||||
cg->fgfs[fngfs + ShellPatch::dRdxx], cg->fgfs[fngfs + ShellPatch::dRdxy], cg->fgfs[fngfs + ShellPatch::dRdxz],
|
||||
cg->fgfs[fngfs + ShellPatch::dRdyy], cg->fgfs[fngfs + ShellPatch::dRdyz], cg->fgfs[fngfs + ShellPatch::dRdzz],
|
||||
cg->fgfs[chi->sgfn], cg->fgfs[trK->sgfn],
|
||||
cg->fgfs[gxx->sgfn], cg->fgfs[gxy->sgfn], cg->fgfs[gxz->sgfn], cg->fgfs[gyy->sgfn], cg->fgfs[gyz->sgfn], cg->fgfs[gzz->sgfn],
|
||||
cg->fgfs[Axx->sgfn], cg->fgfs[Axy->sgfn], cg->fgfs[Axz->sgfn], cg->fgfs[Ayy->sgfn], cg->fgfs[Ayz->sgfn], cg->fgfs[Azz->sgfn],
|
||||
cg->fgfs[Gmx->sgfn], cg->fgfs[Gmy->sgfn], cg->fgfs[Gmz->sgfn],
|
||||
cg->fgfs[Sfx_rhs->sgfn], cg->fgfs[Sfy_rhs->sgfn], cg->fgfs[Sfz_rhs->sgfn],
|
||||
Symmetry, Pp->data->sst);
|
||||
Block *cg = BL->data;
|
||||
if (myrank == cg->rank)
|
||||
{
|
||||
f_admmass_bssn_ss(cg->shape, cg->X[0], cg->X[1], cg->X[2],
|
||||
cg->fgfs[fngfs + ShellPatch::gx], cg->fgfs[fngfs + ShellPatch::gy], cg->fgfs[fngfs + ShellPatch::gz],
|
||||
cg->fgfs[fngfs + ShellPatch::drhodx], cg->fgfs[fngfs + ShellPatch::drhody], cg->fgfs[fngfs + ShellPatch::drhodz],
|
||||
cg->fgfs[fngfs + ShellPatch::dsigmadx], cg->fgfs[fngfs + ShellPatch::dsigmady], cg->fgfs[fngfs + ShellPatch::dsigmadz],
|
||||
cg->fgfs[fngfs + ShellPatch::dRdx], cg->fgfs[fngfs + ShellPatch::dRdy], cg->fgfs[fngfs + ShellPatch::dRdz],
|
||||
cg->fgfs[fngfs + ShellPatch::drhodxx], cg->fgfs[fngfs + ShellPatch::drhodxy], cg->fgfs[fngfs + ShellPatch::drhodxz],
|
||||
cg->fgfs[fngfs + ShellPatch::drhodyy], cg->fgfs[fngfs + ShellPatch::drhodyz], cg->fgfs[fngfs + ShellPatch::drhodzz],
|
||||
cg->fgfs[fngfs + ShellPatch::dsigmadxx], cg->fgfs[fngfs + ShellPatch::dsigmadxy], cg->fgfs[fngfs + ShellPatch::dsigmadxz],
|
||||
cg->fgfs[fngfs + ShellPatch::dsigmadyy], cg->fgfs[fngfs + ShellPatch::dsigmadyz], cg->fgfs[fngfs + ShellPatch::dsigmadzz],
|
||||
cg->fgfs[fngfs + ShellPatch::dRdxx], cg->fgfs[fngfs + ShellPatch::dRdxy], cg->fgfs[fngfs + ShellPatch::dRdxz],
|
||||
cg->fgfs[fngfs + ShellPatch::dRdyy], cg->fgfs[fngfs + ShellPatch::dRdyz], cg->fgfs[fngfs + ShellPatch::dRdzz],
|
||||
cg->fgfs[chi->sgfn], cg->fgfs[trK->sgfn],
|
||||
cg->fgfs[gxx->sgfn], cg->fgfs[gxy->sgfn], cg->fgfs[gxz->sgfn], cg->fgfs[gyy->sgfn], cg->fgfs[gyz->sgfn], cg->fgfs[gzz->sgfn],
|
||||
cg->fgfs[Axx->sgfn], cg->fgfs[Axy->sgfn], cg->fgfs[Axz->sgfn], cg->fgfs[Ayy->sgfn], cg->fgfs[Ayz->sgfn], cg->fgfs[Azz->sgfn],
|
||||
cg->fgfs[Gmx->sgfn], cg->fgfs[Gmy->sgfn], cg->fgfs[Gmz->sgfn],
|
||||
cg->fgfs[Sfx_rhs->sgfn], cg->fgfs[Sfy_rhs->sgfn], cg->fgfs[Sfz_rhs->sgfn],
|
||||
Symmetry, Pp->data->sst);
|
||||
}
|
||||
if (BL == Pp->data->ble)
|
||||
break;
|
||||
BL = BL->next;
|
||||
}
|
||||
if (BL == Pp->data->ble)
|
||||
break;
|
||||
BL = BL->next;
|
||||
Pp = Pp->next;
|
||||
}
|
||||
Pp = Pp->next;
|
||||
}
|
||||
|
||||
const int InList = 17;
|
||||
|
||||
@@ -82,13 +82,13 @@ public:
|
||||
var *Axx, var *Axy, var *Axz, var *Ayy, var *Ayz, var *Azz,
|
||||
var *Gmx, var *Gmy, var *Gmz,
|
||||
var *Sfx_rhs, var *Sfy_rhs, var *Sfz_rhs,
|
||||
double *Rout, monitor *Monitor);
|
||||
double *Rout, monitor *Monitor, bool refresh_mass_fields = true);
|
||||
void surf_MassPAng(double rex, int lev, ShellPatch *GH, var *chi, var *trK,
|
||||
var *gxx, var *gxy, var *gxz, var *gyy, var *gyz, var *gzz,
|
||||
var *Axx, var *Axy, var *Axz, var *Ayy, var *Ayz, var *Azz,
|
||||
var *Gmx, var *Gmy, var *Gmz,
|
||||
var *Sfx_rhs, var *Sfy_rhs, var *Sfz_rhs,
|
||||
double *Rout, monitor *Monitor);
|
||||
double *Rout, monitor *Monitor, bool refresh_mass_fields = true);
|
||||
void surf_Wave(double rex, cgh *GH, ShellPatch *SH,
|
||||
var *chi, var *trK,
|
||||
var *gxx, var *gxy, var *gxz, var *gyy, var *gyz, var *gzz,
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
var *Axx, var *Axy, var *Axz, var *Ayy, var *Ayz, var *Azz,
|
||||
var *Gmx, var *Gmy, var *Gmz,
|
||||
var *Sfx_rhs, var *Sfy_rhs, var *Sfz_rhs, // temparay memory for mass^i
|
||||
double *Rout, monitor *Monitor, MPI_Comm Comm_here);
|
||||
double *Rout, monitor *Monitor, MPI_Comm Comm_here, bool refresh_mass_fields = true);
|
||||
void surf_Wave(double rex, int lev, cgh *GH, var *Rpsi4, var *Ipsi4,
|
||||
int spinw, int maxl, int NN, double *RP, double *IP,
|
||||
monitor *Monitor, MPI_Comm Comm_here);
|
||||
|
||||
Reference in New Issue
Block a user