pretty
This commit is contained in:
@ -33,15 +33,11 @@
|
|||||||
#include "fmt/chrono.h"
|
#include "fmt/chrono.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstdio>
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <ctime>
|
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
using namespace FixConst;
|
using namespace FixConst;
|
||||||
|
|
||||||
#define MAXLINE 1024
|
|
||||||
|
|
||||||
// OFFSET avoids outside-of-box atoms being rounded to grid pts incorrectly
|
// OFFSET avoids outside-of-box atoms being rounded to grid pts incorrectly
|
||||||
// SHIFT = 0.0 assigns atoms to lower-left grid pt
|
// SHIFT = 0.0 assigns atoms to lower-left grid pt
|
||||||
// SHIFT = 0.5 assigns atoms to nearest grid pt
|
// SHIFT = 0.5 assigns atoms to nearest grid pt
|
||||||
@ -235,8 +231,7 @@ void FixTTM::init()
|
|||||||
// and create a new GridComm, and pass old GC data to new GC
|
// and create a new GridComm, and pass old GC data to new GC
|
||||||
|
|
||||||
if (domain->box_change)
|
if (domain->box_change)
|
||||||
error->all(FLERR,"Cannot use fix ttm with "
|
error->all(FLERR,"Cannot use fix ttm with changing box shape, size, or sub-domains");
|
||||||
"changing box shape, size, or sub-domains");
|
|
||||||
|
|
||||||
// set force prefactors
|
// set force prefactors
|
||||||
|
|
||||||
@ -497,7 +492,7 @@ void FixTTM::read_electron_temperatures(const std::string &filename)
|
|||||||
// check correctness of input data
|
// check correctness of input data
|
||||||
|
|
||||||
if ((ix < 0) || (ix >= nxgrid) || (iy < 0) || (iy >= nygrid) || (iz < 0) || (iz >= nzgrid))
|
if ((ix < 0) || (ix >= nxgrid) || (iy < 0) || (iy >= nygrid) || (iz < 0) || (iz >= nzgrid))
|
||||||
throw parser_error("Fix ttm invalid grid index in fix ttm input");
|
throw parser_error("Fix ttm invalid grid index in fix ttm grid file");
|
||||||
|
|
||||||
if (T_tmp < 0.0)
|
if (T_tmp < 0.0)
|
||||||
throw parser_error("Fix ttm electron temperatures must be > 0.0");
|
throw parser_error("Fix ttm electron temperatures must be > 0.0");
|
||||||
@ -538,9 +533,9 @@ void FixTTM::write_electron_temperatures(const std::string &filename)
|
|||||||
FILE *fp = fopen(filename.c_str(),"w");
|
FILE *fp = fopen(filename.c_str(),"w");
|
||||||
if (!fp) error->one(FLERR,"Fix ttm could not open output file {}: {}",
|
if (!fp) error->one(FLERR,"Fix ttm could not open output file {}: {}",
|
||||||
filename,utils::getsyserror());
|
filename,utils::getsyserror());
|
||||||
fmt::print(fp,"# DATE: {:%Y-%m-%d} UNITS: {} COMMENT: Electron temperature grid "
|
fmt::print(fp,"# DATE: {:%Y-%m-%d} UNITS: {} COMMENT: Electron temperature "
|
||||||
"at step {}. Created by fix {}\n",
|
"{}x{}x{} grid at step {}. Created by fix {}\n", current_date,
|
||||||
current_date, update->unit_style, update->ntimestep, style);
|
update->unit_style, nxgrid, nygrid, nzgrid, update->ntimestep, style);
|
||||||
|
|
||||||
int ix,iy,iz;
|
int ix,iy,iz;
|
||||||
|
|
||||||
|
|||||||
@ -361,10 +361,9 @@ void FixTTMGrid::write_electron_temperatures(const std::string &filename)
|
|||||||
FPout = fopen(filename.c_str(), "w");
|
FPout = fopen(filename.c_str(), "w");
|
||||||
if (!FPout) error->one(FLERR, "Fix ttm/grid could not open output file");
|
if (!FPout) error->one(FLERR, "Fix ttm/grid could not open output file");
|
||||||
|
|
||||||
fmt::print(FPout,
|
fmt::print(FPout,"# DATE: {:%Y-%m-%d} UNITS: {} COMMENT: Electron temperature "
|
||||||
"# DATE: {:%Y-%m-%d} UNITS: {} COMMENT: Electron temperature grid "
|
"{}x{}x{} grid at step {}. Created by fix {}\n", current_date,
|
||||||
"at step {}. Created by fix {}\n",
|
update->unit_style, nxgrid, nygrid, nzgrid, update->ntimestep, style);
|
||||||
current_date, update->unit_style, update->ntimestep, style);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gc->gather(GridComm::FIX, this, 1, sizeof(double), 1, NULL, MPI_DOUBLE);
|
gc->gather(GridComm::FIX, this, 1, sizeof(double), 1, NULL, MPI_DOUBLE);
|
||||||
|
|||||||
Reference in New Issue
Block a user