aboutsummaryrefslogtreecommitdiff
path: root/src/Write2D.c
diff options
context:
space:
mode:
authortradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2000-02-18 15:05:43 +0000
committertradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2000-02-18 15:05:43 +0000
commitcbccd2d2565f6e751ce633886f4adad87147ce8c (patch)
treedf7fd0231fa622aeacff5eef1d79e0cad7c9e275 /src/Write2D.c
parentb4f3fffcd5262fa53d81f7ca5136427e7d969468 (diff)
Made CactusPUGHIO thorns aware of future multi-patch or multi-block changes
to PUGH. The current pGH extensions are now queried via Tom's pugh_pGH() routine. The 'identity_string' provided by PUGH for each GH goes into output filenames. Thomas git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@92 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/Write2D.c')
-rw-r--r--src/Write2D.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/Write2D.c b/src/Write2D.c
index 0dc697a..1022228 100644
--- a/src/Write2D.c
+++ b/src/Write2D.c
@@ -102,8 +102,8 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias)
return;
}
- /* Get the handles for pugh, IOFlexIO and IOUtil extensions */
- pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")];
+ /* Get the handles for PUGH, IOUtil, and IOFlexIO extensions */
+ pughGH = pugh_pGH (GH);
ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")];
myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")];
@@ -157,16 +157,16 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias)
/* see if output file for this alias name was already created */
IEEEfile_2D = (IOFile *) GetNamedData (myGH->filenameList2D, alias);
if (IEEEfile_2D == NULL) {
- int len;
char *fname;
IEEEfile_2D = (IOFile *) malloc (3 * sizeof (IOFile));
- len = strlen (myGH->outdir2D) + strlen (alias);
- fname = (char *) malloc (len + 20);
+ fname = (char *) malloc (strlen (myGH->outdir2D) + strlen (alias) +
+ strlen (pughGH->identity_string) + 20);
assert (IEEEfile_2D && fname);
/* Create files (open mode "w") */
- sprintf (fname, "%s/%s_2d_yz.ieee", myGH->outdir2D, alias);
+ sprintf (fname, "%s/%s_2d_yz%s.ieee", myGH->outdir2D, alias,
+ pughGH->identity_string);
IEEEfile_2D [0] = IEEEopen (fname, "w");
if (! IOisValid (IEEEfile_2D [0])) {
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
@@ -174,7 +174,8 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias)
return;
}
- sprintf (fname, "%s/%s_2d_xz.ieee", myGH->outdir2D, alias);
+ sprintf (fname, "%s/%s_2d_xz%s.ieee", myGH->outdir2D, alias,
+ pughGH->identity_string);
IEEEfile_2D [1] = IEEEopen (fname, "w");
if (! IOisValid (IEEEfile_2D [1])) {
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
@@ -182,7 +183,8 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias)
return;
}
- sprintf (fname, "%s/%s_2d_xy.ieee", myGH->outdir2D, alias);
+ sprintf (fname, "%s/%s_2d_xy%s.ieee", myGH->outdir2D, alias,
+ pughGH->identity_string);
IEEEfile_2D [2] = IEEEopen (fname, "w");
if (! IOisValid (IEEEfile_2D [2])) {
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,