port colname changes to MPIIO package

This commit is contained in:
Axel Kohlmeyer
2022-04-01 14:57:41 -04:00
parent ce67cb0ca1
commit fb9316701b
4 changed files with 30 additions and 5 deletions

View File

@ -234,14 +234,25 @@ void DumpAtomMPIIO::init_style()
// setup column string
std::string default_columns;
if (scale_flag == 0 && image_flag == 0)
columns = (char *) "id type x y z";
default_columns = "id type x y z";
else if (scale_flag == 0 && image_flag == 1)
columns = (char *) "id type x y z ix iy iz";
default_columns = "id type x y z ix iy iz";
else if (scale_flag == 1 && image_flag == 0)
columns = (char *) "id type xs ys zs";
default_columns = "id type xs ys zs";
else if (scale_flag == 1 && image_flag == 1)
columns = (char *) "id type xs ys zs ix iy iz";
default_columns = "id type xs ys zs ix iy iz";
int icol = 0;
columns.clear();
for (auto item : utils::split_words(default_columns)) {
if (columns.size()) columns += " ";
if (keyword_user[icol].size()) columns += keyword_user[icol];
else columns += item;
++icol;
}
// setup function ptrs

View File

@ -216,6 +216,19 @@ void DumpCustomMPIIO::write()
void DumpCustomMPIIO::init_style()
{
// assemble ITEMS: column string from defaults and user values
delete[] columns;
std::string combined;
int icol = 0;
for (auto item : utils::split_words(columns_default)) {
if (combined.size()) combined += " ";
if (keyword_user[icol].size()) combined += keyword_user[icol];
else combined += item;
++icol;
}
columns = utils::strdup(combined);
// format = copy of default or user-specified line format
delete[] format;

View File

@ -66,6 +66,7 @@ void DumpAtom::init_style()
domain->boundary_string(boundstr);
// setup column string
std::string default_columns;
if (scale_flag == 0 && image_flag == 0)

View File

@ -275,7 +275,7 @@ void DumpCustom::init_style()
++icol;
}
columns = utils::strdup(combined);
// format = copy of default or user-specified line format
delete[] format;