From 9f649c3123268c8f29702d24726062b27b8e2c1f Mon Sep 17 00:00:00 2001 From: sjplimp Date: Tue, 2 Dec 2014 02:12:19 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12813 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- lib/atc/ATC_CouplingMomentumEnergy.cpp | 4 +--- lib/atc/AtomicRegulator.h | 3 ++- lib/atc/CauchyBorn.h | 3 ++- lib/atc/ChargeRegulator.cpp | 4 ++-- lib/atc/ChargeRegulator.h | 4 ++-- lib/atc/DenseMatrix.h | 6 +++--- lib/atc/DenseVector.h | 6 +++--- lib/atc/DependencyManager.h | 2 +- lib/atc/DiagonalMatrix.h | 4 ++-- lib/atc/ExtrinsicModelDriftDiffusion.cpp | 5 ----- lib/atc/ExtrinsicModelElectrostatic.cpp | 3 --- lib/atc/FE_Element.h | 4 ++-- lib/atc/FE_Engine.cpp | 1 - lib/atc/FE_Mesh.h | 5 +++-- lib/atc/Function.h | 4 ---- lib/atc/FundamentalAtomicQuantity.h | 4 ++-- lib/atc/LammpsInterface.h | 18 +++++++++--------- lib/atc/Makefile.mingw32-cross | 9 +++++---- lib/atc/Makefile.mingw32-cross-mpi | 13 +++++++------ lib/atc/Makefile.mingw64-cross | 11 ++++++----- lib/atc/Makefile.mingw64-cross-mpi | 13 +++++++------ lib/atc/Makefile.mpic++ | 18 ++++++++++++++---- lib/atc/Makefile.serial | 14 +++++++------- lib/atc/Matrix.h | 3 ++- lib/atc/MeshReader.cpp | 3 +-- lib/atc/MeshReader.h | 1 - lib/atc/MoleculeSet.cpp | 4 ++-- lib/atc/MoleculeSet.h | 2 +- lib/atc/PerAtomQuantity.h | 2 +- lib/atc/PerAtomQuantityLibrary.h | 2 +- lib/atc/SchrodingerSolver.cpp | 2 -- lib/atc/SparseMatrix-inl.h | 4 ++-- lib/atc/WeakEquationElectronContinuity.h | 2 +- 33 files changed, 91 insertions(+), 92 deletions(-) diff --git a/lib/atc/ATC_CouplingMomentumEnergy.cpp b/lib/atc/ATC_CouplingMomentumEnergy.cpp index a29603a618..c4f7829c60 100644 --- a/lib/atc/ATC_CouplingMomentumEnergy.cpp +++ b/lib/atc/ATC_CouplingMomentumEnergy.cpp @@ -321,9 +321,7 @@ namespace ATC { //-------------------------------------------------------- bool ATC_CouplingMomentumEnergy::modify(int narg, char **arg) { - bool foundMatch = false; - int argIndex = 0; - return foundMatch; + return false; } //-------------------------------------------------------------------- diff --git a/lib/atc/AtomicRegulator.h b/lib/atc/AtomicRegulator.h index 5d1e59f607..454f54989d 100644 --- a/lib/atc/AtomicRegulator.h +++ b/lib/atc/AtomicRegulator.h @@ -140,7 +140,8 @@ namespace ATC { /** returns a pointer to the DENS_MAN associated with the tag, creates a new data member if necessary */ DENS_MAN * regulator_data(const std::string tag, int nCols); /** can externally set regulator dynamic contributions */ - virtual void reset_lambda_contribution(const DENS_MAT & target, const FieldName field=NUM_TOTAL_FIELDS) {}; + virtual void reset_lambda_contribution(const DENS_MAT & target, const FieldName field) {}; + virtual void reset_lambda_contribution(const DENS_MAT & target) { reset_lambda_contribution(target,NUM_TOTAL_FIELDS); } /** returns a const pointer to the DENS_MAN associated with the tag, or NULL */ const DENS_MAN * regulator_data(const std::string tag) const; /** return the maximum number of iterations */ diff --git a/lib/atc/CauchyBorn.h b/lib/atc/CauchyBorn.h index bc7028d5e4..fb63afa39b 100644 --- a/lib/atc/CauchyBorn.h +++ b/lib/atc/CauchyBorn.h @@ -43,7 +43,8 @@ namespace ATC { * @brief Class for storing parameters needed for computing the Cauchy-Born stress */ - struct StressArgs { + class StressArgs { + public: StressArgs(AtomCluster &v, CbPotential *p, double kB, double hbar, double T) : vac(v), potential(p), boltzmann_constant(kB), planck_constant(hbar), temperature(T) {} diff --git a/lib/atc/ChargeRegulator.cpp b/lib/atc/ChargeRegulator.cpp index c2f54b27b8..2e899fcc8e 100644 --- a/lib/atc/ChargeRegulator.cpp +++ b/lib/atc/ChargeRegulator.cpp @@ -142,9 +142,9 @@ namespace ATC { //-------------------------------------------------------- // output //-------------------------------------------------------- - void ChargeRegulator::output(OUTPUT_LIST & outputData) + void ChargeRegulator::output(OUTPUT_LIST & outputData) const { - map::iterator itr; + map::const_iterator itr; for (itr = regulators_.begin(); itr != regulators_.end(); itr++) { itr->second->output(outputData);} } diff --git a/lib/atc/ChargeRegulator.h b/lib/atc/ChargeRegulator.h index 046a9f5157..b51707b9cd 100644 --- a/lib/atc/ChargeRegulator.h +++ b/lib/atc/ChargeRegulator.h @@ -64,8 +64,8 @@ namespace ATC { virtual void initialize(); virtual void apply_pre_force(double dt); virtual void apply_post_force(double dt); - virtual void output(OUTPUT_LIST & outputData); - virtual double compute_vector(int n) {return 0;} // TODO + virtual void output(OUTPUT_LIST & outputData) const; + virtual double compute_vector(int n) const {return 0;} // TODO void assign_poisson_solver(PoissonSolver * solver) { poissonSolver_ = solver;} PoissonSolver * poisson_solver(void) { return poissonSolver_;} diff --git a/lib/atc/DenseMatrix.h b/lib/atc/DenseMatrix.h index e77e2ac854..e585289aaa 100644 --- a/lib/atc/DenseMatrix.h +++ b/lib/atc/DenseMatrix.h @@ -17,9 +17,9 @@ class DenseMatrix : public Matrix { public: DenseMatrix(INDEX rows=0, INDEX cols=0, bool z=1): _data(NULL){ _create(rows, cols, z); } - DenseMatrix(const DenseMatrix& c) : _data(NULL){ _copy(c); } - DenseMatrix(const SparseMatrix& c): _data(NULL){ c.dense_copy(*this);} - DenseMatrix(const Matrix& c) : _data(NULL){ _copy(c); } + DenseMatrix(const DenseMatrix& c) : Matrix(), _data(NULL){ _copy(c); } + DenseMatrix(const SparseMatrix& c): Matrix(), _data(NULL){ c.dense_copy(*this);} + DenseMatrix(const Matrix& c) : Matrix(), _data(NULL){ _copy(c); } // const SparseMatrix * p = sparse_cast(&c); // (p) ? p->dense_copy(*this) : _copy(c); } ~DenseMatrix() { _delete();} diff --git a/lib/atc/DenseVector.h b/lib/atc/DenseVector.h index 77d06799f0..bbca12997b 100644 --- a/lib/atc/DenseVector.h +++ b/lib/atc/DenseVector.h @@ -16,9 +16,9 @@ class DenseVector : public Vector { public: explicit DenseVector(INDEX n=0, bool z=1) { _create(n,z); } - DenseVector(const DenseVector &c) : _data(NULL) { _copy(c); } - DenseVector(const Vector &c) : _data(NULL) { _copy(c); } - DenseVector(const T * ptr, INDEX nrows) : _data(NULL) { copy(ptr,nrows); } + DenseVector(const DenseVector &c) : Vector(), _data(NULL) { _copy(c); } + DenseVector(const Vector &c) : Vector(), _data(NULL) { _copy(c); } + DenseVector(const T * ptr, INDEX nrows) : Vector(), _data(NULL) { copy(ptr,nrows); } virtual ~DenseVector() { _delete(); } //* resizes the Vector, ignores nCols, optionally copys what fits diff --git a/lib/atc/DependencyManager.h b/lib/atc/DependencyManager.h index 13e33b55fb..9f33af1998 100644 --- a/lib/atc/DependencyManager.h +++ b/lib/atc/DependencyManager.h @@ -185,7 +185,7 @@ namespace ATC { virtual void operator/=(const MatrixDependencyManager & divisor) {get_quantity()/=divisor.quantity(); propagate_reset();}; /** execute the matrix print command */ - virtual void const print(const std::string &name) {get_quantity().print(name);}; + virtual void print(const std::string &name) const {get_quantity().print(name);}; protected: diff --git a/lib/atc/DiagonalMatrix.h b/lib/atc/DiagonalMatrix.h index ce51c3f365..516fb47878 100644 --- a/lib/atc/DiagonalMatrix.h +++ b/lib/atc/DiagonalMatrix.h @@ -213,7 +213,7 @@ DiagonalMatrix::DiagonalMatrix(INDEX rows, bool zero) //----------------------------------------------------------------------------- template DiagonalMatrix::DiagonalMatrix(const DiagonalMatrix& c) - : _data(NULL) + : Matrix(), _data(NULL) { reset(c); } @@ -222,7 +222,7 @@ DiagonalMatrix::DiagonalMatrix(const DiagonalMatrix& c) //----------------------------------------------------------------------------- template DiagonalMatrix::DiagonalMatrix(const Vector& v) - : _data(NULL) + : Matrix(), _data(NULL) { reset(v); } diff --git a/lib/atc/ExtrinsicModelDriftDiffusion.cpp b/lib/atc/ExtrinsicModelDriftDiffusion.cpp index 73beca3aae..f9b93a147a 100644 --- a/lib/atc/ExtrinsicModelDriftDiffusion.cpp +++ b/lib/atc/ExtrinsicModelDriftDiffusion.cpp @@ -22,10 +22,6 @@ using std::set; using std::pair; using std::vector; -const double tol = 1.e-8; -const double zero_tol = 1.e-12; -const double f_tol = 1.e-8; - namespace ATC { //-------------------------------------------------------- @@ -98,7 +94,6 @@ namespace ATC { bool ExtrinsicModelDriftDiffusion::modify(int narg, char **arg) { bool match = false; - int argIndx = 0; if (!match) { match = ExtrinsicModelTwoTemperature::modify(narg, arg); } diff --git a/lib/atc/ExtrinsicModelElectrostatic.cpp b/lib/atc/ExtrinsicModelElectrostatic.cpp index 5f5321f65d..03766920e3 100644 --- a/lib/atc/ExtrinsicModelElectrostatic.cpp +++ b/lib/atc/ExtrinsicModelElectrostatic.cpp @@ -19,9 +19,6 @@ using std::map; using std::pair; using std::set; -static const double kTol_ = 1.0e-8; -static const double tol_sparse = 1.e-30;//tolerance for compaction from dense - namespace ATC { //-------------------------------------------------------- diff --git a/lib/atc/FE_Element.h b/lib/atc/FE_Element.h index a29a654034..65261e7c02 100644 --- a/lib/atc/FE_Element.h +++ b/lib/atc/FE_Element.h @@ -70,10 +70,10 @@ namespace ATC { const Array2D &local_face_conn() const { return localFaceConn_; } /** return volume of the element */ - const double vol() const { return vol_; } + double vol() const { return vol_; } /** return area of a face */ - const double face_area() const { return faceArea_; } + double face_area() const { return faceArea_; } // the following two are pass-throughs to the interpolate class, and // can thus only be declared in the class body (or else the diff --git a/lib/atc/FE_Engine.cpp b/lib/atc/FE_Engine.cpp index 4b519e336f..d8d6e3e440 100644 --- a/lib/atc/FE_Engine.cpp +++ b/lib/atc/FE_Engine.cpp @@ -2198,7 +2198,6 @@ namespace ATC{ } // construct open flux at ips of this element // flux = field \otimes advection_vector \dot n - FSET::const_iterator face_iter = fset->find(face); faceSource.reset(nIPsPerFace_,nFieldDOF); for (int ip = 0; ip < nIPsPerFace_; ++ip) { for (int idof = 0; idof & nodes); bool match_nodes(int idim, std::set & top, std::set & bot, @@ -691,7 +692,7 @@ namespace ATC { void departition_mesh(void); virtual void element_size(const int ielem, - double hx, double hy, double hz) + double &hx, double &hy, double &hz) { hx = L_[0]/n_[0]; hy = L_[1]/n_[1]; hz = L_[2]/n_[2]; } virtual double min_element_size(void) const diff --git a/lib/atc/Function.h b/lib/atc/Function.h index 45d5d7220a..7368589e96 100644 --- a/lib/atc/Function.h +++ b/lib/atc/Function.h @@ -28,10 +28,6 @@ namespace ATC { /** depdendencies */ virtual inline ARG_NAMES args(void) {ARG_NAMES names; return names;}; - /** function value */ - virtual inline double f(ARGS& args) {return 0.0;}; - virtual inline void f(ARGS& args, DENS_MAT vals) {}; - /** (1st) derivative of function wrt to a field */ virtual inline double dfd(FieldName field, ARGS& args ) {return 0.0;}; virtual inline void dfd(FieldName field, ARGS& args, DENS_MAT vals ) {}; diff --git a/lib/atc/FundamentalAtomicQuantity.h b/lib/atc/FundamentalAtomicQuantity.h index 46b3c4b003..63c4747552 100644 --- a/lib/atc/FundamentalAtomicQuantity.h +++ b/lib/atc/FundamentalAtomicQuantity.h @@ -124,7 +124,7 @@ namespace ATC { protected: /** sets lammps data based on the quantity */ - virtual void set_lammps_to_quantity(){}; + virtual void set_lammps_to_quantity() const {}; /** sets the quantity based on a lammps pointer */ virtual void set_quantity_to_lammps() const; @@ -240,7 +240,7 @@ namespace ATC { // not needed if no MPI /** sets lammps data based on the quantity */ - virtual void set_lammps_to_quantity() + virtual void set_lammps_to_quantity() const {throw ATC_Error("ComputedAtomQuantity::set_lammps_to_quantity - Cannot modify a compute's LAMMPS data");}; private: diff --git a/lib/atc/LammpsInterface.h b/lib/atc/LammpsInterface.h index 238e6cff34..ff2b4ba9b2 100644 --- a/lib/atc/LammpsInterface.h +++ b/lib/atc/LammpsInterface.h @@ -10,17 +10,17 @@ #include #include #include "mpi.h" -#include "lammps.h" -#include "comm.h" -#include "modify.h" -#include "memory.h" -#include "random_park.h" +#include "../../src/lmptype.h" +#include "../../src/lammps.h" +#include "../../src/comm.h" +#include "../../src/modify.h" +#include "../../src/memory.h" +#include "../../src/random_park.h" typedef LAMMPS_NS::RanPark* RNG_POINTER; -#include "lmptype.h" -#include "compute.h" +#include "../../src/compute.h" typedef const LAMMPS_NS::Compute* COMPUTE_POINTER; -#include "update.h" -#include "min.h" +#include "../../src/update.h" +#include "../../src/min.h" #include "ATC_Error.h" #include "ATC_TypeDefs.h" #include "MatrixDef.h" diff --git a/lib/atc/Makefile.mingw32-cross b/lib/atc/Makefile.mingw32-cross index 13c81b4e12..49795f1fd2 100644 --- a/lib/atc/Makefile.mingw32-cross +++ b/lib/atc/Makefile.mingw32-cross @@ -1,14 +1,15 @@ # library build -*- makefile -*- SHELL = /bin/sh +# which file will be copied to Makefile.lammps +EXTRAMAKE = Makefile.lammps.linalg + # ------ FILES ------ + SRC = $(wildcard *.cpp) INC = $(wildcard *.h) # ------ DEFINITIONS ------ -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.linalg DIR = Obj_mingw32/ LIB = $(DIR)libatc.a @@ -27,7 +28,7 @@ CCFLAGS = -I../../src -I../../src/STUBS -DMPICH_IGNORE_CXX_SEEK \ ARCHIVE = i686-w64-mingw32-ar ARCHFLAG = -rcs DEPFLAGS = -M -LINK = i686-w64-mingw32-g++ +LINK = $(CC) LINKFLAGS = -O USRLIB = SYSLIB = diff --git a/lib/atc/Makefile.mingw32-cross-mpi b/lib/atc/Makefile.mingw32-cross-mpi index 734fb8a579..522a394dc0 100644 --- a/lib/atc/Makefile.mingw32-cross-mpi +++ b/lib/atc/Makefile.mingw32-cross-mpi @@ -1,14 +1,15 @@ # library build -*- makefile -*- SHELL = /bin/sh +# which file will be copied to Makefile.lammps +EXTRAMAKE = Makefile.lammps.linalg + # ------ FILES ------ + SRC = $(wildcard *.cpp) INC = $(wildcard *.h) # ------ DEFINITIONS ------ -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.linalg DIR = Obj_mingw32-mpi/ LIB = $(DIR)libatc.a @@ -21,14 +22,14 @@ OBJ = $(SRC:%.cpp=$(DIR)%.o) CC = i686-w64-mingw32-g++ CCFLAGS = -I../../tools/mingw-cross/mpich2-win32/include/ \ - -I../../src -I../../src/STUBS -DMPICH_IGNORE_CXX_SEEK \ + -I../../src -DMPICH_IGNORE_CXX_SEEK \ -O3 -march=i686 -mtune=generic -mfpmath=387 -mpc64 \ -ffast-math -funroll-loops -fstrict-aliasing \ -DLAMMPS_SMALLSMALL -Wno-uninitialized ARCHIVE = i686-w64-mingw32-ar ARCHFLAG = -rcs DEPFLAGS = -M -LINK = i686-w64-mingw32-g++ +LINK = $(CC) LINKFLAGS = -O USRLIB = SYSLIB = @@ -43,7 +44,7 @@ $(DIR): Makefile.lammps: @cp $(EXTRAMAKE) Makefile.lammps -$(LIB): $(OBJ) +$(LIB): $(OBJ) $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) @cp $(EXTRAMAKE) Makefile.lammps diff --git a/lib/atc/Makefile.mingw64-cross b/lib/atc/Makefile.mingw64-cross index 3b8e23620f..2dfdf6fe80 100644 --- a/lib/atc/Makefile.mingw64-cross +++ b/lib/atc/Makefile.mingw64-cross @@ -1,14 +1,15 @@ # library build -*- makefile -*- SHELL = /bin/sh +# which file will be copied to Makefile.lammps +EXTRAMAKE = Makefile.lammps.linalg + # ------ FILES ------ + SRC = $(wildcard *.cpp) INC = $(wildcard *.h) # ------ DEFINITIONS ------ -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.linalg DIR = Obj_mingw64/ LIB = $(DIR)libatc.a @@ -27,7 +28,7 @@ CCFLAGS = -I../../src -I../../src/STUBS -DMPICH_IGNORE_CXX_SEEK \ ARCHIVE = x86_64-w64-mingw32-ar ARCHFLAG = -rcs DEPFLAGS = -M -LINK = x86_64-w64-mingw32-g++ +LINK = $(CC) LINKFLAGS = -O USRLIB = SYSLIB = @@ -42,7 +43,7 @@ $(DIR): Makefile.lammps: @cp $(EXTRAMAKE) Makefile.lammps -$(LIB): $(OBJ) +$(LIB): $(OBJ) $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) @cp $(EXTRAMAKE) Makefile.lammps diff --git a/lib/atc/Makefile.mingw64-cross-mpi b/lib/atc/Makefile.mingw64-cross-mpi index aca96597e2..935d86ba25 100644 --- a/lib/atc/Makefile.mingw64-cross-mpi +++ b/lib/atc/Makefile.mingw64-cross-mpi @@ -1,14 +1,15 @@ # library build -*- makefile -*- SHELL = /bin/sh +# which file will be copied to Makefile.lammps +EXTRAMAKE = Makefile.lammps.linalg + # ------ FILES ------ + SRC = $(wildcard *.cpp) INC = $(wildcard *.h) # ------ DEFINITIONS ------ -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.linalg DIR = Obj_mingw64-mpi/ LIB = $(DIR)libatc.a @@ -21,14 +22,14 @@ OBJ = $(SRC:%.cpp=$(DIR)%.o) CC = x86_64-w64-mingw32-g++ CCFLAGS = -I../../tools/mingw-cross/mpich2-win64/include/ \ - -I../../src -I../../src/STUBS -DMPICH_IGNORE_CXX_SEEK \ + -I../../src -DMPICH_IGNORE_CXX_SEEK \ -O3 -march=core2 -mtune=core2 -mpc64 -msse2 \ -ffast-math -funroll-loops -fstrict-aliasing \ -DLAMMPS_SMALLBIG -Wno-uninitialized ARCHIVE = x86_64-w64-mingw32-ar ARCHFLAG = -rcs DEPFLAGS = -M -LINK = x86_64-w64-mingw32-g++ +LINK = $(CC) LINKFLAGS = -O USRLIB = SYSLIB = @@ -43,7 +44,7 @@ $(DIR): Makefile.lammps: @cp $(EXTRAMAKE) Makefile.lammps -$(LIB): $(OBJ) +$(LIB): $(OBJ) $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) @cp $(EXTRAMAKE) Makefile.lammps diff --git a/lib/atc/Makefile.mpic++ b/lib/atc/Makefile.mpic++ index a93d9370b4..982deac5d3 100644 --- a/lib/atc/Makefile.mpic++ +++ b/lib/atc/Makefile.mpic++ @@ -1,4 +1,8 @@ +# library build -*- makefile -*- SHELL = /bin/sh + +# which file will be copied to Makefile.lammps +EXTRAMAKE = Makefile.lammps.installed # ------ FILES ------ SRC = $(wildcard *.cpp) INC = $(wildcard *.h) @@ -6,17 +10,21 @@ INC = $(wildcard *.h) LIB = libatc.a OBJ = $(SRC:.cpp=.o) # ------ SETTINGS ------ + +# include any MPI settings needed for the ATC library to build with +# must be the same MPI library that LAMMPS is built with + CC = mpic++ -CCFLAGS = -O -g -I../../src -fPIC -DMPICH_IGNORE_CXX_SEEK +CCFLAGS = -O3 -Wall -g -I../../src -fPIC -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 ARCHIVE = ar ARCHFLAG = -rc DEPFLAGS = -M -LINK = ${CC} +LINK = $(CC) LINKFLAGS = -O # ------ MAKE PROCEDURE ------ lib: $(OBJ) $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) - @cp Makefile.lammps.installed Makefile.lammps + @cp $(EXTRAMAKE) Makefile.lammps # ------ COMPILE RULES ------ %.o:%.cpp $(CC) $(CCFLAGS) -c $< @@ -26,4 +34,6 @@ lib: $(OBJ) DEPENDS = $(OBJ:.o=.d) # ------ CLEAN ------ clean: - @rm *.o *.d $(LIB) + @rm *.o *.d *~ $(LIB) + +sinclude $(DEPENDS) diff --git a/lib/atc/Makefile.serial b/lib/atc/Makefile.serial index ced890e3ce..8204430c81 100644 --- a/lib/atc/Makefile.serial +++ b/lib/atc/Makefile.serial @@ -1,10 +1,11 @@ +# library build -*- makefile -*- SHELL = /bin/sh # which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.installed +EXTRAMAKE = Makefile.lammps.linalg # ------ FILES ------ + SRC = $(wildcard *.cpp) INC = $(wildcard *.h) @@ -23,11 +24,8 @@ CCFLAGS = -O -g -fPIC -I../../src -I../../src/STUBS ARCHIVE = ar ARCHFLAG = -rc DEPFLAGS = -M -LINK = g++ +LINK = $(CC) LINKFLAGS = -O -USRLIB = -SYSLIB = - # ------ MAKE PROCEDURE ------ lib: $(OBJ) @@ -48,4 +46,6 @@ DEPENDS = $(OBJ:.o=.d) # ------ CLEAN ------ clean: - rm *.o *.d *~ $(LIB) + @rm *.o *.d *~ $(LIB) + +sinclude $(DEPENDS) diff --git a/lib/atc/Matrix.h b/lib/atc/Matrix.h index 076ed18676..e467128fbc 100644 --- a/lib/atc/Matrix.h +++ b/lib/atc/Matrix.h @@ -26,7 +26,8 @@ public: friend std::ostream& operator<<(std::ostream &o, const Matrix &m){m.print(o); return o;} void print() const; virtual void print(const std::string &name, int p = myPrecision) const; - virtual std::string to_string(int p = myPrecision) const; + virtual std::string to_string(int p) const; + virtual std::string to_string() const { return to_string(myPrecision); } // element by element operations DenseMatrix operator/(const Matrix& B) const; diff --git a/lib/atc/MeshReader.cpp b/lib/atc/MeshReader.cpp index a50a195847..14101f1297 100644 --- a/lib/atc/MeshReader.cpp +++ b/lib/atc/MeshReader.cpp @@ -24,8 +24,7 @@ namespace ATC { : meshfile_(filename), periodicity_(periodicity), nNodes_(0), - nElements_(0), - coordTol_(tol) + nElements_(0) { conn_ = new Array2D(); nodeCoords_ = new DENS_MAT; diff --git a/lib/atc/MeshReader.h b/lib/atc/MeshReader.h index d974b75e11..f7238afba2 100644 --- a/lib/atc/MeshReader.h +++ b/lib/atc/MeshReader.h @@ -44,7 +44,6 @@ namespace ATC { ATC_matrix::Array2D * conn_; DENS_MAT * nodeCoords_; ATC_matrix::Array > > * nodeSets_; - double coordTol_; }; }; // end namespace ATC diff --git a/lib/atc/MoleculeSet.cpp b/lib/atc/MoleculeSet.cpp index e1c7da6d85..618261f186 100644 --- a/lib/atc/MoleculeSet.cpp +++ b/lib/atc/MoleculeSet.cpp @@ -189,13 +189,13 @@ namespace ATC { //-------------------------------------------------------- // initialize //-------------------------------------------------------- - void SmallMoleculeSet::initialize() + void SmallMoleculeSet::initialize(std::map * globalAtomsPerMolecule) { // make sure newton_bond is off, otherwise use large molecule set if (lammps_->newton_bond()) throw ATC_Error("Cannot use newton_bond with small molecules"); - MoleculeSet::initialize(); + MoleculeSet::initialize(globalAtomsPerMolecule); } //-------------------------------------------------------- diff --git a/lib/atc/MoleculeSet.h b/lib/atc/MoleculeSet.h index 6fa8158766..cffafd950d 100644 --- a/lib/atc/MoleculeSet.h +++ b/lib/atc/MoleculeSet.h @@ -117,7 +117,7 @@ namespace ATC { virtual void clear(); /** initialize global data */ - virtual void initialize(); + virtual void initialize(std::map * globalAtomsPerMolecule = NULL); /** access molecule atoms by lammps id */ std::set atoms_by_global_molecule(int id) const; diff --git a/lib/atc/PerAtomQuantity.h b/lib/atc/PerAtomQuantity.h index a4e8c78aad..548918c9cc 100644 --- a/lib/atc/PerAtomQuantity.h +++ b/lib/atc/PerAtomQuantity.h @@ -287,7 +287,7 @@ namespace ATC { virtual int unpack_comm(int index, double *buf) {return 0;}; /** returns size of per-atom communication */ - virtual int size_comm() {return 0;}; + virtual int size_comm() const {return 0;}; /** changes size of temperary lammps storage data if transfer is being used */ virtual void grow_lammps_array(int nmax, const std::string & tag) {}; diff --git a/lib/atc/PerAtomQuantityLibrary.h b/lib/atc/PerAtomQuantityLibrary.h index dbc1f16e29..b3db140f82 100644 --- a/lib/atc/PerAtomQuantityLibrary.h +++ b/lib/atc/PerAtomQuantityLibrary.h @@ -1058,7 +1058,7 @@ namespace ATC { virtual int unpack_comm(int index, double *buf) {return 0;}; /** returns size of per-atom communication */ - virtual int size_comm() {return 0;}; + virtual int size_comm() const {return 0;}; /** changes size of temperary lammps storage data if transfer is being used */ virtual void grow_lammps_array(int nmax, const std::string & tag) {}; diff --git a/lib/atc/SchrodingerSolver.cpp b/lib/atc/SchrodingerSolver.cpp index 0bbfde8e2b..92eb1a7a62 100644 --- a/lib/atc/SchrodingerSolver.cpp +++ b/lib/atc/SchrodingerSolver.cpp @@ -18,7 +18,6 @@ using std::min; using ATC_Utility::to_string; using ATC_Utility::sgn; -const double tol = 1.e-8; const double zero_tol = 1.e-12; const double f_tol = 1.e-8; @@ -779,7 +778,6 @@ double fermi_dirac(const double E, const double T) { std::cout << "******************HACK******************\n"; - const DENS_MAT & phi = (atc_->fields_[ELECTRIC_POTENTIAL]).quantity(); DENS_MAT & n = (atc_->fields_[ELECTRON_DENSITY] ).set_quantity(); DENS_MAT & Ef = (atc_->field(FERMI_ENERGY)).set_quantity(); double T = 300; diff --git a/lib/atc/SparseMatrix-inl.h b/lib/atc/SparseMatrix-inl.h index 066a3a1211..8d6aec78dc 100644 --- a/lib/atc/SparseMatrix-inl.h +++ b/lib/atc/SparseMatrix-inl.h @@ -24,7 +24,7 @@ SparseMatrix::SparseMatrix(INDEX rows, INDEX cols) //----------------------------------------------------------------------------- template SparseMatrix::SparseMatrix(const SparseMatrix& C) - : _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false) + : Matrix(), _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false) { _copy(C); } @@ -33,7 +33,7 @@ SparseMatrix::SparseMatrix(const SparseMatrix& C) //----------------------------------------------------------------------------- template SparseMatrix::SparseMatrix(const DenseMatrix& C) -: _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false) +: Matrix(), _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false) { reset(C); } diff --git a/lib/atc/WeakEquationElectronContinuity.h b/lib/atc/WeakEquationElectronContinuity.h index e12dce45ad..f7e00246da 100644 --- a/lib/atc/WeakEquationElectronContinuity.h +++ b/lib/atc/WeakEquationElectronContinuity.h @@ -39,7 +39,7 @@ class WeakEquationElectronContinuity : public WeakEquation { DENS_MAT_VEC &flux) const; /** flux that is integrated with N as its weight */ - virtual bool has_N_integrand(void) {return true;} + virtual bool has_N_integrand(void) const {return true;} virtual bool N_integrand(const FIELD_MATS &fields, const GRAD_FIELD_MATS &grad_fields, const Material * material,