git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12813 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2014-12-02 02:12:19 +00:00
parent 70593d92cb
commit 9f649c3123
33 changed files with 91 additions and 92 deletions

View File

@ -321,9 +321,7 @@ namespace ATC {
//--------------------------------------------------------
bool ATC_CouplingMomentumEnergy::modify(int narg, char **arg)
{
bool foundMatch = false;
int argIndex = 0;
return foundMatch;
return false;
}
//--------------------------------------------------------------------

View File

@ -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 */

View File

@ -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) {}

View File

@ -142,9 +142,9 @@ namespace ATC {
//--------------------------------------------------------
// output
//--------------------------------------------------------
void ChargeRegulator::output(OUTPUT_LIST & outputData)
void ChargeRegulator::output(OUTPUT_LIST & outputData) const
{
map<string, ChargeRegulatorMethod *>::iterator itr;
map<string, ChargeRegulatorMethod *>::const_iterator itr;
for (itr = regulators_.begin();
itr != regulators_.end(); itr++) { itr->second->output(outputData);}
}

View File

@ -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_;}

View File

@ -17,9 +17,9 @@ class DenseMatrix : public Matrix<T>
{
public:
DenseMatrix(INDEX rows=0, INDEX cols=0, bool z=1): _data(NULL){ _create(rows, cols, z); }
DenseMatrix(const DenseMatrix<T>& c) : _data(NULL){ _copy(c); }
DenseMatrix(const SparseMatrix<T>& c): _data(NULL){ c.dense_copy(*this);}
DenseMatrix(const Matrix<T>& c) : _data(NULL){ _copy(c); }
DenseMatrix(const DenseMatrix<T>& c) : Matrix<T>(), _data(NULL){ _copy(c); }
DenseMatrix(const SparseMatrix<T>& c): Matrix<T>(), _data(NULL){ c.dense_copy(*this);}
DenseMatrix(const Matrix<T>& c) : Matrix<T>(), _data(NULL){ _copy(c); }
// const SparseMatrix<T> * p = sparse_cast(&c);
// (p) ? p->dense_copy(*this) : _copy(c); }
~DenseMatrix() { _delete();}

View File

@ -16,9 +16,9 @@ class DenseVector : public Vector<T>
{
public:
explicit DenseVector(INDEX n=0, bool z=1) { _create(n,z); }
DenseVector(const DenseVector<T> &c) : _data(NULL) { _copy(c); }
DenseVector(const Vector<T> &c) : _data(NULL) { _copy(c); }
DenseVector(const T * ptr, INDEX nrows) : _data(NULL) { copy(ptr,nrows); }
DenseVector(const DenseVector<T> &c) : Vector<T>(), _data(NULL) { _copy(c); }
DenseVector(const Vector<T> &c) : Vector<T>(), _data(NULL) { _copy(c); }
DenseVector(const T * ptr, INDEX nrows) : Vector<T>(), _data(NULL) { copy(ptr,nrows); }
virtual ~DenseVector() { _delete(); }
//* resizes the Vector, ignores nCols, optionally copys what fits

View File

@ -185,7 +185,7 @@ namespace ATC {
virtual void operator/=(const MatrixDependencyManager<T,U> & 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:

View File

@ -213,7 +213,7 @@ DiagonalMatrix<T>::DiagonalMatrix(INDEX rows, bool zero)
//-----------------------------------------------------------------------------
template<typename T>
DiagonalMatrix<T>::DiagonalMatrix(const DiagonalMatrix<T>& c)
: _data(NULL)
: Matrix<T>(), _data(NULL)
{
reset(c);
}
@ -222,7 +222,7 @@ DiagonalMatrix<T>::DiagonalMatrix(const DiagonalMatrix<T>& c)
//-----------------------------------------------------------------------------
template<typename T>
DiagonalMatrix<T>::DiagonalMatrix(const Vector<T>& v)
: _data(NULL)
: Matrix<T>(), _data(NULL)
{
reset(v);
}

View File

@ -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);
}

View File

@ -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 {
//--------------------------------------------------------

View File

@ -70,10 +70,10 @@ namespace ATC {
const Array2D<int> &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

View File

@ -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<nFieldDOF; ++idof) {

View File

@ -588,7 +588,8 @@ namespace ATC {
void distribute_mesh_data();
protected:
/** create global-to-unique node mapping */
virtual void setup_periodicity(double tol = 1.e-8);
virtual void setup_periodicity(double tol);
virtual void setup_periodicity() { setup_periodicity(1.e-8); }
void fix_periodicity (int idim);
int find_boundary_nodes(int idim, std::set<int> & nodes);
bool match_nodes(int idim, std::set<int> & top, std::set<int> & 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

View File

@ -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 ) {};

View File

@ -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:

View File

@ -10,17 +10,17 @@
#include <fstream>
#include <utility>
#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"

View File

@ -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 =

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -26,7 +26,8 @@ public:
friend std::ostream& operator<<(std::ostream &o, const Matrix<T> &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<T> operator/(const Matrix<T>& B) const;

View File

@ -24,8 +24,7 @@ namespace ATC {
: meshfile_(filename),
periodicity_(periodicity),
nNodes_(0),
nElements_(0),
coordTol_(tol)
nElements_(0)
{
conn_ = new Array2D<int>();
nodeCoords_ = new DENS_MAT;

View File

@ -44,7 +44,6 @@ namespace ATC {
ATC_matrix::Array2D<int> * conn_;
DENS_MAT * nodeCoords_;
ATC_matrix::Array<std::pair<std::string,std::set<int> > > * nodeSets_;
double coordTol_;
};
}; // end namespace ATC

View File

@ -189,13 +189,13 @@ namespace ATC {
//--------------------------------------------------------
// initialize
//--------------------------------------------------------
void SmallMoleculeSet::initialize()
void SmallMoleculeSet::initialize(std::map<int, double> * 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);
}
//--------------------------------------------------------

View File

@ -117,7 +117,7 @@ namespace ATC {
virtual void clear();
/** initialize global data */
virtual void initialize();
virtual void initialize(std::map<int, double> * globalAtomsPerMolecule = NULL);
/** access molecule atoms by lammps id */
std::set<int> atoms_by_global_molecule(int id) const;

View File

@ -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) {};

View File

@ -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) {};

View File

@ -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;

View File

@ -24,7 +24,7 @@ SparseMatrix<T>::SparseMatrix(INDEX rows, INDEX cols)
//-----------------------------------------------------------------------------
template<typename T>
SparseMatrix<T>::SparseMatrix(const SparseMatrix<T>& C)
: _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false)
: Matrix<T>(), _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false)
{
_copy(C);
}
@ -33,7 +33,7 @@ SparseMatrix<T>::SparseMatrix(const SparseMatrix<T>& C)
//-----------------------------------------------------------------------------
template<typename T>
SparseMatrix<T>::SparseMatrix(const DenseMatrix<T>& C)
: _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false)
: Matrix<T>(), _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false)
{
reset(C);
}

View File

@ -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,