ATC version 2.0, date: Aug28
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@10695 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -1070,6 +1070,16 @@ namespace ATC {
|
||||
rhs);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
bool ATC_Coupling::reset_methods() const
|
||||
{
|
||||
bool resetMethods = ATC_Method::reset_methods() || atomicRegulator_->need_reset();
|
||||
for (_ctiIt_ = timeIntegrators_.begin(); _ctiIt_ != timeIntegrators_.end(); ++_ctiIt_) {
|
||||
resetMethods |= (_ctiIt_->second)->need_reset();
|
||||
}
|
||||
return resetMethods;
|
||||
}
|
||||
//--------------------------------------------------
|
||||
void ATC_Coupling::initialize()
|
||||
{
|
||||
@ -1123,9 +1133,119 @@ namespace ATC {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// prepare computes for first timestep
|
||||
lammpsInterface_->computes_addstep(lammpsInterface_->ntimestep()+1);
|
||||
|
||||
// resetting precedence:
|
||||
// time integrator -> kinetostat/thermostat -> time filter
|
||||
// init_filter uses fieldRateNdFiltered which comes from the time integrator,
|
||||
// which is why the time integrator is initialized first
|
||||
|
||||
// other initializations
|
||||
if (reset_methods()) {
|
||||
for (_tiIt_ = timeIntegrators_.begin(); _tiIt_ != timeIntegrators_.end(); ++_tiIt_) {
|
||||
(_tiIt_->second)->initialize();
|
||||
}
|
||||
atomicRegulator_->initialize();
|
||||
}
|
||||
extrinsicModelManager_.initialize();
|
||||
if (timeFilterManager_.need_reset()) {// reset thermostat power
|
||||
init_filter();
|
||||
}
|
||||
// clears need for reset
|
||||
timeFilterManager_.initialize();
|
||||
ghostManager_.initialize();
|
||||
|
||||
if (!initialized_) {
|
||||
// initialize sources based on initial FE temperature
|
||||
double dt = lammpsInterface_->dt();
|
||||
prescribedDataMgr_->set_sources(time()+0.5*dt,sources_);
|
||||
extrinsicModelManager_.set_sources(fields_,extrinsicSources_);
|
||||
atomicRegulator_->compute_boundary_flux(fields_);
|
||||
compute_atomic_sources(fieldMask_,fields_,atomicSources_);
|
||||
|
||||
// read in field data if necessary
|
||||
if (useRestart_) {
|
||||
RESTART_LIST data;
|
||||
read_restart_data(restartFileName_,data);
|
||||
useRestart_ = false;
|
||||
}
|
||||
|
||||
// set consistent initial conditions, if requested
|
||||
if (!timeFilterManager_.filter_dynamics() && consistentInitialization_) {
|
||||
|
||||
const INT_ARRAY & nodeType(nodalGeometryType_->quantity());
|
||||
|
||||
if (fieldSizes_.find(VELOCITY) != fieldSizes_.end()) {
|
||||
DENS_MAT & velocity(fields_[VELOCITY].set_quantity());
|
||||
DENS_MAN * nodalAtomicVelocity(interscaleManager_.dense_matrix("NodalAtomicVelocity"));
|
||||
const DENS_MAT & atomicVelocity(nodalAtomicVelocity->quantity());
|
||||
for (int i = 0; i<nNodes_; ++i) {
|
||||
|
||||
if (nodeType(i,0)==MD_ONLY) {
|
||||
for (int j = 0; j < nsd_; j++) {
|
||||
velocity(i,j) = atomicVelocity(i,j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fieldSizes_.find(TEMPERATURE) != fieldSizes_.end()) {
|
||||
DENS_MAT & temperature(fields_[TEMPERATURE].set_quantity());
|
||||
DENS_MAN * nodalAtomicTemperature(interscaleManager_.dense_matrix("NodalAtomicTemperature"));
|
||||
const DENS_MAT & atomicTemperature(nodalAtomicTemperature->quantity());
|
||||
|
||||
for (int i = 0; i<nNodes_; ++i) {
|
||||
|
||||
if (nodeType(i,0)==MD_ONLY) {
|
||||
temperature(i,0) = atomicTemperature(i,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fieldSizes_.find(DISPLACEMENT) != fieldSizes_.end()) {
|
||||
DENS_MAT & displacement(fields_[DISPLACEMENT].set_quantity());
|
||||
DENS_MAN * nodalAtomicDisplacement(interscaleManager_.dense_matrix("NodalAtomicDisplacement"));
|
||||
const DENS_MAT & atomicDisplacement(nodalAtomicDisplacement->quantity());
|
||||
for (int i = 0; i<nNodes_; ++i) {
|
||||
|
||||
if (nodeType(i,0)==MD_ONLY) {
|
||||
for (int j = 0; j < nsd_; j++) {
|
||||
displacement(i,j) = atomicDisplacement(i,j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//WIP_JAT update next two when full species time integrator is added
|
||||
if (fieldSizes_.find(MASS_DENSITY) != fieldSizes_.end()) {
|
||||
DENS_MAT & massDensity(fields_[MASS_DENSITY].set_quantity());
|
||||
const DENS_MAT & atomicMassDensity(atomicFields_[MASS_DENSITY]->quantity());
|
||||
for (int i = 0; i<nNodes_; ++i) {
|
||||
|
||||
if (nodeType(i,0)==MD_ONLY) {
|
||||
massDensity(i,0) = atomicMassDensity(i,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fieldSizes_.find(SPECIES_CONCENTRATION) != fieldSizes_.end()) {
|
||||
DENS_MAT & speciesConcentration(fields_[SPECIES_CONCENTRATION].set_quantity());
|
||||
const DENS_MAT & atomicSpeciesConcentration(atomicFields_[SPECIES_CONCENTRATION]->quantity());
|
||||
for (int i = 0; i<nNodes_; ++i) {
|
||||
|
||||
if (nodeType(i,0)==MD_ONLY) {
|
||||
for (int j = 0; j < atomicSpeciesConcentration.nCols(); ++j) {
|
||||
speciesConcentration(i,j) = atomicSpeciesConcentration(i,j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
initialized_ = true;
|
||||
}
|
||||
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
void ATC_Coupling::construct_time_integration_data()
|
||||
@ -1731,22 +1851,23 @@ namespace ATC {
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
// mid_init_integrate
|
||||
// time integration between the velocity update and
|
||||
// the position lammps update of Verlet step 1
|
||||
// init_integrate
|
||||
// time integration of lammps atomic quantities
|
||||
//--------------------------------------------------------
|
||||
void ATC_Coupling::mid_init_integrate()
|
||||
void ATC_Coupling::init_integrate()
|
||||
{
|
||||
double dt = lammpsInterface_->dt();
|
||||
atomTimeIntegrator_->init_integrate_velocity(dt());
|
||||
ghostManager_.init_integrate_velocity(dt());
|
||||
// account for other fixes doing time integration
|
||||
interscaleManager_.fundamental_force_reset(LammpsInterface::ATOM_VELOCITY);
|
||||
|
||||
// Compute nodal velocity at n+1/2, if needed
|
||||
for (_tiIt_ = timeIntegrators_.begin(); _tiIt_ != timeIntegrators_.end(); ++_tiIt_) {
|
||||
(_tiIt_->second)->mid_initial_integrate1(dt);
|
||||
}
|
||||
// apply constraints to velocity
|
||||
atomicRegulator_->apply_mid_predictor(dt(),lammpsInterface_->ntimestep());
|
||||
|
||||
atomicRegulator_->apply_mid_predictor(dt,lammpsInterface_->ntimestep());
|
||||
|
||||
extrinsicModelManager_.mid_init_integrate();
|
||||
atomTimeIntegrator_->init_integrate_position(dt());
|
||||
ghostManager_.init_integrate_position(dt());
|
||||
// account for other fixes doing time integration
|
||||
interscaleManager_.fundamental_force_reset(LammpsInterface::ATOM_POSITION);
|
||||
}
|
||||
|
||||
///--------------------------------------------------------
|
||||
@ -1941,6 +2062,7 @@ namespace ATC {
|
||||
|
||||
output();
|
||||
lammpsInterface_->computes_addstep(lammpsInterface_->ntimestep()+1); // adds next step to computes
|
||||
//ATC_Method::post_final_integrate();
|
||||
}
|
||||
|
||||
//=================================================================
|
||||
|
||||
@ -61,27 +61,25 @@ namespace ATC {
|
||||
/** pre integration run */
|
||||
virtual void initialize();
|
||||
|
||||
/** flags whether a methods reset is required */
|
||||
virtual bool reset_methods() const;
|
||||
|
||||
/** post integration run : called at end of run or simulation */
|
||||
virtual void finish();
|
||||
|
||||
/** first time, before atomic integration */
|
||||
virtual void pre_init_integrate();
|
||||
|
||||
/** Predictor phase, executed between velocity and position Verlet */
|
||||
virtual void mid_init_integrate();
|
||||
/** Predictor phase, Verlet first step for velocity and position */
|
||||
virtual void init_integrate();
|
||||
|
||||
/** Predictor phase, executed after Verlet */
|
||||
virtual void post_init_integrate();
|
||||
#ifdef OBSOLETE
|
||||
/** Corrector phase, executed before Verlet */
|
||||
virtual void pre_final_integrate(){};
|
||||
#endif
|
||||
|
||||
/** Corrector phase, executed after Verlet*/
|
||||
|
||||
virtual void post_final_integrate();
|
||||
#ifdef OBSOLETE
|
||||
{lammpsInterface_->computes_addstep(lammpsInterface_->ntimestep()+1);};
|
||||
#endif
|
||||
|
||||
/** pre/post atomic force calculation in minimize */
|
||||
virtual void min_pre_force(){};
|
||||
virtual void min_post_force(){};
|
||||
@ -446,6 +444,8 @@ namespace ATC {
|
||||
FIELDS rhs_; // for pde
|
||||
FIELDS rhsAtomDomain_; // for thermostat
|
||||
FIELDS boundaryFlux_; // for thermostat & rhs pde
|
||||
// DATA structures for tracking individual species and molecules
|
||||
FIELD_POINTERS atomicFields_;
|
||||
/*@}*/
|
||||
|
||||
// workspace variables
|
||||
|
||||
@ -30,9 +30,6 @@ namespace ATC {
|
||||
string matParamFile,
|
||||
ExtrinsicModelType extrinsicModel)
|
||||
: ATC_Coupling(groupName,perAtomArray,thisFix),
|
||||
#ifdef OBSOLETE
|
||||
nodalAtomicHeatCapacity_(NULL),
|
||||
#endif
|
||||
nodalAtomicKineticTemperature_(NULL),
|
||||
nodalAtomicConfigurationalTemperature_(NULL)
|
||||
{
|
||||
@ -69,9 +66,6 @@ namespace ATC {
|
||||
extVector_ = 1;
|
||||
if (extrinsicModel != NO_MODEL)
|
||||
sizeVector_ += extrinsicModelManager_.size_vector(sizeVector_);
|
||||
|
||||
// create PE per atom ccompute
|
||||
//lammpsInterface_->create_compute_pe_peratom();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
@ -92,60 +86,6 @@ namespace ATC {
|
||||
// Base class initalizations
|
||||
ATC_Coupling::initialize();
|
||||
|
||||
// resetting precedence:
|
||||
// time integrator -> thermostat -> time filter
|
||||
// init_filter uses fieldRateNdFiltered which comes from the time integrator,
|
||||
// which is why the time integrator is initialized first
|
||||
|
||||
// other initializations
|
||||
if (reset_methods()) {
|
||||
for (_tiIt_ = timeIntegrators_.begin(); _tiIt_ != timeIntegrators_.end(); ++_tiIt_) {
|
||||
(_tiIt_->second)->initialize();
|
||||
}
|
||||
atomicRegulator_->initialize();
|
||||
}
|
||||
extrinsicModelManager_.initialize();
|
||||
// reset thermostat power for time filter initial conditions for special cases
|
||||
if (timeFilterManager_.need_reset()) {
|
||||
init_filter();
|
||||
}
|
||||
// clears need for reset
|
||||
timeFilterManager_.initialize();
|
||||
ghostManager_.initialize();
|
||||
|
||||
if (!initialized_) {
|
||||
// initialize sources based on initial FE temperature
|
||||
double dt = lammpsInterface_->dt();
|
||||
prescribedDataMgr_->set_sources(time()+0.5*dt,sources_);
|
||||
extrinsicModelManager_.set_sources(fields_,extrinsicSources_);
|
||||
atomicRegulator_->compute_boundary_flux(fields_);
|
||||
compute_atomic_sources(fieldMask_,fields_,atomicSources_);
|
||||
|
||||
// read in field data if necessary
|
||||
if (useRestart_) {
|
||||
RESTART_LIST data;
|
||||
read_restart_data(restartFileName_,data);
|
||||
useRestart_ = false;
|
||||
}
|
||||
|
||||
// set consistent initial conditions, if requested
|
||||
if (!timeFilterManager_.filter_dynamics()) {
|
||||
if (consistentInitialization_) {
|
||||
|
||||
DENS_MAT & temperature(fields_[TEMPERATURE].set_quantity());
|
||||
DENS_MAN * nodalAtomicTemperature(interscaleManager_.dense_matrix("NodalAtomicTemperature"));
|
||||
const DENS_MAT & atomicTemperature(nodalAtomicTemperature->quantity());
|
||||
const INT_ARRAY & nodeType(nodalGeometryType_->quantity());
|
||||
for (int i = 0; i<nNodes_; ++i) {
|
||||
|
||||
if (nodeType(i,0)==MD_ONLY)
|
||||
temperature(i,0) = atomicTemperature(i,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
initialized_ = true;
|
||||
}
|
||||
|
||||
// reset integration field mask
|
||||
intrinsicMask_.reset(NUM_FIELDS,NUM_FLUX);
|
||||
intrinsicMask_ = false;
|
||||
@ -257,21 +197,7 @@ namespace ATC {
|
||||
TEMPERATURE);
|
||||
interscaleManager_.add_dense_matrix(nodalAtomicTemperature,
|
||||
"NodalAtomicTemperature");
|
||||
#ifdef OBSOLETE
|
||||
if (!useFeMdMassMatrix_) {
|
||||
// classical thermodynamic heat capacity of the atoms
|
||||
HeatCapacity * heatCapacity = new HeatCapacity(this);
|
||||
interscaleManager_.add_per_atom_quantity(heatCapacity,
|
||||
"AtomicHeatCapacity");
|
||||
|
||||
// atomic thermal mass matrix
|
||||
nodalAtomicHeatCapacity_ = new AtfShapeFunctionRestriction(this,
|
||||
heatCapacity,
|
||||
shpFcn_);
|
||||
interscaleManager_.add_dense_matrix(nodalAtomicHeatCapacity_,
|
||||
"NodalAtomicHeatCapacity");
|
||||
}
|
||||
#endif
|
||||
for (_tiIt_ = timeIntegrators_.begin(); _tiIt_ != timeIntegrators_.end(); ++_tiIt_) {
|
||||
(_tiIt_->second)->construct_transfers();
|
||||
}
|
||||
@ -314,20 +240,7 @@ namespace ATC {
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef OBSOLETE
|
||||
//---------------------------------------------------------
|
||||
// compute_md_mass_matrix
|
||||
// compute the mass matrix arising from only atomistic
|
||||
// quadrature and contributions as a summation
|
||||
//---------------------------------------------------------
|
||||
void ATC_CouplingEnergy::compute_md_mass_matrix(FieldName thisField,
|
||||
DIAG_MAT & massMat)
|
||||
{
|
||||
|
||||
if (thisField == TEMPERATURE)
|
||||
massMat.reset(nodalAtomicHeatCapacity_->quantity());
|
||||
}
|
||||
#endif
|
||||
//--------------------------------------------------------
|
||||
// modify
|
||||
// parses inputs and modifies state of the filter
|
||||
|
||||
@ -42,15 +42,6 @@ namespace ATC {
|
||||
/** pre time integration */
|
||||
virtual void initialize();
|
||||
|
||||
/** flags whether a methods reset is required */
|
||||
|
||||
virtual bool reset_methods() const {
|
||||
bool resetMethods = ATC_Method::reset_methods() || atomicRegulator_->need_reset();
|
||||
_ctiIt_ = timeIntegrators_.find(TEMPERATURE);
|
||||
if (_ctiIt_ == timeIntegrators_.end()) return resetMethods;
|
||||
return resetMethods || (_ctiIt_->second)->need_reset();
|
||||
};
|
||||
|
||||
/** compute vector for output */
|
||||
virtual double compute_vector(int n);
|
||||
|
||||
@ -69,14 +60,7 @@ namespace ATC {
|
||||
|
||||
/** sets the position/velocity of the ghost atoms */
|
||||
virtual void set_ghost_atoms(){};
|
||||
#ifdef OBSOLETE
|
||||
/** compute the mass matrix components coming from MD integration */
|
||||
virtual void compute_md_mass_matrix(FieldName thisField,
|
||||
DIAG_MAT & massMats);
|
||||
|
||||
/** operator to compute mass matrix from MD */
|
||||
AtfShapeFunctionRestriction * nodalAtomicHeatCapacity_;
|
||||
#endif
|
||||
/** physics specific filter initialization */
|
||||
void init_filter();
|
||||
|
||||
|
||||
@ -123,68 +123,6 @@ namespace ATC {
|
||||
// Base class initalizations
|
||||
ATC_Coupling::initialize();
|
||||
|
||||
// check that only all atoms
|
||||
|
||||
if (bndyIntType_ != NO_QUADRATURE) throw ATC_Error("ATC_CouplingMass: only all atoms simulations are supported");
|
||||
|
||||
// set consistent initial conditions, if requested
|
||||
if (!timeFilterManager_.filter_dynamics()) {
|
||||
if (consistentInitialization_) {
|
||||
|
||||
DENS_MAT & massDensity(fields_[MASS_DENSITY].set_quantity());
|
||||
const DENS_MAT & atomicMassDensity(atomicFields_[MASS_DENSITY]->quantity());
|
||||
|
||||
DENS_MAT & speciesConcentration(fields_[SPECIES_CONCENTRATION].set_quantity());
|
||||
const DENS_MAT & atomicSpeciesConcentration(atomicFields_[SPECIES_CONCENTRATION]->quantity());
|
||||
|
||||
const INT_ARRAY & nodeType(nodalGeometryType_->quantity());
|
||||
for (int i = 0; i<nNodes_; ++i) {
|
||||
|
||||
if (nodeType(i,0)==MD_ONLY) {
|
||||
massDensity(i,0) = atomicMassDensity(i,0);
|
||||
for (int j = 0; j < atomicSpeciesConcentration.nCols(); ++j) {
|
||||
speciesConcentration(i,j) = atomicSpeciesConcentration(i,j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// other initializatifields_[SPECIES_CONCENTRATION].quantity()ons
|
||||
if (reset_methods()) {
|
||||
for (_tiIt_ = timeIntegrators_.begin(); _tiIt_ != timeIntegrators_.end(); ++_tiIt_) {
|
||||
(_tiIt_->second)->initialize();
|
||||
}
|
||||
}
|
||||
extrinsicModelManager_.initialize(); // always needed to construct new Poisson solver
|
||||
if (timeFilterManager_.need_reset()) {
|
||||
init_filter();
|
||||
}
|
||||
// clears need for reset
|
||||
timeFilterManager_.initialize();
|
||||
atomicRegulator_->initialize();
|
||||
ghostManager_.initialize();
|
||||
|
||||
if (!initialized_) {
|
||||
// initialize sources based on initial FE temperature
|
||||
double dt = lammpsInterface_->dt();
|
||||
// set sources
|
||||
|
||||
prescribedDataMgr_->set_sources(time()+0.5*dt,sources_);
|
||||
extrinsicModelManager_.set_sources(fields_,extrinsicSources_);
|
||||
compute_atomic_sources(fieldMask_,fields_,atomicSources_);
|
||||
|
||||
// read in field data if necessary
|
||||
if (useRestart_) {
|
||||
RESTART_LIST data;
|
||||
read_restart_data(restartFileName_,data);
|
||||
useRestart_ = false;
|
||||
}
|
||||
|
||||
initialized_ = true;
|
||||
}
|
||||
|
||||
// reset integration field mask
|
||||
intrinsicMask_.reset(NUM_FIELDS,NUM_FLUX);
|
||||
intrinsicMask_ = false;
|
||||
@ -245,17 +183,7 @@ namespace ATC {
|
||||
|
||||
ATC_Coupling::init_filter();
|
||||
}
|
||||
#ifdef OBSOLETE
|
||||
void ATC_CouplingMass::compute_md_mass_matrix(FieldName thisField,
|
||||
DIAG_MAT & massMat)
|
||||
{
|
||||
|
||||
if (thisField == MASS_DENSITY ||
|
||||
thisField == SPECIES_CONCENTRATION) {
|
||||
massMat.reset(nodalAtomicVolume_->quantity());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//WIP_JAT consolidate to coupling when we handle the temperature correctly
|
||||
//--------------------------------------------------------
|
||||
// pre_exchange
|
||||
|
||||
@ -72,17 +72,10 @@ namespace ATC {
|
||||
|
||||
/** sets the position/velocity of the ghost atoms */
|
||||
virtual void set_ghost_atoms(){};
|
||||
#ifdef OBSOLETE
|
||||
/** compute the mass matrix components coming from MD integration */
|
||||
virtual void compute_md_mass_matrix(FieldName thisField,
|
||||
DIAG_MAT & massMats);
|
||||
#endif
|
||||
|
||||
/** physics specific filter initialization */
|
||||
void init_filter();
|
||||
|
||||
// DATA structures for tracking individual species and molecules
|
||||
FIELD_POINTERS atomicFields_;
|
||||
|
||||
bool resetNlocal_;
|
||||
|
||||
|
||||
|
||||
@ -33,10 +33,6 @@ namespace ATC {
|
||||
PhysicsType intrinsicModel,
|
||||
ExtrinsicModelType extrinsicModel)
|
||||
: ATC_Coupling(groupName,perAtomArray,thisFix),
|
||||
#ifdef OBSOLETE
|
||||
nodalAtomicMass_(NULL),
|
||||
nodalAtomicCount_(NULL),
|
||||
#endif
|
||||
refPE_(0)
|
||||
{
|
||||
// Allocate PhysicsModel
|
||||
@ -110,73 +106,6 @@ namespace ATC {
|
||||
// Base class initalizations
|
||||
ATC_Coupling::initialize();
|
||||
|
||||
// check resetting precedence:
|
||||
// time integrator -> kinetostat -> time filter
|
||||
|
||||
// other initializations
|
||||
if (reset_methods()) {
|
||||
for (_tiIt_ = timeIntegrators_.begin(); _tiIt_ != timeIntegrators_.end(); ++_tiIt_) {
|
||||
(_tiIt_->second)->initialize();
|
||||
}
|
||||
atomicRegulator_->initialize();
|
||||
}
|
||||
extrinsicModelManager_.initialize();
|
||||
if (timeFilterManager_.need_reset()) { // reset kinetostat power
|
||||
init_filter();
|
||||
}
|
||||
// clears need for reset
|
||||
timeFilterManager_.initialize();
|
||||
ghostManager_.initialize();
|
||||
|
||||
if (!initialized_) {
|
||||
// initialize sources based on initial FE temperature
|
||||
double dt = lammpsInterface_->dt();
|
||||
prescribedDataMgr_->set_sources(time()+0.5*dt,sources_);
|
||||
extrinsicModelManager_.set_sources(fields_,extrinsicSources_);
|
||||
atomicRegulator_->compute_boundary_flux(fields_);
|
||||
compute_atomic_sources(fieldMask_,fields_,atomicSources_);
|
||||
|
||||
// read in field data if necessary
|
||||
if (useRestart_) {
|
||||
RESTART_LIST data;
|
||||
read_restart_data(restartFileName_,data);
|
||||
useRestart_ = false;
|
||||
}
|
||||
|
||||
// set consistent initial conditions, if requested
|
||||
if (!timeFilterManager_.filter_dynamics()) {
|
||||
if (consistentInitialization_) {
|
||||
|
||||
DENS_MAT & velocity(fields_[VELOCITY].set_quantity());
|
||||
DENS_MAN * nodalAtomicVelocity(interscaleManager_.dense_matrix("NodalAtomicVelocity"));
|
||||
const DENS_MAT & atomicVelocity(nodalAtomicVelocity->quantity());
|
||||
const INT_ARRAY & nodeType(nodalGeometryType_->quantity());
|
||||
for (int i = 0; i<nNodes_; ++i) {
|
||||
|
||||
if (nodeType(i,0)==MD_ONLY) {
|
||||
for (int j = 0; j < nsd_; j++) {
|
||||
velocity(i,j) = atomicVelocity(i,j);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (trackDisplacement_) {
|
||||
DENS_MAT & displacement(fields_[DISPLACEMENT].set_quantity());
|
||||
DENS_MAN * nodalAtomicDisplacement(interscaleManager_.dense_matrix("NodalAtomicDisplacement"));
|
||||
const DENS_MAT & atomicDisplacement(nodalAtomicDisplacement->quantity());
|
||||
for (int i = 0; i<nNodes_; ++i) {
|
||||
|
||||
if (nodeType(i,0)==MD_ONLY) {
|
||||
for (int j = 0; j < nsd_; j++) {
|
||||
displacement(i,j) = atomicDisplacement(i,j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
initialized_ = true;
|
||||
}
|
||||
|
||||
// reset integration field mask
|
||||
intrinsicMask_.reset(NUM_FIELDS,NUM_FLUX);
|
||||
intrinsicMask_ = false;
|
||||
@ -252,27 +181,7 @@ namespace ATC {
|
||||
interscaleManager_.add_dense_matrix(nodalAtomicDisplacement,
|
||||
"NodalAtomicDisplacement");
|
||||
}
|
||||
#ifdef OBSOLETE
|
||||
// atomic mass matrix data
|
||||
if (!useFeMdMassMatrix_) {
|
||||
// atomic momentum mass matrix
|
||||
FundamentalAtomQuantity * atomicMass = interscaleManager_.fundamental_atom_quantity(LammpsInterface::ATOM_MASS);
|
||||
nodalAtomicMass_ = new AtfShapeFunctionRestriction(this,
|
||||
atomicMass,
|
||||
shpFcn_);
|
||||
interscaleManager_.add_dense_matrix(nodalAtomicMass_,
|
||||
"AtomicMomentumMassMat");
|
||||
|
||||
// atomic dimensionless mass matrix
|
||||
ConstantQuantity<double> * atomicOnes = new ConstantQuantity<double>(this,1);
|
||||
interscaleManager_.add_per_atom_quantity(atomicOnes,"AtomicOnes");
|
||||
nodalAtomicCount_ = new AtfShapeFunctionRestriction(this,
|
||||
atomicOnes,
|
||||
shpFcn_);
|
||||
interscaleManager_.add_dense_matrix(nodalAtomicCount_,
|
||||
"AtomicDimensionlessMassMat");
|
||||
}
|
||||
#endif
|
||||
for (_tiIt_ = timeIntegrators_.begin(); _tiIt_ != timeIntegrators_.end(); ++_tiIt_) {
|
||||
(_tiIt_->second)->construct_transfers();
|
||||
}
|
||||
@ -293,24 +202,7 @@ namespace ATC {
|
||||
// nothing needed in other cases since kinetostat force is balanced by boundary flux in FE equations
|
||||
atomicRegulator_->reset_lambda_contribution(nodalAtomicFieldsRoc_[VELOCITY].quantity());
|
||||
}
|
||||
#ifdef OBSOLETE
|
||||
//---------------------------------------------------------
|
||||
// compute_md_mass_matrix
|
||||
// compute the mass matrix arising from only atomistic
|
||||
// quadrature and contributions as a summation
|
||||
//---------------------------------------------------------
|
||||
void ATC_CouplingMomentum::compute_md_mass_matrix(FieldName thisField,
|
||||
DIAG_MAT & massMat)
|
||||
{
|
||||
|
||||
|
||||
if (thisField == DISPLACEMENT || thisField == VELOCITY)
|
||||
massMat.reset(nodalAtomicMass_->quantity());
|
||||
else if (thisField == MASS_DENSITY) { // dimensionless mass matrix
|
||||
massMat.reset(nodalAtomicCount_->quantity());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//--------------------------------------------------------
|
||||
// modify
|
||||
// parses inputs and modifies state of the filter
|
||||
|
||||
@ -44,14 +44,6 @@ namespace ATC {
|
||||
/** pre time integration */
|
||||
virtual void initialize();
|
||||
|
||||
/** flags whether a methods reset is required */
|
||||
virtual bool reset_methods() const {
|
||||
bool resetMethods = ATC_Method::reset_methods() ||atomicRegulator_->need_reset();
|
||||
_ctiIt_ = timeIntegrators_.find(VELOCITY);
|
||||
if (_ctiIt_ == timeIntegrators_.end()) return resetMethods;
|
||||
return resetMethods || (_ctiIt_->second)->need_reset();
|
||||
};
|
||||
|
||||
/** pre/post atomic force calculation in minimize */
|
||||
virtual void min_pre_force();
|
||||
virtual void min_post_force();
|
||||
@ -76,17 +68,7 @@ namespace ATC {
|
||||
//virtual void construct_time_integration_data();
|
||||
/** set up data which is dependency managed */
|
||||
virtual void construct_transfers();
|
||||
#ifdef OBSOLETE
|
||||
/** compute the mass matrix components coming from MD integration */
|
||||
virtual void compute_md_mass_matrix(FieldName thisField,
|
||||
DIAG_MAT & massMats);
|
||||
//
|
||||
/** operator to compute the mass matrix for the momentum equation from MD integration */
|
||||
AtfShapeFunctionRestriction * nodalAtomicMass_;
|
||||
|
||||
/** operator to compute the dimensionless mass matrix from MD integration */
|
||||
AtfShapeFunctionRestriction * nodalAtomicCount_;
|
||||
#endif
|
||||
/** physics specific filter initialization */
|
||||
void init_filter();
|
||||
|
||||
|
||||
@ -31,11 +31,6 @@ namespace ATC {
|
||||
string matParamFile,
|
||||
ExtrinsicModelType extrinsicModel)
|
||||
: ATC_Coupling(groupName,perAtomArray,thisFix),
|
||||
#ifdef OBSOLETE
|
||||
nodalAtomicMass_(NULL),
|
||||
nodalAtomicCount_(NULL),
|
||||
nodalAtomicHeatCapacity_(NULL),
|
||||
#endif
|
||||
nodalAtomicKineticTemperature_(NULL),
|
||||
nodalAtomicConfigurationalTemperature_(NULL),
|
||||
refPE_(0)
|
||||
@ -82,9 +77,6 @@ namespace ATC {
|
||||
extVector_ = 1;
|
||||
if (extrinsicModel != NO_MODEL)
|
||||
sizeVector_ += extrinsicModelManager_.size_vector(sizeVector_);
|
||||
|
||||
// create PE per atom ccompute
|
||||
lammpsInterface_->create_compute_pe_peratom();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
@ -112,88 +104,6 @@ namespace ATC {
|
||||
// Base class initalizations
|
||||
ATC_Coupling::initialize();
|
||||
|
||||
// resetting precedence:
|
||||
// time integrator -> kinetostat/thermostat -> time filter
|
||||
// init_filter uses fieldRateNdFiltered which comes from the time integrator,
|
||||
// which is why the time integrator is initialized first
|
||||
|
||||
// other initializations
|
||||
#ifdef OBSOLETE
|
||||
|
||||
if (reset_methods()) {
|
||||
for (_tiIt_ = timeIntegrators_.begin(); _tiIt_ != timeIntegrators_.end(); ++_tiIt_) {
|
||||
(_tiIt_->second)->force_reset();
|
||||
}
|
||||
atomicRegulator_->force_reset();
|
||||
}
|
||||
#endif
|
||||
if (reset_methods()) {
|
||||
for (_tiIt_ = timeIntegrators_.begin(); _tiIt_ != timeIntegrators_.end(); ++_tiIt_) {
|
||||
(_tiIt_->second)->initialize();
|
||||
}
|
||||
atomicRegulator_->initialize();
|
||||
extrinsicModelManager_.initialize();
|
||||
}
|
||||
if (timeFilterManager_.need_reset()) {// reset thermostat power
|
||||
init_filter();
|
||||
}
|
||||
// clears need for reset
|
||||
timeFilterManager_.initialize();
|
||||
ghostManager_.initialize();
|
||||
|
||||
if (!initialized_) {
|
||||
// initialize sources based on initial FE temperature
|
||||
double dt = lammpsInterface_->dt();
|
||||
prescribedDataMgr_->set_sources(time()+0.5*dt,sources_);
|
||||
extrinsicModelManager_.set_sources(fields_,extrinsicSources_);
|
||||
atomicRegulator_->compute_boundary_flux(fields_);
|
||||
compute_atomic_sources(fieldMask_,fields_,atomicSources_);
|
||||
|
||||
// read in field data if necessary
|
||||
if (useRestart_) {
|
||||
RESTART_LIST data;
|
||||
read_restart_data(restartFileName_,data);
|
||||
useRestart_ = false;
|
||||
}
|
||||
|
||||
// set consistent initial conditions, if requested
|
||||
if (!timeFilterManager_.filter_dynamics()) {
|
||||
if (consistentInitialization_) {
|
||||
|
||||
DENS_MAT & velocity(fields_[VELOCITY].set_quantity());
|
||||
DENS_MAN * nodalAtomicVelocity(interscaleManager_.dense_matrix("NodalAtomicVelocity"));
|
||||
const DENS_MAT & atomicVelocity(nodalAtomicVelocity->quantity());
|
||||
DENS_MAT & temperature(fields_[TEMPERATURE].set_quantity());
|
||||
DENS_MAN * nodalAtomicTemperature(interscaleManager_.dense_matrix("NodalAtomicTemperature"));
|
||||
const DENS_MAT & atomicTemperature(nodalAtomicTemperature->quantity());
|
||||
const INT_ARRAY & nodeType(nodalGeometryType_->quantity());
|
||||
for (int i = 0; i<nNodes_; ++i) {
|
||||
|
||||
if (nodeType(i,0)==MD_ONLY) {
|
||||
for (int j = 0; j < nsd_; j++) {
|
||||
velocity(i,j) = atomicVelocity(i,j);
|
||||
}
|
||||
temperature(i,0) = atomicTemperature(i,0);
|
||||
}
|
||||
}
|
||||
if (trackDisplacement_) {
|
||||
DENS_MAT & displacement(fields_[DISPLACEMENT].set_quantity());
|
||||
DENS_MAN * nodalAtomicDisplacement(interscaleManager_.dense_matrix("NodalAtomicDisplacement"));
|
||||
const DENS_MAT & atomicDisplacement(nodalAtomicDisplacement->quantity());
|
||||
for (int i = 0; i<nNodes_; ++i) {
|
||||
|
||||
if (nodeType(i,0)==MD_ONLY) {
|
||||
for (int j = 0; j < nsd_; j++) {
|
||||
displacement(i,j) = atomicDisplacement(i,j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
initialized_ = true;
|
||||
}
|
||||
|
||||
// reset integration field mask
|
||||
intrinsicMask_.reset(NUM_FIELDS,NUM_FLUX);
|
||||
intrinsicMask_ = false;
|
||||
@ -368,38 +278,7 @@ namespace ATC {
|
||||
TEMPERATURE);
|
||||
interscaleManager_.add_dense_matrix(nodalAtomicTemperature,
|
||||
"NodalAtomicTemperature");
|
||||
#ifdef OBSOLETE
|
||||
if (!useFeMdMassMatrix_) {
|
||||
// atomic momentum mass matrix
|
||||
FundamentalAtomQuantity * atomicMass = interscaleManager_.fundamental_atom_quantity(LammpsInterface::ATOM_MASS);
|
||||
nodalAtomicMass_ = new AtfShapeFunctionRestriction(this,
|
||||
atomicMass,
|
||||
shpFcn_);
|
||||
interscaleManager_.add_dense_matrix(nodalAtomicMass_,
|
||||
"AtomicMomentumMassMat");
|
||||
|
||||
// atomic dimensionless mass matrix
|
||||
ConstantQuantity<double> * atomicOnes = new ConstantQuantity<double>(this,1);
|
||||
interscaleManager_.add_per_atom_quantity(atomicOnes,"AtomicOnes");
|
||||
nodalAtomicCount_ = new AtfShapeFunctionRestriction(this,
|
||||
atomicOnes,
|
||||
shpFcn_);
|
||||
interscaleManager_.add_dense_matrix(nodalAtomicCount_,
|
||||
"AtomicDimensionlessMassMat");
|
||||
|
||||
// classical thermodynamic heat capacity of the atoms
|
||||
HeatCapacity * heatCapacity = new HeatCapacity(this);
|
||||
interscaleManager_.add_per_atom_quantity(heatCapacity,
|
||||
"AtomicHeatCapacity");
|
||||
|
||||
// atomic thermal mass matrix
|
||||
nodalAtomicHeatCapacity_ = new AtfShapeFunctionRestriction(this,
|
||||
heatCapacity,
|
||||
shpFcn_);
|
||||
interscaleManager_.add_dense_matrix(nodalAtomicHeatCapacity_,
|
||||
"NodalAtomicHeatCapacity");
|
||||
}
|
||||
#endif
|
||||
for (_tiIt_ = timeIntegrators_.begin(); _tiIt_ != timeIntegrators_.end(); ++_tiIt_) {
|
||||
(_tiIt_->second)->construct_transfers();
|
||||
}
|
||||
@ -431,28 +310,7 @@ namespace ATC {
|
||||
atomicRegulator_->reset_lambda_contribution(powerMat,TEMPERATURE);
|
||||
}
|
||||
}
|
||||
#ifdef OBSOLETE
|
||||
//---------------------------------------------------------
|
||||
// compute_md_mass_matrix
|
||||
// compute the mass matrix arising from only atomistic
|
||||
// quadrature and contributions as a summation
|
||||
//---------------------------------------------------------
|
||||
void ATC_CouplingMomentumEnergy::compute_md_mass_matrix(FieldName thisField,
|
||||
DIAG_MAT & massMat)
|
||||
{
|
||||
|
||||
|
||||
if (thisField == DISPLACEMENT || thisField == VELOCITY) {
|
||||
massMat.reset(nodalAtomicMass_->quantity());
|
||||
}
|
||||
else if (thisField == MASS_DENSITY) { // dimensionless mass matrix
|
||||
massMat.reset(nodalAtomicCount_->quantity());
|
||||
}
|
||||
else if (thisField == TEMPERATURE) {
|
||||
massMat.reset(nodalAtomicHeatCapacity_->quantity());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//--------------------------------------------------------
|
||||
// modify
|
||||
// parses inputs and modifies state of the filter
|
||||
|
||||
@ -42,16 +42,6 @@ namespace ATC {
|
||||
/** pre time integration */
|
||||
virtual void initialize();
|
||||
|
||||
/** flags whether a methods reset is required */
|
||||
|
||||
virtual bool reset_methods() const {
|
||||
bool resetMethods = ATC_Method::reset_methods() || atomicRegulator_->need_reset();
|
||||
for (_ctiIt_ = timeIntegrators_.begin(); _ctiIt_ != timeIntegrators_.end(); ++_ctiIt_) {
|
||||
resetMethods |= (_ctiIt_->second)->need_reset();
|
||||
}
|
||||
return resetMethods;
|
||||
};
|
||||
|
||||
/** compute scalar for output - added energy */
|
||||
virtual double compute_scalar(void);
|
||||
|
||||
@ -72,20 +62,7 @@ namespace ATC {
|
||||
//virtual void construct_time_integration_data();
|
||||
/** set up data which is dependency managed */
|
||||
virtual void construct_transfers();
|
||||
#ifdef OBSOLETE
|
||||
/** compute the mass matrix components coming from MD integration */
|
||||
virtual void compute_md_mass_matrix(FieldName thisField,
|
||||
DIAG_MAT & massMats);
|
||||
//
|
||||
/** operator to compute the mass matrix for the momentum equation from MD integration */
|
||||
AtfShapeFunctionRestriction * nodalAtomicMass_;
|
||||
|
||||
/** operator to compute the dimensionless mass matrix from MD integration */
|
||||
AtfShapeFunctionRestriction * nodalAtomicCount_;
|
||||
|
||||
/** operator to compute mass matrix from MD */
|
||||
AtfShapeFunctionRestriction * nodalAtomicHeatCapacity_;
|
||||
#endif
|
||||
/** physics specific filter initialization */
|
||||
void init_filter();
|
||||
/** kinetic temperature for post-processing */
|
||||
|
||||
@ -699,6 +699,8 @@ pecified
|
||||
<TT> fix_modify AtC internal_atom_integrate on </TT>
|
||||
\section description
|
||||
Has AtC perform time integration for the atoms in the group on which it operates. This does not include boundary atoms.
|
||||
\section restrictions
|
||||
AtC must be created before any fixes doing time integration. It must be on for coupling methods which impose constraints on velocities during the first verlet step, e.g. control momentum glc_velocity.
|
||||
\section default
|
||||
on for coupling methods, off for post-processors
|
||||
off
|
||||
@ -1503,16 +1505,17 @@ pecified
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------
|
||||
void ATC_Method::init_integrate_velocity()
|
||||
void ATC_Method::init_integrate()
|
||||
{
|
||||
atomTimeIntegrator_->init_integrate_velocity(dt());
|
||||
ghostManager_.init_integrate_velocity(dt());
|
||||
}
|
||||
//--------------------------------------------------------
|
||||
void ATC_Method::init_integrate_position()
|
||||
{
|
||||
// account for other fixes doing time integration
|
||||
interscaleManager_.fundamental_force_reset(LammpsInterface::ATOM_VELOCITY);
|
||||
|
||||
atomTimeIntegrator_->init_integrate_position(dt());
|
||||
ghostManager_.init_integrate_position(dt());
|
||||
// account for other fixes doing time integration
|
||||
interscaleManager_.fundamental_force_reset(LammpsInterface::ATOM_POSITION);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
void ATC_Method::post_init_integrate()
|
||||
@ -1564,6 +1567,8 @@ pecified
|
||||
{
|
||||
atomTimeIntegrator_->final_integrate(dt());
|
||||
ghostManager_.final_integrate(dt());
|
||||
// account for other fixes doing time integration
|
||||
interscaleManager_.fundamental_force_reset(LammpsInterface::ATOM_VELOCITY);
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
void ATC_Method::post_final_integrate()
|
||||
@ -1577,7 +1582,6 @@ pecified
|
||||
{
|
||||
localStep_ += 1;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
void ATC_Method::finish()
|
||||
{
|
||||
|
||||
@ -68,14 +68,8 @@ namespace ATC {
|
||||
update_step();
|
||||
};
|
||||
|
||||
/** Predictor phase, Verlet first step for velocity */
|
||||
virtual void init_integrate_velocity();
|
||||
|
||||
/** Predictor phase, executed between velocity and position Verlet */
|
||||
virtual void mid_init_integrate(){};
|
||||
|
||||
/** Predictor phase, Verlet first step for position */
|
||||
virtual void init_integrate_position();
|
||||
/** Predictor phase, Verlet first step for velocity and position */
|
||||
virtual void init_integrate();
|
||||
|
||||
/** Predictor phase, executed after Verlet */
|
||||
virtual void post_init_integrate();
|
||||
|
||||
@ -911,6 +911,8 @@ namespace ATC {
|
||||
if ( output_now() && !outputStepZero_ ) output();
|
||||
outputStepZero_ = false;
|
||||
|
||||
//ATC_Method::post_final_integrate();
|
||||
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@ -46,7 +46,6 @@ class ATC_Transfer : public ATC_Method {
|
||||
|
||||
/** second time substep routine */
|
||||
virtual void pre_final_integrate();
|
||||
//virtual void final_integrate(){};
|
||||
virtual void post_final_integrate();
|
||||
|
||||
/** communication routines */
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
|
||||
namespace ATC
|
||||
{
|
||||
class LAMMPS_NS::PairEAM; // necessary for non-lib build of ATC (vs USER-ATC)
|
||||
|
||||
/**
|
||||
* @class CbEam
|
||||
|
||||
@ -562,7 +562,7 @@ Tv(0) = 300.;
|
||||
int ConcentrationRegulatorMethodTransition::pick_element() const
|
||||
{
|
||||
double r = uniform();
|
||||
ESET::iterator itr = elemset_.begin(); // global?
|
||||
ESET::const_iterator itr = elemset_.begin(); // global?
|
||||
for (int i = 0; i < volumes_.size() ; ++i) {
|
||||
if (r < volumes_(i)) return *itr;
|
||||
itr++;
|
||||
|
||||
@ -230,10 +230,10 @@ namespace ATC {
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
// mid_initial_integrate1
|
||||
// time integration at the mid-point of Verlet step 1
|
||||
// pre_initial_integrate1
|
||||
// time integration before Verlet step 1
|
||||
//--------------------------------------------------------
|
||||
void ElasticTimeIntegratorVerlet::mid_initial_integrate1(double dt)
|
||||
void ElasticTimeIntegratorVerlet::pre_initial_integrate1(double dt)
|
||||
{
|
||||
explicit_1(velocity_.set_quantity(),acceleration_.quantity(),.5*dt);
|
||||
}
|
||||
@ -334,10 +334,10 @@ namespace ATC {
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
// mid_initial_integrate1
|
||||
// time integration at the mid-point of Verlet step 1
|
||||
// pre_initial_integrate1
|
||||
// time integration before Verlet step 1
|
||||
//--------------------------------------------------------
|
||||
void ElasticTimeIntegratorVerletFiltered::mid_initial_integrate1(double dt)
|
||||
void ElasticTimeIntegratorVerletFiltered::pre_initial_integrate1(double dt)
|
||||
{
|
||||
explicit_1(velocity_.set_quantity(),acceleration_.quantity(),.5*dt);
|
||||
explicit_1(nodalAtomicVelocityOut_.set_quantity(),nodalAtomicAcceleration_.quantity(),.5*dt);
|
||||
@ -497,11 +497,10 @@ namespace ATC {
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
// mid_initial_integrate1
|
||||
// time integration between the velocity and position
|
||||
// updates in Verlet step 1
|
||||
// post_initial_integrate1
|
||||
// time integration after Verlet step 1
|
||||
//--------------------------------------------------------
|
||||
void ElasticTimeIntegratorFractionalStep::mid_initial_integrate1(double dt)
|
||||
void ElasticTimeIntegratorFractionalStep::post_initial_integrate1(double dt)
|
||||
{
|
||||
// atomic contributions to change in momentum
|
||||
// compute change in restricted atomic momentum
|
||||
@ -531,16 +530,9 @@ namespace ATC {
|
||||
nodalAtomicVelocityOld_,
|
||||
VELOCITY);
|
||||
nodalAtomicMomentumOld_ = nodalAtomicMomentum;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
// post_initial_integrate1
|
||||
// time integration after Verlet step 1
|
||||
//--------------------------------------------------------
|
||||
void ElasticTimeIntegratorFractionalStep::post_initial_integrate1(double dt)
|
||||
{
|
||||
// get nodal momentum for second part of force update
|
||||
nodalAtomicForce_ = nodalAtomicMomentum_->quantity();
|
||||
nodalAtomicForce_ = nodalAtomicMomentum;
|
||||
nodalAtomicForce_ *= -1.;
|
||||
|
||||
// update nodal displacements
|
||||
|
||||
@ -131,8 +131,8 @@ namespace ATC {
|
||||
virtual void initialize();
|
||||
|
||||
// time step methods, corresponding to ATC_Transfer
|
||||
/** first part of mid_initial_integrate */
|
||||
virtual void mid_initial_integrate1(double dt);
|
||||
/** first part of pre_initial_integrate */
|
||||
virtual void pre_initial_integrate1(double dt);
|
||||
/** first part of post_initial_integrate */
|
||||
virtual void post_initial_integrate1(double dt);
|
||||
/** first part of pre_final_integrate */
|
||||
@ -190,8 +190,8 @@ namespace ATC {
|
||||
virtual ~ElasticTimeIntegratorVerletFiltered(){};
|
||||
|
||||
// time step methods, corresponding to ATC_Transfer
|
||||
/** first part of mid_initial_integrate */
|
||||
virtual void mid_initial_integrate1(double dt);
|
||||
/** first part of pre_initial_integrate */
|
||||
virtual void pre_initial_integrate1(double dt);
|
||||
/** first part of post_initial_integrate */
|
||||
virtual void post_initial_integrate1(double dt);
|
||||
/** second part of post_final_integrate */
|
||||
@ -243,10 +243,9 @@ namespace ATC {
|
||||
// time step methods, corresponding to ATC_Transfer
|
||||
/** first part of pre_initial_integrate */
|
||||
virtual void pre_initial_integrate1(double dt);
|
||||
/** second part of mid_initial_integrate */
|
||||
/** second part of pre_initial_integrate */
|
||||
virtual void pre_initial_integrate2(double dt);
|
||||
/** first part of mid_initial_integrate */
|
||||
virtual void mid_initial_integrate1(double dt);
|
||||
|
||||
/** first part of post_initial_integrate */
|
||||
virtual void post_initial_integrate1(double dt);
|
||||
/** second part of post_final_integrate */
|
||||
|
||||
@ -233,23 +233,6 @@ namespace ATC {
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
// mid_init_integrate
|
||||
//--------------------------------------------------------
|
||||
void ExtrinsicModelManager::mid_init_integrate(ExtrinsicModelType modelType)
|
||||
{
|
||||
vector<ExtrinsicModel *>::iterator imodel;
|
||||
if (modelType == NUM_MODELS) {// execute all the models
|
||||
for(imodel=extrinsicModels_.begin(); imodel!=extrinsicModels_.end(); imodel++)
|
||||
(*imodel)->mid_init_integrate();
|
||||
}
|
||||
else { // execute only requested type of model
|
||||
for(imodel=extrinsicModels_.begin(); imodel!=extrinsicModels_.end(); imodel++)
|
||||
if ((*imodel)->model_type() == modelType)
|
||||
(*imodel)->mid_init_integrate();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
// post_init_integrate
|
||||
//--------------------------------------------------------
|
||||
|
||||
@ -77,8 +77,7 @@ namespace ATC {
|
||||
// calls during LAMMPS Velocity-Verlet integration
|
||||
/** Predictor phase, executed before Verlet */
|
||||
void pre_init_integrate(ExtrinsicModelType modelType = NUM_MODELS);
|
||||
/** Predictor phase, executed between velocity and position Verlet */
|
||||
void mid_init_integrate(ExtrinsicModelType modelType = NUM_MODELS);
|
||||
|
||||
/** Predictor phase, executed after Verlet */
|
||||
void post_init_integrate(ExtrinsicModelType modelType = NUM_MODELS);
|
||||
|
||||
@ -244,9 +243,6 @@ namespace ATC {
|
||||
/** Predictor phase, executed before Verlet */
|
||||
virtual void pre_init_integrate(){};
|
||||
|
||||
/** Predictor phase, executed between velocity and position Verlet */
|
||||
virtual void mid_init_integrate(){};
|
||||
|
||||
/** Predictor phase, executed after Verlet */
|
||||
virtual void post_init_integrate(){};
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ namespace ATC{
|
||||
// now do all FE_Engine data structure partitioning
|
||||
|
||||
// partition nullElements_
|
||||
/*for (vector<int>::iterator elemsIter = feMesh_->processor_elts().begin();
|
||||
/*for (vector<int>::const_iterator elemsIter = feMesh_->processor_elts().begin();
|
||||
elemsIter != feMesh_->processor_elts().end();
|
||||
++elemsIter)
|
||||
{
|
||||
@ -550,7 +550,7 @@ namespace ATC{
|
||||
DENS_MAT elementMassMatrix(nNodesPerElement_,nNodesPerElement_);
|
||||
|
||||
vector<int> myElems = feMesh_->owned_elts();
|
||||
for (vector<int>::iterator elemsIter = myElems.begin();
|
||||
for (vector<int>::const_iterator elemsIter = myElems.begin();
|
||||
elemsIter != myElems.end();
|
||||
++elemsIter)
|
||||
{
|
||||
@ -604,7 +604,7 @@ namespace ATC{
|
||||
DENS_MAT coefsAtIPs;
|
||||
|
||||
vector<int> myElems = feMesh_->owned_elts();
|
||||
for (vector<int>::iterator elemsIter = myElems.begin();
|
||||
for (vector<int>::const_iterator elemsIter = myElems.begin();
|
||||
elemsIter != myElems.end();
|
||||
++elemsIter)
|
||||
{
|
||||
@ -782,7 +782,7 @@ namespace ATC{
|
||||
|
||||
// element wise assembly
|
||||
vector<int> myElems = feMesh_->owned_elts();
|
||||
for (vector<int>::iterator elemsIter = myElems.begin();
|
||||
for (vector<int>::const_iterator elemsIter = myElems.begin();
|
||||
elemsIter != myElems.end();
|
||||
++elemsIter)
|
||||
{
|
||||
@ -849,7 +849,7 @@ namespace ATC{
|
||||
massMatrix.reset(nNodesUnique_,nNodesUnique_);// zero since partial fill
|
||||
DENS_MAT elementMassMatrix(nNodesPerElement_,nNodesPerElement_);
|
||||
vector<int> myElems = feMesh_->owned_elts();
|
||||
for (vector<int>::iterator elemsIter = myElems.begin();
|
||||
for (vector<int>::const_iterator elemsIter = myElems.begin();
|
||||
elemsIter != myElems.end();
|
||||
++elemsIter)
|
||||
{
|
||||
@ -905,7 +905,7 @@ namespace ATC{
|
||||
// assemble lumped diagonal mass
|
||||
DENS_VEC Nvec(nNodesPerElement_);
|
||||
vector<int> myElems = feMesh_->owned_elts();
|
||||
for (vector<int>::iterator elemsIter = myElems.begin();
|
||||
for (vector<int>::const_iterator elemsIter = myElems.begin();
|
||||
elemsIter != myElems.end();
|
||||
++elemsIter)
|
||||
{
|
||||
@ -944,7 +944,7 @@ namespace ATC{
|
||||
}
|
||||
// assemble diagonal matrix
|
||||
vector<int> myElems = feMesh_->owned_elts();
|
||||
for (vector<int>::iterator elemsIter = myElems.begin();
|
||||
for (vector<int>::const_iterator elemsIter = myElems.begin();
|
||||
elemsIter != myElems.end();
|
||||
++elemsIter)
|
||||
{
|
||||
@ -1143,7 +1143,7 @@ namespace ATC{
|
||||
Array<int> count(nNodesUnique_); count = 0;
|
||||
set_quadrature(NODAL);
|
||||
vector<int> myElems = feMesh_->owned_elts();
|
||||
for (vector<int>::iterator elemsIter = myElems.begin();
|
||||
for (vector<int>::const_iterator elemsIter = myElems.begin();
|
||||
elemsIter != myElems.end();
|
||||
++elemsIter)
|
||||
{
|
||||
@ -1204,7 +1204,7 @@ namespace ATC{
|
||||
|
||||
DENS_MAT elementEnergy(nNodesPerElement_,1); // workspace
|
||||
vector<int> myElems = feMesh_->owned_elts();
|
||||
for (vector<int>::iterator elemsIter = myElems.begin();
|
||||
for (vector<int>::const_iterator elemsIter = myElems.begin();
|
||||
elemsIter != myElems.end();
|
||||
++elemsIter)
|
||||
{
|
||||
@ -1269,7 +1269,7 @@ namespace ATC{
|
||||
|
||||
// Iterate over elements partitioned onto current processor.
|
||||
vector<int> myElems = feMesh_->owned_elts();
|
||||
for (vector<int>::iterator elemsIter = myElems.begin();
|
||||
for (vector<int>::const_iterator elemsIter = myElems.begin();
|
||||
elemsIter != myElems.end();
|
||||
++elemsIter)
|
||||
{
|
||||
@ -1337,7 +1337,7 @@ namespace ATC{
|
||||
}
|
||||
}
|
||||
|
||||
vector<FieldName>::iterator _fieldIter_;
|
||||
vector<FieldName>::const_iterator _fieldIter_;
|
||||
for (_fieldIter_ = usedFields.begin(); _fieldIter_ != usedFields.end();
|
||||
++_fieldIter_) {
|
||||
// myRhs is where we put the global result for this field.
|
||||
@ -1660,7 +1660,7 @@ namespace ATC{
|
||||
|
||||
// element wise assembly
|
||||
vector<int> myElems = feMesh_->owned_elts();
|
||||
for (vector<int>::iterator elemsIter = myElems.begin();
|
||||
for (vector<int>::const_iterator elemsIter = myElems.begin();
|
||||
elemsIter != myElems.end();
|
||||
++elemsIter)
|
||||
{
|
||||
@ -1740,7 +1740,7 @@ namespace ATC{
|
||||
}
|
||||
|
||||
// element wise assembly
|
||||
set< PAIR >::iterator iter;
|
||||
set< PAIR >::const_iterator iter;
|
||||
for (iter = faceSet.begin(); iter != faceSet.end(); iter++) {
|
||||
// get connectivity
|
||||
int ielem = iter->first;
|
||||
@ -2214,7 +2214,7 @@ namespace ATC{
|
||||
}
|
||||
|
||||
vector<int> myElems = feMesh_->owned_elts();
|
||||
for (vector<int>::iterator elemsIter = myElems.begin();
|
||||
for (vector<int>::const_iterator elemsIter = myElems.begin();
|
||||
elemsIter != myElems.end();
|
||||
++elemsIter)
|
||||
{
|
||||
@ -2291,7 +2291,7 @@ namespace ATC{
|
||||
// the data member?
|
||||
|
||||
// element wise assembly
|
||||
set< pair <int,int> >::iterator iter;
|
||||
set< pair <int,int> >::const_iterator iter;
|
||||
for (iter = faceSet.begin(); iter != faceSet.end(); iter++) {
|
||||
int ielem = iter->first;
|
||||
// if this is not our element, do not do calculations
|
||||
|
||||
@ -1432,7 +1432,8 @@ namespace ATC {
|
||||
|
||||
int FE_Mesh::map_elem_to_myElem(int elemID) const
|
||||
{
|
||||
return elemToMyElemMap_.at(elemID);
|
||||
|
||||
return elemToMyElemMap_.find(elemID)->second;
|
||||
}
|
||||
|
||||
int FE_Mesh::map_myElem_to_elem(int myElemID) const
|
||||
|
||||
@ -507,14 +507,22 @@ namespace ATC{
|
||||
//--------------------------------------------------------
|
||||
// computes_force_reset
|
||||
//--------------------------------------------------------
|
||||
void InterscaleManager::lammps_force_reset()
|
||||
void InterscaleManager::fundamental_force_reset(unsigned quantity)
|
||||
{
|
||||
for (unsigned int i = 0; i < NUM_ATOM_TYPES; i++) {
|
||||
if (fundamentalAtomQuantities_[i][quantity]) {
|
||||
fundamentalAtomQuantities_[i][quantity]->lammps_force_reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
// computes_force_reset
|
||||
//--------------------------------------------------------
|
||||
void InterscaleManager::lammps_force_reset()
|
||||
{
|
||||
for (unsigned int j = 0; j < LammpsInterface::NUM_FUNDAMENTAL_ATOM_QUANTITIES; j++) {
|
||||
if (fundamentalAtomQuantities_[i][j]) {
|
||||
fundamentalAtomQuantities_[i][j]->lammps_force_reset();
|
||||
}
|
||||
}
|
||||
fundamental_force_reset(j);
|
||||
}
|
||||
lammps_reset_loop(perAtomQuantities_);
|
||||
lammps_reset_loop(perAtomIntQuantities_);
|
||||
|
||||
@ -161,6 +161,9 @@ namespace ATC {
|
||||
/** resets nlocal count of managed atomic quantities which do not perform parallel exchange */
|
||||
void reset_nlocal();
|
||||
|
||||
/** resets specific lammps fundamental quantities data, as needed, to account for times when lammps can change quantities */
|
||||
void fundamental_force_reset(unsigned quantity);
|
||||
|
||||
/** resets all lammps data, as needed, to account for times when lammps can change quantities */
|
||||
void lammps_force_reset();
|
||||
|
||||
|
||||
@ -1129,7 +1129,7 @@ namespace ATC {
|
||||
// apply the kinetostat to the atoms in the
|
||||
// mid-predictor integration phase
|
||||
//--------------------------------------------------------
|
||||
void StressFlux::apply_mid_predictor(double dt)
|
||||
void StressFlux::apply_pre_predictor(double dt)
|
||||
{
|
||||
double dtLambda = 0.5*dt;
|
||||
// apply lambda force to atoms
|
||||
|
||||
@ -389,8 +389,8 @@ namespace ATC {
|
||||
/** instantiate all needed data */
|
||||
virtual void construct_transfers();
|
||||
|
||||
/** applies kinetostat to atoms in the mid-predictor phase */
|
||||
virtual void apply_mid_predictor(double dt);
|
||||
/** applies kinetostat to atoms in the pre-predictor phase */
|
||||
virtual void apply_pre_predictor(double dt);
|
||||
|
||||
/** applies kinetostat to atoms in the post-corrector phase */
|
||||
virtual void apply_post_corrector(double dt);
|
||||
|
||||
@ -84,7 +84,7 @@ namespace ATC {
|
||||
DENS_MAN & massDensity_;
|
||||
|
||||
/** atomic nodal mass density field */
|
||||
// OBOLETE?
|
||||
// OBSOLETE?
|
||||
DENS_MAN & nodalAtomicMassDensityOut_;
|
||||
DENS_MAN * nodalAtomicMassDensity_;
|
||||
|
||||
|
||||
@ -148,26 +148,6 @@ namespace ATC {
|
||||
timeIntegrationMethod_->pre_initial_integrate2(dt);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
// mid_initial_integrate1
|
||||
// first time integration computations
|
||||
// at the mid-point of Verlet step 1
|
||||
//--------------------------------------------------------
|
||||
void TimeIntegrator::mid_initial_integrate1(double dt)
|
||||
{
|
||||
timeIntegrationMethod_->mid_initial_integrate1(dt);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
// mid_initial_integrate2
|
||||
// second time integration computations
|
||||
// at the mid-point of Verlet step 1
|
||||
//--------------------------------------------------------
|
||||
void TimeIntegrator::mid_initial_integrate2(double dt)
|
||||
{
|
||||
timeIntegrationMethod_->mid_initial_integrate2(dt);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
// post_initial_integrate1
|
||||
// first time integration computations
|
||||
|
||||
@ -146,11 +146,6 @@ namespace ATC {
|
||||
/** second part of pre_initial_integrate */
|
||||
virtual void pre_initial_integrate2(double dt);
|
||||
|
||||
/** first part of mid_initial_integrate */
|
||||
virtual void mid_initial_integrate1(double dt);
|
||||
/** second part of mid_initial_integrate */
|
||||
virtual void mid_initial_integrate2(double dt);
|
||||
|
||||
/** first part of post_initial_integrate */
|
||||
virtual void post_initial_integrate1(double dt);
|
||||
/** second part of post_initial_integrate */
|
||||
@ -258,11 +253,6 @@ namespace ATC {
|
||||
/** second part of pre_initial_integrate */
|
||||
virtual void pre_initial_integrate2(double dt){};
|
||||
|
||||
/** first part of mid_initial_integrate */
|
||||
virtual void mid_initial_integrate1(double dt){};
|
||||
/** second part of mid_initial_integrate */
|
||||
virtual void mid_initial_integrate2(double dt){};
|
||||
|
||||
/** first part of post_initial_integrate */
|
||||
virtual void post_initial_integrate1(double dt){};
|
||||
/** second part of post_initial_integrate */
|
||||
|
||||
Reference in New Issue
Block a user