Commit 0e7d647a authored by Ryan S. Elliott's avatar Ryan S. Elliott
Browse files

Switch to sprintf() instead of std::string etc.

parent b93d9e6f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ template<class DeviceType>
void PairReaxCKokkos<DeviceType>::init_style()
{
  PairReaxC::init_style();
  if (fix_reax) modify->delete_fix(fix_id.c_str()); // not needed in the Kokkos version
  if (fix_reax) modify->delete_fix(fix_id); // not needed in the Kokkos version
  fix_reax = NULL;

  // irequest = neigh request made by parent class
+2 −6
Original line number Diff line number Diff line
@@ -33,8 +33,6 @@
   High Performance Computing Applications, to appear.
 ------------------------------------------------------------------------- */

#include <sstream>

#include "pair_reaxc_omp.h"
#include "atom.h"
#include "update.h"
@@ -99,9 +97,7 @@ PairReaxCOMP::PairReaxCOMP(LAMMPS *lmp) : PairReaxC(lmp), ThrOMP(lmp, THR_PAIR)

  num_nbrs_offset = NULL;

  std::stringstream ss;
  ss << "REAXC_COMP_" << std::dec << Pair::instance_me;
  fix_id = ss.str();
  sprintf(fix_id, "REAXC_OMP_%d", Pair::instance_me);

#ifdef OMP_TIMING
  for (int i=0;i<LASTTIMINGINDEX;i++) {
@@ -379,7 +375,7 @@ void PairReaxCOMP::init_style( )

  if (fix_reax == NULL) {
    char **fixarg = new char*[3];
    fixarg[0] = (char *) fix_id.c_str();
    fixarg[0] = (char *) fix_id;
    fixarg[1] = (char *) "all";
    fixarg[2] = (char *) "REAXC";
    modify->add_fix(3,fixarg);
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ class PairReaxCOMP : public PairReaxC, public ThrOMP {
  }

 protected:
  std::string fix_id;
  char fix_id[128];
  virtual void setup();
  virtual void write_reax_atoms();
  virtual int estimate_reax_lists();
+3 −7
Original line number Diff line number Diff line
@@ -20,8 +20,6 @@
   Hybrid and hybrid/overlay compatibility added by Ray Shan (Sandia)
------------------------------------------------------------------------- */

#include <sstream>

#include "pair_reaxc.h"
#include "atom.h"
#include "update.h"
@@ -76,9 +74,7 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp)
  manybody_flag = 1;
  ghostneigh = 1;

  std::stringstream ss;
  ss << "REAXC_" << std::dec << Pair::instance_me;
  fix_id = ss.str();
  sprintf(fix_id, "REAXC_%d", Pair::instance_me);

  system = (reax_system *)
    memory->smalloc(sizeof(reax_system),"reax:system");
@@ -141,7 +137,7 @@ PairReaxC::~PairReaxC()
{
  if (copymode) return;

  if (fix_reax) modify->delete_fix(fix_id.c_str());
  if (fix_reax) modify->delete_fix(fix_id);

  if (setup_flag) {
    Close_Output_Files( system, control, out_control, mpi_data );
@@ -418,7 +414,7 @@ void PairReaxC::init_style( )

  if (fix_reax == NULL) {
    char **fixarg = new char*[3];
    fixarg[0] = (char *) fix_id.c_str();
    fixarg[0] = (char *) fix_id;
    fixarg[1] = (char *) "all";
    fixarg[2] = (char *) "REAXC";
    modify->add_fix(3,fixarg);
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ class PairReaxC : public Pair {
  bigint ngroup;

 protected:
  std::string fix_id;
  char fix_id[128];
  double cutmax;
  int nelements;                // # of unique elements
  char **elements;              // names of unique elements