add image_fname string for caching the last active dump image filename pattern
This commit is contained in:
@ -36,6 +36,8 @@
|
||||
#include "memory.h"
|
||||
#include "modify.h"
|
||||
#include "molecule.h"
|
||||
#include "output.h"
|
||||
#include "thermo.h"
|
||||
#include "tokenizer.h"
|
||||
#include "update.h"
|
||||
#include "variable.h"
|
||||
@ -498,6 +500,10 @@ void DumpImage::init_style()
|
||||
|
||||
DumpCustom::init_style();
|
||||
|
||||
// cache dump image filename pattern for access through library interface.
|
||||
|
||||
if (multifile) output->thermo->set_image_fname(filename);
|
||||
|
||||
// for grid output, find current ptr for compute or fix
|
||||
// check that fix frequency is acceptable
|
||||
|
||||
|
||||
@ -113,6 +113,7 @@ Thermo::Thermo(LAMMPS *_lmp, int narg, char **arg) :
|
||||
flushflag = 0;
|
||||
ntimestep = -1;
|
||||
nline = -1;
|
||||
image_fname.clear();
|
||||
|
||||
// set style and corresponding lineflag
|
||||
// custom style builds its own line of keywords, including wildcard expansion
|
||||
|
||||
@ -42,14 +42,17 @@ class Thermo : protected Pointers {
|
||||
void compute(int);
|
||||
int evaluate_keyword(const std::string &, double *);
|
||||
|
||||
// for accessing cached thermo data
|
||||
const int *get_nfield() const { return &nfield; }
|
||||
// for accessing cached thermo and related data
|
||||
const int *get_line() const { return &nline; }
|
||||
const char *get_image_fname() const { return image_fname.c_str(); }
|
||||
|
||||
const int *get_nfield() const { return &nfield; }
|
||||
const bigint *get_timestep() const { return &ntimestep; }
|
||||
const std::vector<multitype> &get_fields() const { return field_data; }
|
||||
const std::vector<std::string> &get_keywords() const { return keyword; }
|
||||
|
||||
void set_line(int _nline) { nline = _nline; }
|
||||
void set_image_fname(const std::string &fname) { image_fname = fname; }
|
||||
|
||||
private:
|
||||
int nfield, nfield_initial;
|
||||
@ -75,6 +78,7 @@ class Thermo : protected Pointers {
|
||||
bigint natoms;
|
||||
bigint ntimestep;
|
||||
int nline;
|
||||
std::string image_fname;
|
||||
|
||||
// data used by routines that compute single values
|
||||
int ivalue; // integer value to print
|
||||
|
||||
Reference in New Issue
Block a user