aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhinder <hinder@4f5cb9a8-4dd8-4c2d-9bbd-173fa4467843>2010-06-14 08:06:04 +0000
committerhinder <hinder@4f5cb9a8-4dd8-4c2d-9bbd-173fa4467843>2010-06-14 08:06:04 +0000
commit81766bc35fa2651e4b34367cad62a01f73b9abb9 (patch)
tree5d5355f118cc35ac01ec0eb940e112be95614e64
parentf454e653223319c31cdb6fbeb9f6bec13660f9da (diff)
Fix 1D output filename in the case that the variable to be decomposed is real
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/Multipole/trunk@60 4f5cb9a8-4dd8-4c2d-9bbd-173fa4467843
-rw-r--r--src/multipole.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/multipole.cc b/src/multipole.cc
index c79653a..1a2881a 100644
--- a/src/multipole.cc
+++ b/src/multipole.cc
@@ -133,17 +133,20 @@ static void output_1D(CCTK_ARGUMENTS, const variable_desc *v, CCTK_REAL rad,
if (out_1d_every != 0 && (cctk_iteration) % out_1d_every == 0)
{
const char *real_name = CCTK_VarName(v->index);
- const char *imag_name = CCTK_VarName(v->imag_index);
-
sprintf(name_tmp, "mp_%s_r%1.2f.th.asc", real_name, rad);
Multipole_Output1D(CCTK_PASS_CTOC, name_tmp, array_size, th, ph, mp_theta, real);
- sprintf(name_tmp, "mp_%s_r%1.2f.th.asc", imag_name, rad);
- Multipole_Output1D(CCTK_PASS_CTOC, name_tmp, array_size, th, ph, mp_theta, imag);
-
sprintf(name_tmp, "mp_%s_r%1.2f.ph.asc", real_name, rad);
Multipole_Output1D(CCTK_PASS_CTOC, name_tmp, array_size, th, ph, mp_phi, real);
- sprintf(name_tmp, "mp_%s_r%1.2f.ph.asc", imag_name, rad);
- Multipole_Output1D(CCTK_PASS_CTOC, name_tmp, array_size, th, ph, mp_phi, imag);
+
+ if (v->imag_index != -1)
+ {
+ const char *imag_name = CCTK_VarName(v->imag_index);
+ sprintf(name_tmp, "mp_%s_r%1.2f.th.asc", imag_name, rad);
+ Multipole_Output1D(CCTK_PASS_CTOC, name_tmp, array_size, th, ph, mp_theta, imag);
+
+ sprintf(name_tmp, "mp_%s_r%1.2f.ph.asc", imag_name, rad);
+ Multipole_Output1D(CCTK_PASS_CTOC, name_tmp, array_size, th, ph, mp_phi, imag);
+ }
}
}
}