Simplify the code and remove redundant include

This commit is contained in:
Vladislav Galigerov
2024-02-09 12:26:40 +03:00
parent 022cedeff0
commit 5839b67d27
2 changed files with 6 additions and 7 deletions

View File

@ -114,17 +114,16 @@ FixWallFlow::FixWallFlow(LAMMPS *lmp, int narg, char **arg) :
}
return 0.0;
};
double scale = getscale();
double scale = 0.0;
if(flowax == FlowAxis::AX_X) scale = domain->lattice->xlattice;
else if(flowax == FlowAxis::AX_Y) scale = domain->lattice->ylattice;
else if(flowax == FlowAxis::AX_Z) scale = domain->lattice->zlattice;
if (narg - iarg == wallcount + 2)
{
if(strcmp(arg[narg - 2], "units") != 0) error->all(FLERR, "Wrong fix wall/flow units command");
if (strcmp(arg[narg - 1], "box") == 0) scale = 1.0;
else if (strcmp(arg[narg - 1], "lattice") == 0)
{
scale = getscale();
}
else error->all(FLERR, "Wrong fix wall/flow units command");
else if (strcmp(arg[narg - 1], "lattice") != 0) error->all(FLERR, "Wrong fix wall/flow units command");
}
walls.resize(wallcount + 2);

View File

@ -21,7 +21,7 @@ FixStyle(wall/flow,FixWallFlow);
#define LMP_FIX_WALL_FLOW_H
#include "fix.h"
#include <vector>
namespace LAMMPS_NS {
class FixWallFlow : public Fix {