support dump_modify for column headers in ADIOS dump styles

This commit is contained in:
Axel Kohlmeyer
2022-04-06 09:25:11 -04:00
parent 02f972292c
commit cd7f08a8e7
3 changed files with 19 additions and 3 deletions

View File

@ -381,9 +381,9 @@ performed with dump style *xtc*\ .
----------
The *colname* keyword can be used to change the default header keyword
for dump styles: *atom*, *custom*, and *cfg* and their compressed and
MPIIO variants. The setting for *ID string* replaces the default text
with the provided string. *ID* can be a positive integer when it
for dump styles: *atom*, *custom*, and *cfg* and their compressed, ADIOS,
and MPIIO variants. The setting for *ID string* replaces the default
text with the provided string. *ID* can be a positive integer when it
represents the column number counting from the left, a negative integer
when it represents the column number from the right (i.e. -1 is the last
column/keyword), or a thermo keyword (or compute, fix, property, or

View File

@ -238,6 +238,9 @@ void DumpAtomADIOS::init_style()
columnNames = {"id", "type", "xs", "ys", "zs", "ix", "iy", "iz"};
}
for (int icol = 0; icol < (int)columnNames.size(); ++icol)
if (keyword_user[icol].size()) columnNames[icol] = keyword_user[icol];
// setup function ptrs
if (scale_flag == 1 && image_flag == 0 && domain->triclinic == 0)

View File

@ -214,6 +214,19 @@ void DumpCustomADIOS::write()
void DumpCustomADIOS::init_style()
{
// assemble 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);
// setup boundary string
domain->boundary_string(boundstr);