本文整理汇总了C++中Dump::modify_params方法的典型用法代码示例。如果您正苦于以下问题:C++ Dump::modify_params方法的具体用法?C++ Dump::modify_params怎么用?C++ Dump::modify_params使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dump
的用法示例。
在下文中一共展示了Dump::modify_params方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: command
void WriteDump::command(int narg, char **arg)
{
if (narg < 3) error->all(FLERR,"Illegal write_dump command");
// modindex = index in args of "modify" keyword
// will be narg if "modify" is not present
int modindex;
for (modindex = 0; modindex < narg; modindex++)
if (strcmp(arg[modindex],"modify") == 0) break;
// create the Dump instance
// create dump command line with extra required args
Dump *dump;
char **dumpargs = new char*[modindex+2];
dumpargs[0] = (char *) "WRITE_DUMP"; // dump id
dumpargs[1] = arg[0]; // group
dumpargs[2] = arg[1]; // dump style
dumpargs[3] = (char *) "0"; // dump frequency
for (int i = 2; i < modindex; ++i)
dumpargs[i+2] = arg[i];
if (0) return; // dummy line to enable else-if macro expansion
#define DUMP_CLASS
#define DumpStyle(key,Class) \
else if (strcmp(arg[1],#key) == 0) dump = new Class(lmp,modindex+2,dumpargs);
#include "style_dump.h"
#undef DUMP_CLASS
else error->all(FLERR,"Unknown dump style");
if (modindex < narg) dump->modify_params(narg-modindex-1,&arg[modindex+1]);
// write out one frame and then delete the dump again
// set multifile_override for DumpImage so that filename needs no "*"
if (strcmp(arg[1],"image") == 0)
((DumpImage *) dump)->multifile_override = 1;
if (strcmp(arg[1],"cfg") == 0)
((DumpCFG *) dump)->multifile_override = 1;
dump->init();
dump->write();
// delete the Dump instance and local storage
delete dump;
delete [] dumpargs;
}