Updating file locations to master locations

This commit is contained in:
Sievers
2021-10-28 16:32:04 -07:00
7293 changed files with 294814 additions and 148810 deletions

32
src/.clang-format Normal file
View File

@ -0,0 +1,32 @@
---
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -1
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: false
AllowShortBlocksOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLambdasOnASingleLine: None
AllowShortLoopsOnASingleLine: true
BraceWrapping:
AfterFunction: true
BreakBeforeBraces: Custom
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
ColumnLimit: 100
IndentCaseLabels: true
IndentWidth: 2
NamespaceIndentation: Inner
ObjCBlockIndentWidth: 2
PenaltyBreakAssignment: 4
ReflowComments: false
SpaceAfterCStyleCast: true
SpacesBeforeTrailingComments: 4
SpacesInContainerLiterals: false
Standard: Cpp11
TabWidth: 2
UseTab: Never
...

243
src/.gitignore vendored
View File

@ -27,6 +27,21 @@
/*_ssa.h
/*_ssa.cpp
!accelerator_kokkos.h
!accelerator_omp.h
/fix_mdi_engine.cpp
/fix_mdi_engine.h
/library_mdi.cpp
/library_mdi.h
/mdi_engine.cpp
/mdi_engine.h
/fix_brownian*.cpp
/fix_brownian*.h
/fix_propel_self.cpp
/fix_propel_self.h
/kim_*.cpp
/kim_*.h
/pair_kim.cpp
@ -35,6 +50,13 @@
/pair_pace.cpp
/pair_pace.h
/fix_polarize*.cpp
/fix_polarize*.h
/*_dielectric.cpp
/*_dielectric.h
/compute_efield_atom.cpp
/compute_efield_atom.h
/superpose3d.h
/kokkos.cpp
@ -51,13 +73,14 @@
/meam*.h
/meam*.cpp
/pair_meamc.cpp
/pair_meamc.h
/pair_meam.cpp
/pair_meam.h
/compute_mliap.cpp
/compute_mliap.h
/mliap_*.cpp
/mliap_*.h
/mliap_model_python_couple.pyx
/pair_mliap.cpp
/pair_mliap.h
@ -75,6 +98,11 @@
/fix_pafi*.cpp
/fix_pafi*.h
/pair_rann.cpp
/pair_rann.h
/rann_*.cpp
/rann_*.h
/compute_test_nbl.cpp
/compute_test_nbl.h
/pair_multi_lucy.cpp
@ -177,7 +205,6 @@
/plugin.cpp
/plugin.h
/lammpsplugin.h
/atom_vec_spin.cpp
/atom_vec_spin.h
@ -226,6 +253,66 @@
/pair_mesont_tpm.cpp
/pair_mesont_tpm.h
/compute_adf.cpp
/compute_adf.h
/compute_contact_atom.cpp
/compute_contact_atom.h
/compute_hexorder_atom.cpp
/compute_hexorder_atom.h
/dump_dcd.cpp
/dump_dcd.h
/fix_controller.cpp
/fix_controller.h
/fix_drag.cpp
/fix_drag.h
/fix_numdiff.cpp
/fix_numdiff.h
/fix_spring_rg.cpp
/fix_spring_rg.h
/fix_temp_csld.cpp
/fix_temp_csld.h
/fix_temp_csvr.cpp
/fix_temp_csvr.h
/fix_tmd.cpp
/fix_tmd.h
/pair_beck.cpp
/pair_beck.h
/pair_born_coul_dsf.cpp
/pair_born_coul_dsf.h
/pair_born_coul_wolf.cpp
/pair_born_coul_wolf.h
/pair_coul_cut_global.cpp
/pair_coul_cut_global.h
/pair_coul_streitz.cpp
/pair_coul_streitz.h
/pair_gauss.cpp
/pair_gauss.h
/pair_lj96_cut.cpp
/pair_lj96_cut.h
/pair_lj_cubic.cpp
/pair_lj_cubic.h
/pair_lj_cubic_const.h
/pair_lj_cut_coul_debye.cpp
/pair_lj_cut_coul_debye.h
/pair_lj_cut_coul_dsf.cpp
/pair_lj_cut_coul_dsf.h
/pair_lj_cut_coul_wolf.cpp
/pair_lj_cut_coul_wolf.h
/pair_lj_gromacs.cpp
/pair_lj_gromacs.h
/pair_lj_gromacs_coul_gromacs.cpp
/pair_lj_gromacs_coul_gromacs.h
/pair_lj_relres.cpp
/pair_lj_relres.h
/pair_lj_smooth.cpp
/pair_lj_smooth.h
/pair_lj_smooth_linear.cpp
/pair_lj_smooth_linear.h
/pair_mie_cut.cpp
/pair_mie_cut.h
/pair_ufm.cpp
/pair_ufm.h
/angle_cg_cmm.cpp
/angle_cg_cmm.h
/angle_charmm.cpp
@ -280,8 +367,6 @@
/atom_vec_dpd.h
/atom_vec_electron.cpp
/atom_vec_electron.h
/atom_vec_ellipsoid.cpp
/atom_vec_ellipsoid.h
/atom_vec_full.cpp
/atom_vec_full.h
/atom_vec_full_hars.cpp
@ -290,6 +375,8 @@
/atom_vec_granular.h
/atom_vec_molecular.cpp
/atom_vec_molecular.h
/atom_vec_oxdna.cpp
/atom_vec_oxdna.h
/atom_vec_peri.cpp
/atom_vec_peri.h
/atom_vec_template.cpp
@ -362,6 +449,8 @@
/compute_erotate_rigid.h
/compute_event_displace.cpp
/compute_event_displace.h
/compute_fabric.cpp
/compute_fabric.h
/compute_fep.cpp
/compute_fep.h
/compute_force_tally.cpp
@ -444,8 +533,6 @@
/dihedral_harmonic.h
/dihedral_helix.cpp
/dihedral_helix.h
/dihedral_hybrid.cpp
/dihedral_hybrid.h
/dihedral_multi_harmonic.cpp
/dihedral_multi_harmonic.h
/dihedral_nharmonic.cpp
@ -522,6 +609,8 @@
/fft3d_wrap.h
/fix_accelerate_cos.cpp
/fix_accelerate_cos.h
/fix_acks2_reaxff.cpp
/fix_acks2_reaxff.h
/fix_adapt_fep.cpp
/fix_adapt_fep.h
/fix_addtorque.cpp
@ -544,16 +633,14 @@
/fix_bond_react.h
/fix_bond_swap.cpp
/fix_bond_swap.h
/fix_charge_regulation.cpp
/fix_charge_regulation.h
/fix_client_md.cpp
/fix_client_md.h
/fix_cmap.cpp
/fix_cmap.h
/fix_deposit.cpp
/fix_deposit.h
/fix_dpd_energy.cpp
/fix_dpd_energy.h
/fix_efield.cpp
/fix_efield.h
/fix_electron_stopping.cpp
/fix_electron_stopping.h
/fix_electron_stopping_fit.cpp
@ -562,8 +649,6 @@
/fix_eos_cv.h
/fix_eos_table.cpp
/fix_eos_table.h
/fix_evaporate.cpp
/fix_evaporate.h
/fix_ffl.cpp
/fix_ffl.h
/fix_filter_corotate.cpp
@ -692,6 +777,8 @@
/fix_orient_eco.h
/fix_orient_fcc.cpp
/fix_orient_fcc.h
/fix_pair_tracker.cpp
/fix_pair_tracker.h
/fix_peri_neigh.cpp
/fix_peri_neigh.h
/fix_phonon.cpp
@ -700,22 +787,20 @@
/fix_poems.h
/fix_pour.cpp
/fix_pour.h
/fix_propel_self.cpp
/fix_propel_self.h
/fix_qeq_comb.cpp
/fix_qeq_comb.h
/fix_qeq_reax.cpp
/fix_qeq_fire.cpp
/fix_qeq_fire.h
/fix_qeq_reax.h
/fix_qeq_reaxff.cpp
/fix_qeq_reaxff.h
/fix_qmmm.cpp
/fix_qmmm.h
/fix_reaxc.cpp
/fix_reaxc.h
/fix_reaxc_bonds.cpp
/fix_reaxc_bonds.h
/fix_reaxc_species.cpp
/fix_reaxc_species.h
/fix_reaxff.cpp
/fix_reaxff.h
/fix_reaxff_bonds.cpp
/fix_reaxff_bonds.h
/fix_reaxff_species.cpp
/fix_reaxff_species.h
/fix_rhok.cpp
/fix_rhok.h
/fix_rigid.cpp
@ -767,14 +852,10 @@
/fix_tgnpt_drude.h
/fix_tgnvt_drude.cpp
/fix_tgnvt_drude.h
/fix_thermal_conductivity.cpp
/fix_thermal_conductivity.h
/fix_ti_rs.cpp
/fix_ti_rs.h
/fix_ti_spring.cpp
/fix_ti_spring.h
/fix_ttm.cpp
/fix_ttm.h
/fix_tune_kspace.cpp
/fix_tune_kspace.h
/fix_wall_body_polygon.cpp
@ -800,10 +881,10 @@
/fix_widom.cpp
/fix_widom.h
/gpu_extra.h
/gridcomm.cpp
/gridcomm.h
/group_ndx.cpp
/group_ndx.h
/gz_file_writer.cpp
/gz_file_writer.h
/ndx_group.cpp
/ndx_group.h
/hyper.cpp
@ -824,14 +905,13 @@
/improper_fourier.h
/improper_harmonic.cpp
/improper_harmonic.h
/improper_hybrid.cpp
/improper_hybrid.h
/improper_inversion_harmonic.cpp
/improper_inversion_harmonic.h
/improper_ring.cpp
/improper_ring.h
/improper_umbrella.cpp
/improper_umbrella.h
/interlayer_taper.h
/kissfft.h
/lj_sdk_common.h
/math_complex.h
@ -846,7 +926,6 @@
/msm_cg.h
/neb.cpp
/neb.h
/pair_adp.cpp
/pair_adp.h
/pair_agni.cpp
@ -907,6 +986,8 @@
/pair_cosine_squared.h
/pair_coul_diel.cpp
/pair_coul_diel.h
/pair_coul_exclude.cpp
/pair_coul_exclude.h
/pair_coul_long.cpp
/pair_coul_long.h
/pair_coul_msm.cpp
@ -923,8 +1004,6 @@
/pair_dipole_cut.h
/pair_dipole_sf.cpp
/pair_dipole_sf.h
/pair_dpd_mt.cpp
/pair_dpd_mt.h
/pair_dsmc.cpp
/pair_dsmc.h
/pair_e3b.cpp
@ -978,6 +1057,8 @@
/pair_hbond_dreiding_lj.h
/pair_hbond_dreiding_morse.cpp
/pair_hbond_dreiding_morse.h
/pair_hdnnp.cpp
/pair_hdnnp.h
/pair_ilp_graphene_hbn.cpp
/pair_ilp_graphene_hbn.h
/pair_kolmogorov_crespi_full.cpp
@ -1103,8 +1184,8 @@
/pair_peri_ves.h
/pair_quip.cpp
/pair_quip.h
/pair_reaxc.cpp
/pair_reaxc.h
/pair_reaxff.cpp
/pair_reaxff.h
/pair_rebo.cpp
/pair_rebo.h
/pair_resquared.cpp
@ -1141,6 +1222,8 @@
/pair_tip4p_long.h
/pair_tip4p_long_soft.cpp
/pair_tip4p_long_soft.h
/pair_tracker.h
/pair_tracker.cpp
/pair_tri_lj.cpp
/pair_tri_lj.h
/pair_yukawa_colloid.cpp
@ -1178,6 +1261,7 @@
/python_impl.cpp
/python_impl.h
/python_compat.h
/python_utils.h
/fix_python_move.cpp
/fix_python_move.h
/fix_python_invoke.cpp
@ -1188,50 +1272,27 @@
/reader_adios.h
/reader_molfile.cpp
/reader_molfile.h
/reaxc_allocate.cpp
/reaxc_allocate.h
/reaxc_basic_comm.cpp
/reaxc_basic_comm.h
/reaxc_bond_orders.cpp
/reaxc_bond_orders.h
/reaxc_bonds.cpp
/reaxc_bonds.h
/reaxc_control.cpp
/reaxc_control.h
/reaxc_defs.h
/reaxc_ffield.cpp
/reaxc_ffield.h
/reaxc_forces.cpp
/reaxc_forces.h
/reaxc_hydrogen_bonds.cpp
/reaxc_hydrogen_bonds.h
/reaxc_init_md.cpp
/reaxc_init_md.h
/reaxc_io_tools.cpp
/reaxc_io_tools.h
/reaxc_list.cpp
/reaxc_list.h
/reaxc_lookup.cpp
/reaxc_lookup.h
/reaxc_multi_body.cpp
/reaxc_multi_body.h
/reaxc_nonbonded.cpp
/reaxc_nonbonded.h
/reaxc_reset_tools.cpp
/reaxc_reset_tools.h
/reaxc_system_props.cpp
/reaxc_system_props.h
/reaxc_tool_box.cpp
/reaxc_tool_box.h
/reaxc_torsion_angles.cpp
/reaxc_torsion_angles.h
/reaxc_traj.cpp
/reaxc_traj.h
/reaxc_types.h
/reaxc_valence_angles.cpp
/reaxc_valence_angles.h
/reaxc_vector.cpp
/reaxc_vector.h
/reaxff_allocate.cpp
/reaxff_bond_orders.cpp
/reaxff_bonds.cpp
/reaxff_control.cpp
/reaxff_ffield.cpp
/reaxff_forces.cpp
/reaxff_hydrogen_bonds.cpp
/reaxff_init_md.cpp
/reaxff_list.cpp
/reaxff_lookup.cpp
/reaxff_multi_body.cpp
/reaxff_nonbonded.cpp
/reaxff_reset_tools.cpp
/reaxff_tool_box.cpp
/reaxff_torsion_angles.cpp
/reaxff_valence_angles.cpp
/reaxff_api.h
/reaxff_defs.h
/reaxff_inline.h
/reaxff_omp.h
/reaxff_types.h
/remap.cpp
/remap.h
/remap_wrap.cpp
@ -1265,10 +1326,10 @@
/thr_data.h
/verlet_split.cpp
/verlet_split.h
/write_dump.cpp
/write_dump.h
/xdr_compat.cpp
/xdr_compat.h
/zstd_file_writer.cpp
/zstd_file_writer.h
/atom_vec_smd.cpp
/atom_vec_smd.h
@ -1334,6 +1395,8 @@
/fix_drude_transform.h
/fix_langevin_drude.cpp
/fix_langevin_drude.h
/fix_mol_swap.cpp
/fix_mol_swap.h
/fix_pimd.cpp
/fix_pimd.h
/fix_qbmsst.cpp
@ -1362,6 +1425,10 @@
/fix_srp.h
/fix_tfmc.cpp
/fix_tfmc.h
/fix_ttm.cpp
/fix_ttm.h
/fix_ttm_grid.cpp
/fix_ttm_grid.h
/fix_ttm_mod.cpp
/fix_ttm_mod.h
/pair_born_coul_long_cs.cpp
@ -1400,8 +1467,14 @@
/pair_thole.h
/pair_buck_mdf.cpp
/pair_buck_mdf.h
/pair_dpd_conservative.cpp
/pair_dpd_conservative.h
/pair_dpd.cpp
/pair_dpd.h
/pair_dpd_tstat.cpp
/pair_dpd_tstat.h
/pair_dpd_ext.cpp
/pair_dpd_ext.h
/pair_dpd_ext_tstat.cpp
/pair_dpd_ext_tstat.h
/pair_dpd_fdt.cpp
/pair_dpd_fdt.h
/pair_dpd_fdt_energy.cpp
@ -1422,5 +1495,3 @@
/pair_smtbq.h
/pair_vashishta*.cpp
/pair_vashishta*.h
/zstd_file_writer.cpp
/zstd_file_writer.h

View File

@ -72,7 +72,7 @@ adios_SYSLIB=${ADIOS2_LIB}
sed -i -e '/^include.*ADIOS.*$/d' ../Makefile.package.settings
# multiline form needed for BSD sed on Macs
sed -i -e '4 i \
include ../USER-ADIOS/Makefile.lammps
include ../ADIOS/Makefile.lammps
' ../Makefile.package.settings
fi
fi

View File

@ -8,7 +8,7 @@ Configure LAMMPS with CMake
ADIOS2_DIR
to the ADIOS 2.x installation path
b. use the cmake option
-D PKG_USER-ADIOS=yes
-D PKG_ADIOS=yes
The person who created this package is Norbert Podhorszki (Oak Ridge National Laboratory);
If you need help, please submit a ticket at the OLCF ticket user support mentioning his name in the ticket.

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -13,7 +13,7 @@
#ifdef DUMP_CLASS
// clang-format off
DumpStyle(atom/adios, DumpAtomADIOS)
DumpStyle(atom/adios, DumpAtomADIOS);
// clang-format on
#else
@ -22,32 +22,30 @@ DumpStyle(atom/adios, DumpAtomADIOS)
#include "dump_atom.h"
namespace LAMMPS_NS
{
namespace LAMMPS_NS {
class DumpAtomADIOSInternal;
class DumpAtomADIOS : public DumpAtom
{
class DumpAtomADIOS : public DumpAtom {
public:
DumpAtomADIOS(class LAMMPS *, int, char **);
virtual ~DumpAtomADIOS();
public:
DumpAtomADIOS(class LAMMPS *, int, char **);
virtual ~DumpAtomADIOS();
protected:
virtual void openfile();
virtual void write();
virtual void init_style();
protected:
virtual void openfile();
virtual void write();
virtual void init_style();
private:
DumpAtomADIOSInternal *internal;
private:
DumpAtomADIOSInternal *internal;
};
}
} // namespace LAMMPS_NS
#endif
#endif
/* ERROR/WARNING messages:
/* ERROR/WARNING messages:
E: Cannot open dump file %s

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -13,7 +13,7 @@
#ifdef DUMP_CLASS
// clang-format off
DumpStyle(custom/adios, DumpCustomADIOS)
DumpStyle(custom/adios, DumpCustomADIOS);
// clang-format on
#else
@ -22,31 +22,29 @@ DumpStyle(custom/adios, DumpCustomADIOS)
#include "dump_custom.h"
namespace LAMMPS_NS
{
namespace LAMMPS_NS {
class DumpCustomADIOSInternal;
class DumpCustomADIOS : public DumpCustom
{
public:
DumpCustomADIOS(class LAMMPS *, int, char **);
virtual ~DumpCustomADIOS();
class DumpCustomADIOS : public DumpCustom {
public:
DumpCustomADIOS(class LAMMPS *, int, char **);
virtual ~DumpCustomADIOS();
protected:
virtual void openfile();
virtual void write();
virtual void init_style();
protected:
virtual void openfile();
virtual void write();
virtual void init_style();
private:
DumpCustomADIOSInternal *internal;
private:
DumpCustomADIOSInternal *internal;
};
}
} // namespace LAMMPS_NS
#endif
#endif
/* ERROR/WARNING messages:
/* ERROR/WARNING messages:
E: Cannot open dump file %s

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

69
src/ADIOS/reader_adios.h Normal file
View File

@ -0,0 +1,69 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributed by Norbert Podhorszki (Oak Ridge National Laboratory)
------------------------------------------------------------------------- */
#ifdef READER_CLASS
// clang-format off
ReaderStyle(adios, ReaderADIOS);
// clang-format on
#else
#ifndef LMP_READER_ADIOS_H
#define LMP_READER_ADIOS_H
#include "reader.h"
#include <map>
#include <string>
#include <vector>
namespace LAMMPS_NS {
class ReadADIOSInternal;
class ReaderADIOS : public Reader {
public:
ReaderADIOS(class LAMMPS *);
virtual ~ReaderADIOS();
virtual void settings(int, char **);
virtual int read_time(bigint &);
virtual void skip();
virtual bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &,
int &, int &, int &);
virtual void read_atoms(int, int, double **);
virtual void open_file(const char *);
virtual void close_file();
private:
int *fieldindex; // mapping of input fields to dump
uint64_t nAtomsTotal; // current number of atoms in entire dump step
uint64_t nAtoms; // current number of atoms for this process
// (Sum(nAtoms)=nAtomsTotal)
uint64_t atomOffset; // starting atom position for this process to read
bigint nstep; // current (time) step number
bigint nid; // current atom id.
int me;
ReadADIOSInternal *internal;
int find_label(const std::string &label, const std::map<std::string, int> &labels);
};
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(erotate/asphere,ComputeERotateAsphere)
// clang-format off
ComputeStyle(erotate/asphere,ComputeERotateAsphere);
// clang-format on
#else
#ifndef LMP_COMPUTE_EROTATE_ASPHERE_H
@ -37,7 +37,7 @@ class ComputeERotateAsphere : public Compute {
class AtomVecTri *avec_tri;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(temp/asphere,ComputeTempAsphere)
// clang-format off
ComputeStyle(temp/asphere,ComputeTempAsphere);
// clang-format on
#else
#ifndef LMP_COMPUTE_TEMP_ASPHERE_H
@ -42,13 +42,13 @@ class ComputeTempAsphere : public Compute {
int mode;
double tfactor;
char *id_bias;
class Compute *tbias; // ptr to additional bias compute
class Compute *tbias; // ptr to additional bias compute
class AtomVecEllipsoid *avec;
void dof_compute();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -33,7 +33,7 @@ class FixNHAsphere : public FixNH {
void nh_v_temp();
};
}
} // namespace LAMMPS_NS
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nph/asphere,FixNPHAsphere)
// clang-format off
FixStyle(nph/asphere,FixNPHAsphere);
// clang-format on
#else
#ifndef LMP_FIX_NPH_ASPHERE_H
@ -30,7 +30,7 @@ class FixNPHAsphere : public FixNHAsphere {
~FixNPHAsphere() {}
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(npt/asphere,FixNPTAsphere)
// clang-format off
FixStyle(npt/asphere,FixNPTAsphere);
// clang-format on
#else
#ifndef LMP_FIX_NPT_ASPHERE_H
@ -30,7 +30,7 @@ class FixNPTAsphere : public FixNHAsphere {
~FixNPTAsphere() {}
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nve/asphere,FixNVEAsphere)
// clang-format off
FixStyle(nve/asphere,FixNVEAsphere);
// clang-format on
#else
#ifndef LMP_FIX_NVE_ASPHERE_H
@ -36,7 +36,7 @@ class FixNVEAsphere : public FixNVE {
class AtomVecEllipsoid *avec;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nve/asphere/noforce,FixNVEAsphereNoforce)
// clang-format off
FixStyle(nve/asphere/noforce,FixNVEAsphereNoforce);
// clang-format on
#else
#ifndef LMP_FIX_NVE_ASPHERE_NOFORCE_H
@ -35,7 +35,7 @@ class FixNVEAsphereNoforce : public FixNVENoforce {
class AtomVecEllipsoid *avec;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nve/line,FixNVELine)
// clang-format off
FixStyle(nve/line,FixNVELine);
// clang-format on
#else
#ifndef LMP_FIX_NVE_LINE_H
@ -34,11 +34,11 @@ class FixNVELine : public FixNVE {
void final_integrate();
private:
double MINUSPI,TWOPI;
double MINUSPI, TWOPI;
class AtomVecLine *avec;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nve/tri,FixNVETri)
// clang-format off
FixStyle(nve/tri,FixNVETri);
// clang-format on
#else
#ifndef LMP_FIX_NVE_TRI_H
@ -38,7 +38,7 @@ class FixNVETri : public FixNVE {
class AtomVecTri *avec;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nvt/asphere,FixNVTAsphere)
// clang-format off
FixStyle(nvt/asphere,FixNVTAsphere);
// clang-format on
#else
#ifndef LMP_FIX_NVT_ASPHERE_H
@ -30,7 +30,7 @@ class FixNVTAsphere : public FixNHAsphere {
~FixNVTAsphere() {}
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(gayberne,PairGayBerne)
// clang-format off
PairStyle(gayberne,PairGayBerne);
// clang-format on
#else
#ifndef LMP_PAIR_GAYBERNE_H
@ -41,38 +41,35 @@ class PairGayBerne : public Pair {
void write_data_all(FILE *);
protected:
enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE};
enum { SPHERE_SPHERE, SPHERE_ELLIPSE, ELLIPSE_SPHERE, ELLIPSE_ELLIPSE };
double cut_global;
double **cut;
double gamma,upsilon,mu; // Gay-Berne parameters
double **shape1; // per-type radii in x, y and z
double **shape2; // per-type radii in x, y and z SQUARED
double *lshape; // precalculation based on the shape
double **well; // well depth scaling along each axis ^ -1.0/mu
double **epsilon,**sigma; // epsilon and sigma values for atom-type pairs
double gamma, upsilon, mu; // Gay-Berne parameters
double **shape1; // per-type radii in x, y and z
double **shape2; // per-type radii in x, y and z SQUARED
double *lshape; // precalculation based on the shape
double **well; // well depth scaling along each axis ^ -1.0/mu
double **epsilon, **sigma; // epsilon and sigma values for atom-type pairs
int **form;
double **lj1,**lj2,**lj3,**lj4;
double **lj1, **lj2, **lj3, **lj4;
double **offset;
int *setwell;
class AtomVecEllipsoid *avec;
void allocate();
double gayberne_analytic(const int i, const int j, double a1[3][3],
double a2[3][3], double b1[3][3], double b2[3][3],
double g1[3][3], double g2[3][3], double *r12,
const double rsq, double *fforce, double *ttor,
double gayberne_analytic(const int i, const int j, double a1[3][3], double a2[3][3],
double b1[3][3], double b2[3][3], double g1[3][3], double g2[3][3],
double *r12, const double rsq, double *fforce, double *ttor,
double *rtor);
double gayberne_lj(const int i, const int j, double a1[3][3],
double b1[3][3],double g1[3][3],double *r12,
const double rsq, double *fforce, double *ttor);
void compute_eta_torque(double m[3][3], double m2[3][3],
double *s, double ans[3][3]);
double gayberne_lj(const int i, const int j, double a1[3][3], double b1[3][3], double g1[3][3],
double *r12, const double rsq, double *fforce, double *ttor);
void compute_eta_torque(double m[3][3], double m2[3][3], double *s, double ans[3][3]);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -300,8 +301,7 @@ void PairLineLJ::compute(int eflag, int vflag)
}
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
if (evflag) ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz);
}
}

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(line/lj,PairLineLJ)
// clang-format off
PairStyle(line/lj,PairLineLJ);
// clang-format on
#else
#ifndef LMP_PAIR_LINE_LJ_H
@ -37,28 +37,28 @@ class PairLineLJ : public Pair {
protected:
double cut_global;
double *subsize;
double **epsilon,**sigma,**cutsub,**cutsubsq;
double **epsilon, **sigma, **cutsub, **cutsubsq;
double **cut;
double **lj1,**lj2,**lj3,**lj4; // for sphere/sphere interactions
double **lj1, **lj2, **lj3, **lj4; // for sphere/sphere interactions
class AtomVecLine *avec;
double *size; // per-type size of sub-particles to tile line segment
double *size; // per-type size of sub-particles to tile line segment
struct Discrete {
double dx,dy;
double dx, dy;
};
Discrete *discrete; // list of all discretes for all lines
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
Discrete *discrete; // list of all discretes for all lines
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
void allocate();
void discretize(int, double);
};
}
} // namespace LAMMPS_NS
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(resquared,PairRESquared)
// clang-format off
PairStyle(resquared,PairRESquared);
// clang-format on
#else
#ifndef LMP_PAIR_RESQUARED_H
@ -39,19 +39,19 @@ class PairRESquared : public Pair {
void read_restart_settings(FILE *);
protected:
enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE};
enum { SPHERE_SPHERE, SPHERE_ELLIPSE, ELLIPSE_SPHERE, ELLIPSE_ELLIPSE };
double cut_global;
double **cut;
double **shape1; // per-type radii in x, y and z
double **shape2; // per-type radii in x, y and z SQUARED
double *lshape; // product of the radii
double **well; // well depth scaling along each axis
double **epsilon,**sigma; // epsilon and sigma values for atom-type pairs
double **shape1; // per-type radii in x, y and z
double **shape2; // per-type radii in x, y and z SQUARED
double *lshape; // product of the radii
double **well; // well depth scaling along each axis
double **epsilon, **sigma; // epsilon and sigma values for atom-type pairs
int **form;
double **lj1,**lj2,**lj3,**lj4;
double **lj1, **lj2, **lj3, **lj4;
double **offset;
int *setwell;
class AtomVecEllipsoid *avec;
@ -61,38 +61,35 @@ class PairRESquared : public Pair {
struct RE2Vars {
// per particle precomputations for energy, force, torque
double A[3][3]; // Rotation matrix (lab->body)
double aTe[3][3]; // A'*E
double gamma[3][3]; // A'*S^2*A
double A[3][3]; // Rotation matrix (lab->body)
double aTe[3][3]; // A'*E
double gamma[3][3]; // A'*S^2*A
// per particle precomputations for torque
double sa[3][3]; // S^2*A;
double lA[3][3][3]; // -A*rotation generator (x,y, or z)
double lAtwo[3][3][3]; // A'*S^2*lA
double lAsa[3][3][3]; // lAtwo+lA'*sa
double sa[3][3]; // S^2*A;
double lA[3][3][3]; // -A*rotation generator (x,y, or z)
double lAtwo[3][3][3]; // A'*S^2*lA
double lAsa[3][3][3]; // lAtwo+lA'*sa
};
void allocate();
void precompute_i(const int i,RE2Vars &ws);
void precompute_i(const int i, RE2Vars &ws);
double det_prime(const double m[3][3], const double m2[3][3]);
double resquared_analytic(const int i, const int j,
const RE2Vars &wi, const RE2Vars &wj,
const double *r, const double rsq,
double *fforce, double *ttor,
double resquared_analytic(const int i, const int j, const RE2Vars &wi, const RE2Vars &wj,
const double *r, const double rsq, double *fforce, double *ttor,
double *rtor);
double resquared_lj(const int i, const int j, const RE2Vars &wi,
const double *r, const double rsq, double *fforce,
double *ttor, bool calc_torque);
double resquared_lj(const int i, const int j, const RE2Vars &wi, const double *r,
const double rsq, double *fforce, double *ttor, bool calc_torque);
double cr60; // 60^1/3
double b_alpha; // 45/56
double solv_f_a; // 3.0/(4.0*PI*-36)
double solv_f_r; // 3.0/(4.0*PI*2025)
double cr60; // 60^1/3
double b_alpha; // 45/56
double solv_f_a; // 3.0/(4.0*PI*-36)
double solv_f_r; // 3.0/(4.0*PI*2025)
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -374,8 +375,7 @@ void PairTriLJ::compute(int eflag, int vflag)
}
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
if (evflag) ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz);
}
}

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(tri/lj,PairTriLJ)
// clang-format off
PairStyle(tri/lj,PairTriLJ);
// clang-format on
#else
#ifndef LMP_PAIR_TRI_LJ_H
@ -37,26 +37,26 @@ class PairTriLJ : public Pair {
protected:
double cut_global;
double **cut;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4;
double **epsilon, **sigma;
double **lj1, **lj2, **lj3, **lj4;
class AtomVecTri *avec;
struct Discrete {
double dx,dy,dz;
double dx, dy, dz;
double sigma;
};
Discrete *discrete; // list of all discretes for all lines
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
Discrete *discrete; // list of all discretes for all lines
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
void allocate();
void discretize(int, double, double *, double *, double *);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -31,7 +31,7 @@ action () {
if (test $1 = 1) then
if (test ! -e ../pair_eam.cpp) then
echo "Must install MANYBODY package with USER-ATC"
echo "Must install MANYBODY package with ATC"
exit 1
fi
fi
@ -54,9 +54,9 @@ if (test $1 = 1) then
# sed -i -e 's|^PKG_INC =[ \t]*|&-I../../lib/atc |' ../Makefile.package
# sed -i -e 's|^PKG_PATH =[ \t]*|&-L../../lib/atc$(LIBSOBJDIR) |' ../Makefile.package
sed -i -e 's|^PKG_LIB =[ \t]*|&-latc |' ../Makefile.package
sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(user-atc_SYSINC) |' ../Makefile.package
sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(user-atc_SYSLIB) |' ../Makefile.package
sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(user-atc_SYSPATH) |' ../Makefile.package
sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(atc_SYSINC) |' ../Makefile.package
sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(atc_SYSLIB) |' ../Makefile.package
sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(atc_SYSPATH) |' ../Makefile.package
fi
if (test -e ../Makefile.package.settings) then

View File

@ -7,7 +7,7 @@ See the doc page for the fix atc command to get started. At the
bottom of the doc page are many links to additional documentation
contained in the doc/USER/atc directory.
There are example scripts for using this package in examples/USER/atc.
There are example scripts for using this package in examples/PACKAGES/atc.
This package uses an external library in lib/atc which must be
compiled before making LAMMPS. See the lib/atc/README file and the

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/
https://www.lammps.org/
Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -36,7 +37,7 @@ using namespace FixConst;
using std::string;
#ifdef LAMMPS_BIGBIG
#error "The USER-ATC package is not compatible with -DLAMMPS_BIGBIG"
#error "The ATC package is not compatible with -DLAMMPS_BIGBIG"
#endif
// main page of doxygen documentation
@ -699,20 +700,17 @@ int FixATC::size_restart(int /* nlocal */) {
void FixATC::write_restart(FILE * /* fp */) {
char ** args = new char*[2];
args[0] = new char[50];
args[1] = new char[50];
sprintf(args[0],"write_restart");
sprintf(args[1],"ATC.restart");
char *args[2];
args[0] = utils::strdup("write_restart");
args[1] = utils::strdup("ATC.restart");
// Then call all objects I own to write their data
if (comm->me == 0) {
atc_->modify(2,args);
}
delete [] args[0];
delete [] args[1];
delete [] args;
delete[] args[0];
delete[] args[1];
}
/* ----------------------------------------------------------------------
@ -721,20 +719,17 @@ void FixATC::write_restart(FILE * /* fp */) {
void FixATC::restart(char * /* buf */) {
char ** args = new char*[2];
args[0] = new char[50];
args[1] = new char[50];
sprintf(args[0],"read_restart");
sprintf(args[1],"ATC.restart");
char *args[2];
args[0] = utils::strdup("read_restart");
args[1] = utils::strdup("ATC.restart");
// Then call all objects I own to write their data
if (comm->me == 0) {
atc_->modify(2,args);
}
delete [] args[0];
delete [] args[1];
delete [] args;
delete[] args[0];
delete[] args[1];
}
/* ----------------------------------------------------------------------

142
src/ATC/fix_atc.h Normal file
View File

@ -0,0 +1,142 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
// clang-format off
FixStyle(atc,FixATC);
// clang-format on
#else
#ifndef FIX_ATC_H
#define FIX_ATC_H
#include "fix.h"
namespace ATC {
class ATC_Method;
}
namespace LAMMPS_NS {
class NeighList;
/**
* @class FixATC
* @brief Class for an atom-to-continuum (ATC) LAMMPS fix.
*/
class FixATC : public Fix {
public:
/** constructor & destructor */
FixATC(class LAMMPS *, int, char **);
~FixATC();
/** initialization functions */
void init();
void init_list(int id, NeighList *ptr);
void setup(int vflag);
void min_setup(int vflag);
/** setmask: tell LAMMPS which fix methods to call */
int setmask();
/** initial_integrate */
void initial_integrate(int vflag);
/** after first integrate phase */
void post_integrate();
/** final_integrate */
void final_integrate();
/** end of step for run or minimize */
void end_of_step();
/** pre_exchange is used to modify fix-specific data
and is called before domain->pbc() and comm->exchange(). */
void setup_pre_exchange();
void pre_exchange();
void min_pre_exchange();
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int, int);
/** pack_exchange called from atom_vec->pack_exchange()
and packs fix-specific data for a given real (local)
atom being sent to another processor. */
int pack_exchange(int, double *);
/** unpack_exchange called from atom_vec->unpack_exchange()
and unpacks fix-specific data for a given real (local)
atom received from another processor. */
int unpack_exchange(int, double *);
/** pack_comm called from comm->forward_comm_fix and
packs fix-specific data for a given ghost atom
from exchange with another proc */
int pack_forward_comm(int, int *, double *, int, int *);
/** unpack_comm called from comm->forward_comm_fix and
unpacks fix-specific data for a given ghost atom
from exchange with another proc */
void unpack_forward_comm(int, int, double *);
/** pre_neighbor is used to modify fix-specific data
and is called before neighbor list is built in
neighbor->build(). */
void pre_neighbor();
void setup_pre_neighbor();
/** pre/post_force is used to modify fix-specific data
and is before/after the various force computations. */
void pre_force(int vflag);
void post_force(int vflag);
/** post_run is called after a run completes */
void post_run();
/** min_pre_force is called before forces are calculated in minimize */
void min_pre_force(int vflag);
/** min_post_force is called after forces are calculated in minimize */
void min_post_force(int vflag);
/** modify atc parameters (parser) */
int modify_param(int narg, char **arg);
/** calls ATC_Method to handle restarting/checkpointing */
/** these four methods are for writing per-atom quantities */
int pack_restart(int, double *);
void unpack_restart(int, int);
int size_restart(int);
int maxsize_restart();
/** these two methods are for writing all other quantities */
void write_restart(FILE *);
void restart(char *);
/** accessor function for ATC_Method class pointer */
const ATC::ATC_Method *atc() { return atc_; }
protected:
LAMMPS *lammps_;
/** functions for "thermo" output */
virtual double compute_scalar();
virtual double compute_vector(int n);
virtual double compute_array(int irow, int icol);
double dtv, dtf;
ATC::ATC_Method *atc_;
};
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -41,8 +41,8 @@ if (test $1 = 1) then
sed -i -e 's|^PKG_INC =[ \t]*|&-I../../lib/awpmd/ivutils/include -I../../lib/awpmd/systems/interact |' ../Makefile.package
sed -i -e 's|^PKG_PATH =[ \t]*|&-L../../lib/awpmd |' ../Makefile.package
sed -i -e 's|^PKG_LIB =[ \t]*|&-lawpmd |' ../Makefile.package
sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(user-awpmd_SYSPATH) |' ../Makefile.package
sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(user-awpmd_SYSLIB) |' ../Makefile.package
sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(awpmd_SYSPATH) |' ../Makefile.package
sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(awpmd_SYSLIB) |' ../Makefile.package
fi
if (test -e ../Makefile.package.settings) then

View File

@ -4,7 +4,7 @@ Wave Packet Molecular Dynamics (AWPMD) method.
See the doc page for the pair_style awpmd/cut command to get started.
There are example scripts for using this package in
examples/USER/awpmd.
examples/PACKAGES/awpmd.
This package uses an external library in lib/awpmd which must be
compiled before making LAMMPS. See the lib/awpmd/README file and the

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef ATOM_CLASS
AtomStyle(wavepacket,AtomVecWavepacket)
// clang-format off
AtomStyle(wavepacket,AtomVecWavepacket);
// clang-format on
#else
#ifndef LMP_ATOM_VEC_WAVEPACKET_H
@ -25,7 +25,7 @@ AtomStyle(wavepacket,AtomVecWavepacket)
namespace LAMMPS_NS {
class AtomVecWavepacket : public AtomVec {
public:
public:
AtomVecWavepacket(class LAMMPS *);
void grow_pointers();
@ -37,10 +37,10 @@ public:
private:
int *spin;
double *q,*eradius,*ervel,*erforce;
double *q, *eradius, *ervel, *erforce;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -16,9 +16,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nve/awpmd,FixNVEAwpmd)
// clang-format off
FixStyle(nve/awpmd,FixNVEAwpmd);
// clang-format on
#else
#ifndef LMP_FIX_NVE_awpmd_H
@ -40,14 +40,14 @@ class FixNVEAwpmd : public Fix {
void reset_dt();
protected:
double dtv,dtf;
double dtv, dtf;
double *step_respa;
int mass_require;
class PairAWPMDCut *awpmd_pair;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -38,7 +39,6 @@
#include <cstring>
#include <map>
#include <utility>
#include <vector>
using namespace LAMMPS_NS;
@ -246,8 +246,8 @@ void PairAWPMDCut::compute(int eflag, int vflag)
fi= new Vector_3[wpmd->ni];
// adding electrons
for (std::map<int,std::vector<int> >::iterator it=etmap.begin(); it!= etmap.end(); ++it) {
std::vector<int> &el=it->second;
for (auto & it : etmap) {
std::vector<int> &el=it.second;
if (!el.size()) // should not happen
continue;
int s=spin[el[0]] >0 ? 0 : 1;

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -14,11 +14,10 @@
Contributing author: Ilya Valuev (JIHT RAS)
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(awpmd/cut,PairAWPMDCut)
// clang-format off
PairStyle(awpmd/cut,PairAWPMDCut);
// clang-format on
#else
#ifndef LMP_PAIR_AWPMD_CUT_H
@ -26,14 +25,13 @@ PairStyle(awpmd/cut,PairAWPMDCut)
#include "pair.h"
class AWPMD_split;
namespace LAMMPS_NS {
class PairAWPMDCut : public Pair {
friend class FixNVEAwpmd;
public:
PairAWPMDCut(class LAMMPS *);
virtual ~PairAWPMDCut();
@ -54,28 +52,24 @@ class PairAWPMDCut : public Pair {
double memory_usage();
private:
int flexible_pressure_flag;
double cut_global;
double **cut;
int nmax; // number of additional variables for minimizer
double *min_var,*min_varforce; // additional variables for minimizer
int nmax; // number of additional variables for minimizer
double *min_var, *min_varforce; // additional variables for minimizer
void allocate();
void virial_eradius_compute();
AWPMD_split *wpmd; // solver object
double ermscale; // scale of width mass for motion
double width_pbc; // setting for width pbc
double half_box_length; // calculated by coeff function
AWPMD_split *wpmd; // solver object
double ermscale; // scale of width mass for motion
double width_pbc; // setting for width pbc
double half_box_length; // calculated by coeff function
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -7,7 +7,7 @@ molecular liquids," J. Chem. Phys. 143, 243148 (2015).
doi: 10.1063/1.4937383
The USER-BOCS user package for LAMMPS is part of the BOCS software package:
The BOCS user package for LAMMPS is part of the BOCS software package:
https://github.com/noid-group/BOCS
See the following reference for information about the entire package:
@ -16,4 +16,4 @@ Dunn, NJH; Lebold, KM; DeLyser, MR; Rudzinski, JF; Noid, WG.
"BOCS: Bottom-Up Open-Source Coarse-Graining Software."
J. Phys. Chem. B. 122, 13, 3363-3377 (2018).
Example inputs are in the examples/USER/bocs folder.
Example inputs are in the examples/PACKAGES/bocs folder.

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -10,7 +11,7 @@
See the README file in the top-level LAMMPS directory.
-------------------------------------------------------------------------
USER-BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser
BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser
from The Pennsylvania State University
------------------------------------------------------------------------- */
@ -215,7 +216,7 @@ double ComputePressureBocs::find_index(double * grid, double value)
if (value >= grid[i] && value <= (grid[i] + spacing)) { return i; }
error->all(FLERR, fmt::format("find_index could not find value in grid for value: {}", value));
error->all(FLERR,"find_index could not find value in grid for value: {}", value);
for (int i = 0; i < gridsize; ++i)
{
fprintf(stderr, "grid %d: %f\n",i,grid[i]);

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -10,32 +10,31 @@
See the README file in the top-level LAMMPS directory.
-------------------------------------------------------------------------
USER-BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser
BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser
from The Pennsylvania State University
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(PRESSURE/BOCS,ComputePressureBocs)
// clang-format off
ComputeStyle(PRESSURE/BOCS,ComputePressureBocs);
// clang-format on
#else
#ifndef LMP_COMPUTE_PRESSURE_BOCS_H
#define LMP_COMPUTE_PRESSURE_BOCS_H
#include "compute.h"
namespace LAMMPS_NS {
// Enumerate the p_basis_type magic values to improve readability:
enum{BASIS_ANALYTIC, BASIS_LINEAR_SPLINE, BASIS_CUBIC_SPLINE};
// Enumerate the data file column names to improve readability
enum{VOLUME, PRESSURE_CORRECTION};
// Declare names for the number of columns in the splines data structure to improve readability
const int NUM_LINEAR_SPLINE_COLUMNS = 2; // linear spline columns passed to compute
const int NUM_CUBIC_SPLINE_COLUMNS = 5; // cubic spline columns passed to compute
// Enumerate the p_basis_type magic values to improve readability:
enum { BASIS_ANALYTIC, BASIS_LINEAR_SPLINE, BASIS_CUBIC_SPLINE };
// Enumerate the data file column names to improve readability
enum { VOLUME, PRESSURE_CORRECTION };
// Declare names for the number of columns in the splines data structure to improve readability
const int NUM_LINEAR_SPLINE_COLUMNS = 2; // linear spline columns passed to compute
const int NUM_CUBIC_SPLINE_COLUMNS = 5; // cubic spline columns passed to compute
// ComputePressure -> ComputePressureBocs MRD NJD
// ComputePressure -> ComputePressureBocs MRD NJD
class ComputePressureBocs : public Compute {
public:
ComputePressureBocs(class LAMMPS *, int, char **);
@ -48,36 +47,36 @@ class ComputePressureBocs : public Compute {
double compute_cg_scalar();
double get_cg_p_corr(int, double *, int, double, double);
double get_cg_fluct(double, double);
void send_cg_info(int, int, double*, int, double);
void send_cg_info(int, int, double *, int, double);
void send_cg_info(int, double **, int);
double get_cg_p_corr(double **, int, double);
double find_index(double* , double);
double find_index(double *, double);
protected:
double boltz,nktv2p,inv_volume;
int nvirial,dimension;
double boltz, nktv2p, inv_volume;
int nvirial, dimension;
double **vptr;
double *kspace_virial;
Compute *temperature;
char *id_temp;
double virial[6];
int keflag,pairflag,bondflag,angleflag,dihedralflag,improperflag;
int fixflag,kspaceflag;
int keflag, pairflag, bondflag, angleflag, dihedralflag, improperflag;
int fixflag, kspaceflag;
// NJD MRD
// NJD MRD
int p_basis_type;
int p_match_flag;
double vavg;
int N_mol;
int N_basis;
double *phi_coeff;
double ** splines;
double **splines;
int spline_length;
void virial_compute(int, int);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -10,7 +11,7 @@
See the README file in the top-level LAMMPS directory.
-------------------------------------------------------------------------
USER-BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser
BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser
from The Pennsylvania State University
------------------------------------------------------------------------- */
@ -36,13 +37,12 @@
#include <cmath>
#include <cstring>
#include <vector>
using namespace LAMMPS_NS;
using namespace FixConst;
static const char cite_user_bocs_package[] =
"USER-BOCS package:\n\n"
"BOCS package:\n\n"
"@Article{Dunn2018,\n"
" author = {NJH Dunn, KM Lebold, MR DeLyser, JF Rudzinski, WG Noid},\n"
" title = {BOCS: Bottom-Up Open-Source Coarse-Graining Software},\n"
@ -233,9 +233,7 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) :
iarg += 2;
} else if (strcmp(arg[iarg],"mtk") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command");
if (strcmp(arg[iarg+1],"yes") == 0) mtk_flag = 1;
else if (strcmp(arg[iarg+1],"no") == 0) mtk_flag = 0;
else error->all(FLERR,"Illegal fix bocs command");
mtk_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
iarg += 2;
} else if (strcmp(arg[iarg],"tloop") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command");
@ -629,7 +627,7 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
// NB: LAMMPS coding guidelines prefer cstdio so we are intentionally
// foregoing reading with getline
if (comm->me == 0) {
error->message(FLERR, fmt::format("INFO: About to read data file: {}", filename));
error->message(FLERR, "INFO: About to read data file: {}", filename);
}
// Data file lines hold two floating point numbers.
@ -639,13 +637,13 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
char line[MAX_F_TABLE_LINE_LENGTH];
std::vector<std::string> inputLines;
while (fgets(line, MAX_F_TABLE_LINE_LENGTH, fpi)) {
inputLines.push_back(std::string(line));
inputLines.emplace_back(line);
}
fclose(fpi);
numEntries = inputLines.size();
if (comm->me == 0) {
error->message(FLERR, fmt::format("INFO: Read {} lines from file", numEntries));
error->message(FLERR, "INFO: Read {} lines from file", numEntries);
}
@ -670,34 +668,23 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
test_sscanf = sscanf(inputLines.at(i).c_str()," %f , %f ",&f1, &f2);
if (test_sscanf == 2)
{
//if (comm->me == 0) {
// error->message(FLERR, fmt::format("INFO: f1 = {}, f2 = {}", f1, f2));
//}
data[VOLUME][i] = (double)f1;
data[PRESSURE_CORRECTION][i] = (double)f2;
if (i == 1)
{
// second entry is used to compute the validation interval used below
stdVolumeInterval = data[VOLUME][i] - data[VOLUME][i-1];
//if (comm->me == 0) {
// error->message(FLERR, fmt::format("INFO: standard volume interval computed: {}", stdVolumeInterval));
//}
}
else if (i > 1)
{
// after second entry, all intervals are validated
currVolumeInterval = data[VOLUME][i] - data[VOLUME][i-1];
//if (comm->me == 0) {
// error->message(FLERR, fmt::format("INFO: current volume interval: {}", currVolumeInterval));
//}
if (fabs(currVolumeInterval - stdVolumeInterval) > volumeIntervalTolerance) {
if (comm->me == 0) {
message = fmt::format("Bad volume interval. Spline analysis requires uniform"
" volume distribution, found inconsistent volume"
" differential, line {} of file {}\n\tline: {}",
lineNum, filename, inputLines.at(i));
error->warning(FLERR, message);
}
if (comm->me == 0)
error->warning(FLERR,"Bad volume interval. Spline analysis requires uniform"
" volume distribution, found inconsistent volume"
" differential, line {} of file {}\nWARNING:\tline: {}",
lineNum, filename, inputLines.at(i));
badInput = true;
numBadVolumeIntervals++;
}
@ -706,12 +693,10 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
}
else
{
if (comm->me == 0) {
message = fmt::format("Bad input format: did not find 2 comma separated numeric"
" values in line {} of file {}\n\tline: {}",
lineNum, filename, inputLines.at(i));
error->warning(FLERR, message);
}
if (comm->me == 0)
error->warning(FLERR,"Bad input format: did not find 2 comma separated numeric"
" values in line {} of file {}\nWARNING:\tline: {}",
lineNum, filename, inputLines.at(i));
badInput = true;
}
if (badInput)
@ -721,15 +706,15 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
}
if (numBadVolumeIntervals > 0 && comm->me == 0) {
error->message(FLERR, fmt::format("INFO: total number bad volume intervals = {}", numBadVolumeIntervals));
error->message(FLERR, "INFO: total number bad volume intervals = {}", numBadVolumeIntervals);
}
}
else {
error->all(FLERR,fmt::format("ERROR: Unable to open file: {}", filename));
error->all(FLERR,"ERROR: Unable to open file: {}", filename);
}
if (badInput && comm->me == 0) {
error->warning(FLERR,fmt::format("Bad volume / pressure-correction data: {}\nSee details above", filename));
error->warning(FLERR,"Bad volume / pressure-correction data: {}\nSee details above", filename);
}
if (p_basis_type == BASIS_LINEAR_SPLINE)
@ -744,7 +729,7 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
}
else
{
error->all(FLERR,fmt::format("ERROR: invalid p_basis_type value of {} in read_F_table", p_basis_type));
error->all(FLERR,"ERROR: invalid p_basis_type value of {} in read_F_table", p_basis_type);
}
memory->destroy(data);
@ -752,9 +737,6 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
}
int FixBocs::build_linear_splines(double **data) {
//if (comm->me == 0) {
//error->message(FLERR, fmt::format("INFO: entering build_linear_splines, spline_length = {}", spline_length));
//}
splines = (double **) calloc(NUM_LINEAR_SPLINE_COLUMNS,sizeof(double *));
splines[VOLUME] = (double *) calloc(spline_length,sizeof(double));
splines[PRESSURE_CORRECTION] = (double *) calloc(spline_length,sizeof(double));
@ -766,7 +748,7 @@ int FixBocs::build_linear_splines(double **data) {
}
if (comm->me == 0) {
error->message(FLERR, fmt::format("INFO: leaving build_linear_splines, spline_length = {}", spline_length));
error->message(FLERR, "INFO: leaving build_linear_splines, spline_length = {}", spline_length);
}
return spline_length;
@ -774,9 +756,6 @@ int FixBocs::build_linear_splines(double **data) {
int FixBocs::build_cubic_splines(double **data)
{
//if (comm->me == 0) {
//error->message(FLERR, fmt::format("INFO: entering build_cubic_splines, spline_length = {}", spline_length));
//}
int n = spline_length;
double *a, *b, *d, *h, *alpha, *c, *l, *mu, *z;
// 2020-07-17 ag:
@ -867,7 +846,7 @@ int FixBocs::build_cubic_splines(double **data)
memory->destroy(z);
if (comm->me == 0) {
error->message(FLERR, fmt::format("INFO: leaving build_cubic_splines, numSplines = {}", numSplines));
error->message(FLERR, "INFO: leaving build_cubic_splines, numSplines = {}", numSplines);
}
// Tell the caller how many splines we created
@ -1118,7 +1097,12 @@ void FixBocs::initial_integrate_respa(int /*vflag*/, int ilevel, int /*iloop*/)
nve_x();
if (pstat_flag) remap();
}
}
/* ---------------------------------------------------------------------- */
void FixBocs::pre_force_respa(int /*vflag*/, int ilevel, int /*iloop*/)
{
// if barostat, redo KSpace coeffs at outermost level,
// since volume has changed

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -10,15 +10,14 @@
See the README file in the top-level LAMMPS directory.
-------------------------------------------------------------------------
USER-BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser
BOCS written by: Nicholas J. H. Dunn and Michael R. DeLyser
from The Pennsylvania State University
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(bocs,FixBocs)
// clang-format off
FixStyle(bocs,FixBocs);
// clang-format on
#else
#ifndef LMP_FIX_BOCS_H
@ -30,119 +29,118 @@ namespace LAMMPS_NS {
class FixBocs : public Fix {
public:
FixBocs(class LAMMPS *, int, char **); // MRD NJD
virtual ~FixBocs(); // MRD NJD
FixBocs(class LAMMPS *, int, char **); // MRD NJD
virtual ~FixBocs(); // MRD NJD
int setmask();
virtual void init();
virtual void setup(int);
virtual void initial_integrate(int);
virtual void final_integrate();
void initial_integrate_respa(int, int, int);
void pre_force_respa(int, int, int);
void final_integrate_respa(int, int);
virtual void pre_exchange();
double compute_scalar();
virtual double compute_vector(int);
void write_restart(FILE *);
virtual int pack_restart_data(double *); // pack restart data
virtual int pack_restart_data(double *); // pack restart data
virtual void restart(char *);
int modify_param(int, char **);
void reset_target(double);
void reset_dt();
virtual void *extract(const char*,int &);
virtual void *extract(const char *, int &);
double memory_usage();
protected:
int dimension,which;
double dtv,dtf,dthalf,dt4,dt8,dto;
double boltz,nktv2p,tdof;
double vol0; // reference volume
double t0; // reference temperature
// used for barostat mass
double t_start,t_stop;
double t_current,t_target,ke_target;
int dimension, which;
double dtv, dtf, dthalf, dt4, dt8, dto;
double boltz, nktv2p, tdof;
double vol0; // reference volume
double t0; // reference temperature
// used for barostat mass
double t_start, t_stop;
double t_current, t_target, ke_target;
double t_freq;
int tstat_flag; // 1 if control T
int pstat_flag; // 1 if control P
int tstat_flag; // 1 if control T
int pstat_flag; // 1 if control P
int pstyle,pcouple,allremap;
int p_flag[6]; // 1 if control P on this dim, 0 if not
double p_start[6],p_stop[6];
double p_freq[6],p_target[6];
double omega[6],omega_dot[6];
int pstyle, pcouple, allremap;
int p_flag[6]; // 1 if control P on this dim, 0 if not
double p_start[6], p_stop[6];
double p_freq[6], p_target[6];
double omega[6], omega_dot[6];
double omega_mass[6];
double p_current[6];
double drag,tdrag_factor; // drag factor on particle thermostat
double pdrag_factor; // drag factor on barostat
int kspace_flag; // 1 if KSpace invoked, 0 if not
int nrigid; // number of rigid fixes
int dilate_group_bit; // mask for dilation group
int *rfix; // indices of rigid fixes
char *id_dilate; // group name to dilate
class Irregular *irregular; // for migrating atoms after box flips
double drag, tdrag_factor; // drag factor on particle thermostat
double pdrag_factor; // drag factor on barostat
int kspace_flag; // 1 if KSpace invoked, 0 if not
int nrigid; // number of rigid fixes
int dilate_group_bit; // mask for dilation group
int *rfix; // indices of rigid fixes
char *id_dilate; // group name to dilate
class Irregular *irregular; // for migrating atoms after box flips
// MRD NJD
// MRD NJD
int p_basis_type;
int p_match_flag;
double vavg;
int N_mol;
int N_p_match;
double *p_match_coeffs;
double ** splines;
double **splines;
int spline_length;
int nlevels_respa;
double *step_respa;
char *id_temp,*id_press;
class Compute *temperature,*pressure;
int tcomputeflag,pcomputeflag; // 1 = compute was created by fix
// 0 = created externally
char *id_temp, *id_press;
class Compute *temperature, *pressure;
int tcomputeflag, pcomputeflag; // 1 = compute was created by fix
// 0 = created externally
double *eta,*eta_dot; // chain thermostat for particles
double *eta, *eta_dot; // chain thermostat for particles
double *eta_dotdot;
double *eta_mass;
int mtchain; // length of chain
int mtchain_default_flag; // 1 = mtchain is default
int mtchain; // length of chain
int mtchain_default_flag; // 1 = mtchain is default
double *etap; // chain thermostat for barostat
double *etap; // chain thermostat for barostat
double *etap_dot;
double *etap_dotdot;
double *etap_mass;
int mpchain; // length of chain
int mpchain; // length of chain
int mtk_flag; // 0 if using Hoover barostat
int pdim; // number of barostatted dims
double p_freq_max; // maximum barostat frequency
int mtk_flag; // 0 if using Hoover barostat
int pdim; // number of barostatted dims
double p_freq_max; // maximum barostat frequency
double p_hydro; // hydrostatic target pressure
double p_hydro; // hydrostatic target pressure
int nc_tchain,nc_pchain;
int nc_tchain, nc_pchain;
double factor_eta;
double sigma[6]; // scaled target stress
double fdev[6]; // deviatoric force on barostat
int deviatoric_flag; // 0 if target stress tensor is hydrostatic
double h0_inv[6]; // h_inv of reference (zero strain) box
int nreset_h0; // interval for resetting h0
double sigma[6]; // scaled target stress
double fdev[6]; // deviatoric force on barostat
int deviatoric_flag; // 0 if target stress tensor is hydrostatic
double h0_inv[6]; // h_inv of reference (zero strain) box
int nreset_h0; // interval for resetting h0
double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections
double mtk_term1, mtk_term2; // Martyna-Tobias-Klein corrections
int eta_mass_flag; // 1 if eta_mass updated, 0 if not.
int omega_mass_flag; // 1 if omega_mass updated, 0 if not.
int etap_mass_flag; // 1 if etap_mass updated, 0 if not.
int dipole_flag; // 1 if dipole is updated, 0 if not.
int dlm_flag; // 1 if using the DLM rotational integrator, 0 if not
int eta_mass_flag; // 1 if eta_mass updated, 0 if not.
int omega_mass_flag; // 1 if omega_mass updated, 0 if not.
int etap_mass_flag; // 1 if etap_mass updated, 0 if not.
int dipole_flag; // 1 if dipole is updated, 0 if not.
int dlm_flag; // 1 if using the DLM rotational integrator, 0 if not
int scaleyz; // 1 if yz scaled with lz
int scalexz; // 1 if xz scaled with lz
int scalexy; // 1 if xy scaled with ly
int flipflag; // 1 if box flips are invoked as needed
int scaleyz; // 1 if yz scaled with lz
int scalexz; // 1 if xz scaled with lz
int scalexy; // 1 if xy scaled with ly
int flipflag; // 1 if box flips are invoked as needed
int pre_exchange_flag; // set if pre_exchange needed for box flips
int pre_exchange_flag; // set if pre_exchange needed for box flips
double fixedpoint[3]; // location of dilation fixed-point
double fixedpoint[3]; // location of dilation fixed-point
void couple();
virtual void remap();
@ -153,7 +151,7 @@ class FixBocs : public Fix {
int build_linear_splines(double **);
int build_cubic_splines(double **);
virtual void nve_x(); // may be overwritten by child classes
virtual void nve_x(); // may be overwritten by child classes
virtual void nve_v();
virtual void nh_v_press();
virtual void nh_v_temp();
@ -167,7 +165,7 @@ class FixBocs : public Fix {
void nh_omega_dot();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,16 +12,16 @@
------------------------------------------------------------------------- */
#ifdef BODY_CLASS
BodyStyle(nparticle,BodyNparticle)
// clang-format off
BodyStyle(nparticle,BodyNparticle);
// clang-format on
#else
#ifndef LMP_BODY_NPARTICLE_H
#define LMP_BODY_NPARTICLE_H
#include "body.h"
#include "atom_vec_body.h"
#include "body.h"
namespace LAMMPS_NS {
@ -49,7 +49,7 @@ class BodyNparticle : public Body {
double **imdata;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,16 +12,16 @@
------------------------------------------------------------------------- */
#ifdef BODY_CLASS
BodyStyle(rounded/polygon,BodyRoundedPolygon)
// clang-format off
BodyStyle(rounded/polygon,BodyRoundedPolygon);
// clang-format on
#else
#ifndef LMP_BODY_ROUNDED_POLYGON_H
#define LMP_BODY_ROUNDED_POLYGON_H
#include "body.h"
#include "atom_vec_body.h"
#include "body.h"
namespace LAMMPS_NS {
@ -53,7 +53,7 @@ class BodyRoundedPolygon : public Body {
double **imdata;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,16 +12,16 @@
------------------------------------------------------------------------- */
#ifdef BODY_CLASS
BodyStyle(rounded/polyhedron,BodyRoundedPolyhedron)
// clang-format off
BodyStyle(rounded/polyhedron,BodyRoundedPolyhedron);
// clang-format on
#else
#ifndef LMP_BODY_ROUNDED_POLYHEDRON_H
#define LMP_BODY_ROUNDED_POLYHEDRON_H
#include "body.h"
#include "atom_vec_body.h"
#include "body.h"
namespace LAMMPS_NS {
@ -55,7 +55,7 @@ class BodyRoundedPolyhedron : public Body {
double **imdata;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(body/local,ComputeBodyLocal)
// clang-format off
ComputeStyle(body/local,ComputeBodyLocal);
// clang-format on
#else
#ifndef LMP_COMPUTE_BODY_LOCAL_H
@ -34,7 +34,7 @@ class ComputeBodyLocal : public Compute {
private:
int nvalues;
int *which,*index;
int *which, *index;
int nmax;
@ -45,7 +45,7 @@ class ComputeBodyLocal : public Compute {
void reallocate(int);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(temp/body,ComputeTempBody)
// clang-format off
ComputeStyle(temp/body,ComputeTempBody);
// clang-format on
#else
#ifndef LMP_COMPUTE_TEMP_BODY_H
@ -40,13 +40,13 @@ class ComputeTempBody : public Compute {
int mode;
double tfactor;
char *id_bias;
class Compute *tbias; // ptr to additional bias compute
class Compute *tbias; // ptr to additional bias compute
class AtomVecBody *avec;
void dof_compute();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -33,7 +33,7 @@ class FixNHBody : public FixNH {
void nh_v_temp();
};
}
} // namespace LAMMPS_NS
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nph/body,FixNPHBody)
// clang-format off
FixStyle(nph/body,FixNPHBody);
// clang-format on
#else
#ifndef LMP_FIX_NPH_BODY_H
@ -30,7 +30,7 @@ class FixNPHBody : public FixNHBody {
~FixNPHBody() {}
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(npt/body,FixNPTBody)
// clang-format off
FixStyle(npt/body,FixNPTBody);
// clang-format on
#else
#ifndef LMP_FIX_NPT_BODY_H
@ -30,7 +30,7 @@ class FixNPTBody : public FixNHBody {
~FixNPTBody() {}
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nve/body,FixNVEBody)
// clang-format off
FixStyle(nve/body,FixNVEBody);
// clang-format on
#else
#ifndef LMP_FIX_NVE_BODY_H
@ -36,7 +36,7 @@ class FixNVEBody : public FixNVE {
class AtomVecBody *avec;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nvt/body,FixNVTBody)
// clang-format off
FixStyle(nvt/body,FixNVTBody);
// clang-format on
#else
#ifndef LMP_FIX_NVT_BODY_H
@ -30,7 +30,7 @@ class FixNVTBody : public FixNHBody {
~FixNVTBody() {}
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -99,7 +100,7 @@ FixWallBodyPolygon::FixWallBodyPolygon(LAMMPS *lmp, int narg, char **arg) :
lo = hi = 0.0;
cylradius = utils::numeric(FLERR,arg[iarg+1],false,lmp);
iarg += 2;
} else error->all(FLERR,fmt::format("Unknown wall style {}",arg[iarg]));
} else error->all(FLERR,"Unknown wall style {}",arg[iarg]);
// check for trailing keyword/values
@ -336,8 +337,7 @@ void FixWallBodyPolygon::post_force(int /*vflag*/)
num_contacts = 0;
facc[0] = facc[1] = facc[2] = 0;
vertex_against_wall(i, wall_pos, x, f, torque, side,
contact_list, num_contacts, facc);
vertex_against_wall(i, wall_pos, x, f, torque, side, contact_list, num_contacts, facc);
if (num_contacts >= 2) {

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(wall/body/polygon,FixWallBodyPolygon)
// clang-format off
FixStyle(wall/body/polygon,FixWallBodyPolygon);
// clang-format on
#else
#ifndef LMP_FIX_WALL_BODY_POLYGON_H
@ -35,66 +35,61 @@ class FixWallBodyPolygon : public Fix {
void reset_dt();
struct Contact {
int ibody, jbody; // body (i.e. atom) indices (not tags)
int vertex; // vertex of the first polygon
int edge; // edge of the second polygon
double xv[3]; // coordinates of the vertex
double xe[3]; // coordinates of the projection of the vertex on the edge
double separation;// separation at contact
int ibody, jbody; // body (i.e. atom) indices (not tags)
int vertex; // vertex of the first polygon
int edge; // edge of the second polygon
double xv[3]; // coordinates of the vertex
double xe[3]; // coordinates of the projection of the vertex on the edge
double separation; // separation at contact
};
protected:
int wallstyle,pairstyle,wiggle,axis;
double kn; // normal repulsion strength
double c_n; // normal damping coefficient
double c_t; // tangential damping coefficient
double lo,hi,cylradius;
double amplitude,period,omega;
int wallstyle, pairstyle, wiggle, axis;
double kn; // normal repulsion strength
double c_n; // normal damping coefficient
double c_t; // tangential damping coefficient
double lo, hi, cylradius;
double amplitude, period, omega;
double dt;
int time_origin;
class AtomVecBody *avec;
class BodyRoundedPolygon *bptr;
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
void body2space(int);
int vertex_against_wall(int ibody, double wall_pos, double** x,
double** f, double** torque, int side,
Contact* contact_list, int &num_contacts,
double* facc);
int compute_distance_to_wall(double* x0, double rradi, double wall_pos,
int side, double &d, double hi[3], int &contact);
double contact_separation(const Contact& c1, const Contact& c2);
void contact_forces(Contact& contact, double j_a, double** x,
double** v, double** angmom, double** f, double** torque,
double* vwall, double* facc);
void sum_torque(double* xm, double *x, double fx,
double fy, double fz, double* torque);
void total_velocity(double* p, double *xcm, double* vcm, double *angmom,
double *inertia, double *quat, double* vi);
void distance(const double* x2, const double* x1, double& r);
int vertex_against_wall(int ibody, double wall_pos, double **x, double **f, double **torque,
int side, Contact *contact_list, int &num_contacts, double *facc);
int compute_distance_to_wall(double *x0, double rradi, double wall_pos, int side, double &d,
double hi[3], int &contact);
double contact_separation(const Contact &c1, const Contact &c2);
void contact_forces(Contact &contact, double j_a, double **x, double **v, double **angmom,
double **f, double **torque, double *vwall, double *facc);
void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque);
void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia,
double *quat, double *vi);
void distance(const double *x2, const double *x1, double &r);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -99,7 +100,7 @@ FixWallBodyPolyhedron::FixWallBodyPolyhedron(LAMMPS *lmp, int narg, char **arg)
if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG;
else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp);
iarg += 3;
} else error->all(FLERR,fmt::format("Unknown wall style {}",arg[iarg]));
} else error->all(FLERR,"Unknown wall style {}",arg[iarg]);
// check for trailing keyword/values

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(wall/body/polyhedron,FixWallBodyPolyhedron)
// clang-format off
FixStyle(wall/body/polyhedron,FixWallBodyPolyhedron);
// clang-format on
#else
#ifndef LMP_FIX_WALL_BODY_POLYHERON_H
@ -35,78 +35,72 @@ class FixWallBodyPolyhedron : public Fix {
void reset_dt();
struct Contact {
int ibody, jbody; // body (i.e. atom) indices (not tags)
int vertex; // vertex of the first polygon
int edge; // edge of the second polygon
double xv[3]; // coordinates of the vertex
double xe[3]; // coordinates of the projection of the vertex on the edge
double separation;// separation at contact
int ibody, jbody; // body (i.e. atom) indices (not tags)
int vertex; // vertex of the first polygon
int edge; // edge of the second polygon
double xv[3]; // coordinates of the vertex
double xe[3]; // coordinates of the projection of the vertex on the edge
double separation; // separation at contact
};
protected:
int wallstyle,pairstyle,wiggle,axis;
double kn,c_n,c_t;
double lo,hi,cylradius;
double amplitude,period,omega;
int wallstyle, pairstyle, wiggle, axis;
double kn, c_n, c_t;
double lo, hi, cylradius;
double amplitude, period, omega;
double dt;
int time_origin;
class AtomVecBody *avec;
class BodyRoundedPolyhedron *bptr;
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double **face; // list of all edge for all bodies
int nface; // number of faces in list
int facmax; // allocated size of face list
int *facnum; // number of faces per line, 0 if uninit
int *facfirst; // index of first face per each line
int facnummax; // allocated size of facnum,facfirst vectors
double **face; // list of all edge for all bodies
int nface; // number of faces in list
int facmax; // allocated size of face list
int *facnum; // number of faces per line, 0 if uninit
int *facfirst; // index of first face per each line
int facnummax; // allocated size of facnum,facfirst vectors
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
void body2space(int);
int edge_against_wall(int ibody, double wall_pos, int side, double* vwall,
double** x, double** f, double** torque, Contact* contact_list,
int &num_contacts, double* facc);
int sphere_against_wall(int i, double wall_pos, int side, double* vwall,
double** x, double** v, double** f, double** angmom, double** torque);
int edge_against_wall(int ibody, double wall_pos, int side, double *vwall, double **x, double **f,
double **torque, Contact *contact_list, int &num_contacts, double *facc);
int sphere_against_wall(int i, double wall_pos, int side, double *vwall, double **x, double **v,
double **f, double **angmom, double **torque);
int compute_distance_to_wall(int ibody, int edge_index, double *xmi,
double rounded_radius_i, double wall_pos, int side,
double* vwall, int &contact);
double contact_separation(const Contact& c1, const Contact& c2);
void contact_forces(int ibody, double j_a, double *xi, double *xj,
double delx, double dely, double delz,
double fx, double fy, double fz, double** x, double** v,
double** angmom, double** f, double** torque, double* vwall);
void contact_forces(Contact& contact, double j_a, double** x,
double** v, double** angmom, double** f, double** torque,
double* vwall, double* facc);
void sum_torque(double* xm, double *x, double fx,
double fy, double fz, double* torque);
void total_velocity(double* p, double *xcm, double* vcm, double *angmom,
double *inertia, double *quat, double* vi);
void distance(const double* x2, const double* x1, double& r);
int compute_distance_to_wall(int ibody, int edge_index, double *xmi, double rounded_radius_i,
double wall_pos, int side, double *vwall, int &contact);
double contact_separation(const Contact &c1, const Contact &c2);
void contact_forces(int ibody, double j_a, double *xi, double *xj, double delx, double dely,
double delz, double fx, double fy, double fz, double **x, double **v,
double **angmom, double **f, double **torque, double *vwall);
void contact_forces(Contact &contact, double j_a, double **x, double **v, double **angmom,
double **f, double **torque, double *vwall, double *facc);
void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque);
void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia,
double *quat, double *vi);
void distance(const double *x2, const double *x1, double &r);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -323,8 +324,7 @@ void PairBodyNparticle::compute(int eflag, int vflag)
}
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
if (evflag) ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz);
}
}

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(body/nparticle,PairBodyNparticle)
// clang-format off
PairStyle(body/nparticle,PairBodyNparticle);
// clang-format on
#else
#ifndef LMP_PAIR_BODY_NPARTICLE_H
@ -37,24 +37,24 @@ class PairBodyNparticle : public Pair {
protected:
double cut_global;
double **cut;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4;
double **epsilon, **sigma;
double **lj1, **lj2, **lj3, **lj4;
class AtomVecBody *avec;
class BodyNparticle *bptr;
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
void allocate();
void body2space(int);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -20,21 +21,21 @@
#include "pair_body_rounded_polygon.h"
#include <cmath>
#include <cstring>
#include "math_extra.h"
#include "atom.h"
#include "atom_vec_body.h"
#include "body_rounded_polygon.h"
#include "comm.h"
#include "force.h"
#include "fix.h"
#include "modify.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "memory.h"
#include "error.h"
#include "fix.h"
#include "force.h"
#include "math_extra.h"
#include "memory.h"
#include "modify.h"
#include "neigh_list.h"
#include "neighbor.h"
#include <cmath>
#include <cstring>
using namespace LAMMPS_NS;
@ -206,8 +207,7 @@ void PairBodyRoundedPolygon::compute(int eflag, int vflag)
if (r > radi + radj + cut_inner) continue;
if (npi == 1 && npj == 1) {
sphere_against_sphere(i, j, delx, dely, delz, rsq,
k_nij, k_naij, x, v, f, evflag);
sphere_against_sphere(i, j, delx, dely, delz, rsq, k_nij, k_naij, x, v, f, evflag);
continue;
}
@ -570,8 +570,8 @@ void PairBodyRoundedPolygon::body2space(int i)
}
if ((body_num_edges > 0) && (edge_ends == nullptr))
error->one(FLERR,fmt::format("Inconsistent edge data for body of atom {}",
atom->tag[i]));
error->one(FLERR,"Inconsistent edge data for body of atom {}",
atom->tag[i]);
for (int m = 0; m < body_num_edges; m++) {
edge[nedge][0] = static_cast<int>(edge_ends[2*m+0]);

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(body/rounded/polygon,PairBodyRoundedPolygon)
// clang-format off
PairStyle(body/rounded/polygon,PairBodyRoundedPolygon);
// clang-format on
#else
#ifndef LMP_PAIR_BODY_ROUNDED_POLYGON_H
@ -35,81 +35,76 @@ class PairBodyRoundedPolygon : public Pair {
double init_one(int, int);
struct Contact {
int ibody, jbody; // body (i.e. atom) indices (not tags)
int vertex; // vertex of the first polygon
int edge; // edge of the second polygon
double xv[3]; // coordinates of the vertex
double xe[3]; // coordinates of the projection of the vertex on the edge
double separation;// separation at contact
int ibody, jbody; // body (i.e. atom) indices (not tags)
int vertex; // vertex of the first polygon
int edge; // edge of the second polygon
double xv[3]; // coordinates of the vertex
double xe[3]; // coordinates of the projection of the vertex on the edge
double separation; // separation at contact
};
protected:
double **k_n; // normal repulsion strength
double **k_na; // normal attraction strength
double c_n; // normal damping coefficient
double c_t; // tangential damping coefficient
double mu; // normal friction coefficient during gross sliding
double delta_ua; // contact line (area for 3D models) modification factor
double cut_inner; // cutoff for interaction between vertex-edge surfaces
double **k_n; // normal repulsion strength
double **k_na; // normal attraction strength
double c_n; // normal damping coefficient
double c_t; // tangential damping coefficient
double mu; // normal friction coefficient during gross sliding
double delta_ua; // contact line (area for 3D models) modification factor
double cut_inner; // cutoff for interaction between vertex-edge surfaces
class AtomVecBody *avec;
class BodyRoundedPolygon *bptr;
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
double *maxerad; // per-type maximum enclosing radius
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
double *maxerad; // per-type maximum enclosing radius
void allocate();
void body2space(int);
// sphere-sphere interaction
void sphere_against_sphere(int i, int j, double delx, double dely, double delz,
double rsq, double k_n, double k_na,
double** x, double** v, double** f, int evflag);
void sphere_against_sphere(int i, int j, double delx, double dely, double delz, double rsq,
double k_n, double k_na, double **x, double **v, double **f,
int evflag);
// vertex-edge interaction
int vertex_against_edge(int i, int j, double k_n, double k_na,
double** x, double** f, double** torque,
tagint* tag, Contact* contact_list,
int &num_contacts, double &evdwl, double* facc);
int vertex_against_edge(int i, int j, double k_n, double k_na, double **x, double **f,
double **torque, tagint *tag, Contact *contact_list, int &num_contacts,
double &evdwl, double *facc);
// compute distance between a point and an edge from another body
int compute_distance_to_vertex(int ibody, int edge_index, double* xmi,
double rounded_radius, double* x0,
double x0_rounded_radius, double cut_inner,
double &d, double hi[3], double &t,
int &contact);
int compute_distance_to_vertex(int ibody, int edge_index, double *xmi, double rounded_radius,
double *x0, double x0_rounded_radius, double cut_inner, double &d,
double hi[3], double &t, int &contact);
// compute contact forces if contact points are detected
void contact_forces(Contact& contact, double j_a,
double** x, double** v, double** angmom, double** f,
double** torque, double &evdwl, double* facc);
void contact_forces(Contact &contact, double j_a, double **x, double **v, double **angmom,
double **f, double **torque, double &evdwl, double *facc);
// compute the separation between two contacts
double contact_separation(const Contact& c1, const Contact& c2);
double contact_separation(const Contact &c1, const Contact &c2);
// accumulate torque to a body given a force at a given point
void sum_torque(double* xm, double *x, double fx,
double fy, double fz, double* torque);
void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque);
// helper functions
int opposite_sides(double* x1, double* x2, double* a, double* b);
void total_velocity(double* p, double *xcm, double* vcm, double *angmom,
double *inertia, double *quat, double* vi);
inline void distance(const double* x2, const double* x1, double& r);
int opposite_sides(double *x1, double *x2, double *a, double *b);
void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia,
double *quat, double *vi);
inline void distance(const double *x2, const double *x1, double &r);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -1,6 +1,7 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -22,22 +23,22 @@
#include "pair_body_rounded_polyhedron.h"
#include <cmath>
#include <cstring>
#include "atom.h"
#include "atom_vec_body.h"
#include "body_rounded_polyhedron.h"
#include "comm.h"
#include "force.h"
#include "fix.h"
#include "modify.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "memory.h"
#include "error.h"
#include "math_extra.h"
#include "fix.h"
#include "force.h"
#include "math_const.h"
#include "math_extra.h"
#include "memory.h"
#include "modify.h"
#include "neigh_list.h"
#include "neighbor.h"
#include <cmath>
#include <cstring>
using namespace LAMMPS_NS;
using namespace MathConst;
@ -557,8 +558,8 @@ void PairBodyRoundedPolyhedron::body2space(int i)
}
if ((body_num_edges > 0) && (edge_ends == nullptr))
error->one(FLERR,fmt::format("Inconsistent edge data for body of atom {}",
atom->tag[i]));
error->one(FLERR,"Inconsistent edge data for body of atom {}",
atom->tag[i]);
for (int m = 0; m < body_num_edges; m++) {
edge[nedge][0] = static_cast<int>(edge_ends[2*m+0]);
@ -584,8 +585,8 @@ void PairBodyRoundedPolyhedron::body2space(int i)
}
if ((body_num_faces > 0) && (face_pts == nullptr))
error->one(FLERR,fmt::format("Inconsistent face data for body of atom {}",
atom->tag[i]));
error->one(FLERR,"Inconsistent face data for body of atom {}",
atom->tag[i]);
for (int m = 0; m < body_num_faces; m++) {
for (int k = 0; k < MAX_FACE_SIZE; k++)
@ -1211,10 +1212,7 @@ int PairBodyRoundedPolyhedron::interaction_edge_to_edge(int ibody,
contact_list[num_contacts].unique = 1;
num_contacts++;
}
} else {
}
return interact;
}

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -12,9 +12,9 @@
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(body/rounded/polyhedron,PairBodyRoundedPolyhedron)
// clang-format off
PairStyle(body/rounded/polyhedron,PairBodyRoundedPolyhedron);
// clang-format on
#else
#ifndef LMP_PAIR_BODY_ROUNDED_POLYHEDRON_H
@ -34,145 +34,131 @@ class PairBodyRoundedPolyhedron : public Pair {
void init_style();
double init_one(int, int);
virtual void kernel_force(double R, int itype, int jtype,
double& energy, double& fpair);
virtual void kernel_force(double R, int itype, int jtype, double &energy, double &fpair);
struct Contact {
int ibody, jbody; // body (i.e. atom) indices (not tags)
int type; // 0 = VERTEX-FACE; 1 = EDGE-EDGE
double fx,fy,fz; // unscaled cohesive forces at contact
double xi[3]; // coordinates of the contact point on ibody
double xj[3]; // coordinates of the contact point on jbody
double separation; // contact surface separation
int ibody, jbody; // body (i.e. atom) indices (not tags)
int type; // 0 = VERTEX-FACE; 1 = EDGE-EDGE
double fx, fy, fz; // unscaled cohesive forces at contact
double xi[3]; // coordinates of the contact point on ibody
double xj[3]; // coordinates of the contact point on jbody
double separation; // contact surface separation
int unique;
};
protected:
double **k_n; // normal repulsion strength
double **k_na; // normal attraction strength
double c_n; // normal damping coefficient
double c_t; // tangential damping coefficient
double mu; // normal friction coefficient during gross sliding
double A_ua; // characteristic contact area
double cut_inner; // cutoff for interaction between vertex-edge surfaces
double **k_n; // normal repulsion strength
double **k_na; // normal attraction strength
double c_n; // normal damping coefficient
double c_t; // tangential damping coefficient
double mu; // normal friction coefficient during gross sliding
double A_ua; // characteristic contact area
double cut_inner; // cutoff for interaction between vertex-edge surfaces
class AtomVecBody *avec;
class BodyRoundedPolyhedron *bptr;
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **discrete; // list of all sub-particles for all bodies
int ndiscrete; // number of discretes in list
int dmax; // allocated size of discrete list
int *dnum; // number of discretes per line, 0 if uninit
int *dfirst; // index of first discrete per each line
int nmax; // allocated size of dnum,dfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double **edge; // list of all edge for all bodies
int nedge; // number of edge in list
int edmax; // allocated size of edge list
int *ednum; // number of edges per line, 0 if uninit
int *edfirst; // index of first edge per each line
int ednummax; // allocated size of ednum,edfirst vectors
double **face; // list of all edge for all bodies
int nface; // number of faces in list
int facmax; // allocated size of face list
int *facnum; // number of faces per line, 0 if uninit
int *facfirst; // index of first face per each line
int facnummax; // allocated size of facnum,facfirst vectors
double **face; // list of all edge for all bodies
int nface; // number of faces in list
int facmax; // allocated size of face list
int *facnum; // number of faces per line, 0 if uninit
int *facfirst; // index of first face per each line
int facnummax; // allocated size of facnum,facfirst vectors
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
double *maxerad; // per-type maximum enclosing radius
double *enclosing_radius; // enclosing radii for all bodies
double *rounded_radius; // rounded radii for all bodies
double *maxerad; // per-type maximum enclosing radius
void allocate();
void body2space(int);
// sphere-sphere interaction
void sphere_against_sphere(int ibody, int jbody, int itype, int jtype,
double delx, double dely, double delz, double rsq,
double** v, double** f, int evflag);
void sphere_against_sphere(int ibody, int jbody, int itype, int jtype, double delx, double dely,
double delz, double rsq, double **v, double **f, int evflag);
// sphere-edge interaction
void sphere_against_edge(int ibody, int jbody, int itype, int jtype,
double** x, double** v, double** f, double** torque,
double** angmom, int evflag);
void sphere_against_edge(int ibody, int jbody, int itype, int jtype, double **x, double **v,
double **f, double **torque, double **angmom, int evflag);
// sphere-face interaction
void sphere_against_face(int ibody, int jbody, int itype, int jtype,
double** x, double** v, double** f, double** torque,
double** angmom, int evflag);
void sphere_against_face(int ibody, int jbody, int itype, int jtype, double **x, double **v,
double **f, double **torque, double **angmom, int evflag);
// edge-edge interactions
int edge_against_edge(int ibody, int jbody, int itype, int jtype,
double** x,Contact* contact_list, int &num_contacts,
double &evdwl, double* facc);
int edge_against_edge(int ibody, int jbody, int itype, int jtype, double **x,
Contact *contact_list, int &num_contacts, double &evdwl, double *facc);
// edge-face interactions
int edge_against_face(int ibody, int jbody, int itype, int jtype,
double** x, Contact* contact_list, int &num_contacts,
double &evdwl, double* facc);
int edge_against_face(int ibody, int jbody, int itype, int jtype, double **x,
Contact *contact_list, int &num_contacts, double &evdwl, double *facc);
// a face vs. a single edge
int interaction_face_to_edge(int ibody, int face_index, double* xmi,
double rounded_radius_i, int jbody, int edge_index,
double* xmj, double rounded_radius_j,
int itype, int jtype, double cut_inner,
Contact* contact_list, int &num_contacts,
double& energy, double* facc);
int interaction_face_to_edge(int ibody, int face_index, double *xmi, double rounded_radius_i,
int jbody, int edge_index, double *xmj, double rounded_radius_j,
int itype, int jtype, double cut_inner, Contact *contact_list,
int &num_contacts, double &energy, double *facc);
// an edge vs. an edge from another body
int interaction_edge_to_edge(int ibody, int edge_index_i, double* xmi,
double rounded_radius_i, int jbody, int edge_index_j,
double* xmj, double rounded_radius_j,
int itype, int jtype, double cut_inner,
Contact* contact_list, int &num_contacts,
double& energy, double* facc);
int interaction_edge_to_edge(int ibody, int edge_index_i, double *xmi, double rounded_radius_i,
int jbody, int edge_index_j, double *xmj, double rounded_radius_j,
int itype, int jtype, double cut_inner, Contact *contact_list,
int &num_contacts, double &energy, double *facc);
// compute contact forces if contact points are detected
void contact_forces(int ibody, int jbody, double *xi, double *xj,
double delx, double dely, double delz, double fx, double fy, double fz,
double** x, double** v, double** angmom, double** f, double** torque,
double* facc);
void contact_forces(int ibody, int jbody, double *xi, double *xj, double delx, double dely,
double delz, double fx, double fy, double fz, double **x, double **v,
double **angmom, double **f, double **torque, double *facc);
// compute force and torque between two bodies given a pair of interacting points
void pair_force_and_torque(int ibody, int jbody, double* pi, double* pj,
double r, double contact_dist, int itype, int jtype,
double** x, double** v, double** f, double** torque,
double** angmom, int jflag, double& energy, double* facc);
void pair_force_and_torque(int ibody, int jbody, double *pi, double *pj, double r,
double contact_dist, int itype, int jtype, double **x, double **v,
double **f, double **torque, double **angmom, int jflag,
double &energy, double *facc);
// rescale the cohesive forces if a contact area is detected
void rescale_cohesive_forces(double** x, double** f, double** torque,
Contact* contact_list, int &num_contacts,
int itype, int jtype, double* facc);
void rescale_cohesive_forces(double **x, double **f, double **torque, Contact *contact_list,
int &num_contacts, int itype, int jtype, double *facc);
// compute the separation between two contacts
double contact_separation(const Contact& c1, const Contact& c2);
double contact_separation(const Contact &c1, const Contact &c2);
// detect the unique contact points (as there may be double counts)
void find_unique_contacts(Contact* contact_list, int& num_contacts);
void find_unique_contacts(Contact *contact_list, int &num_contacts);
// accumulate torque to a body given a force at a given point
void sum_torque(double* xm, double *x, double fx, double fy, double fz, double* torque);
void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque);
// find the intersection point (if any) between an edge and a face
int edge_face_intersect(double* x1, double* x2, double* x3, double* a, double* b,
double* hi1, double* hi2, double& d1, double& d2,
int& inside_a, int& inside_b);
int edge_face_intersect(double *x1, double *x2, double *x3, double *a, double *b, double *hi1,
double *hi2, double &d1, double &d2, int &inside_a, int &inside_b);
// helper functions
int opposite_sides(double* n, double* x0, double* a, double* b);
void project_pt_plane(const double* q, const double* p,
const double* n, double* q_proj, double &d);
void project_pt_plane(const double* q, const double* x1, const double* x2,
const double* x3, double* q_proj, double &d, int& inside);
void project_pt_line(const double* q, const double* xi1, const double* xi2,
double* h, double& d, double& t);
void inside_polygon(int ibody, int face_index, double* xmi,
const double* q1, const double* q2, int& inside1, int& inside2);
int opposite_sides(double *n, double *x0, double *a, double *b);
void project_pt_plane(const double *q, const double *p, const double *n, double *q_proj,
double &d);
void project_pt_plane(const double *q, const double *x1, const double *x2, const double *x3,
double *q_proj, double &d, int &inside);
void project_pt_line(const double *q, const double *xi1, const double *xi2, double *h, double &d,
double &t);
void inside_polygon(int ibody, int face_index, double *xmi, const double *q1, const double *q2,
int &inside1, int &inside2);
void distance_bt_edges(const double* x1, const double* x2,
const double* x3, const double* x4,
double* h1, double* h2, double& t1, double& t2, double& r);
void total_velocity(double* p, double *xcm, double* vcm, double *angmom,
double *inertia, double *quat, double* vi);
void distance_bt_edges(const double *x1, const double *x2, const double *x3, const double *x4,
double *h1, double *h2, double &t1, double &t2, double &r);
void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia,
double *quat, double *vi);
void sanity_check();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -0,0 +1,130 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/ Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Originally modified from CG-DNA/fix_nve_dotc_langevin.cpp.
Contributing author: Sam Cameron (University of Bristol)
------------------------------------------------------------------------- */
#include "fix_brownian.h"
#include "atom.h"
#include "domain.h"
#include "error.h"
#include "random_mars.h"
#include <cmath>
using namespace LAMMPS_NS;
using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixBrownian::FixBrownian(LAMMPS *lmp, int narg, char **arg) : FixBrownianBase(lmp, narg, arg)
{
if (dipole_flag || gamma_t_eigen_flag || gamma_r_eigen_flag || gamma_r_flag) {
error->all(FLERR, "Illegal fix brownian command.");
}
if (!gamma_t_flag) { error->all(FLERR, "Illegal fix brownian command."); }
}
/* ---------------------------------------------------------------------- */
void FixBrownian::init()
{
FixBrownianBase::init();
g1 /= gamma_t;
g2 /= sqrt(gamma_t);
}
/* ---------------------------------------------------------------------- */
void FixBrownian::initial_integrate(int /*vflag */)
{
if (domain->dimension == 2) {
if (!noise_flag) {
initial_integrate_templated<0, 0, 1>();
} else if (gaussian_noise_flag) {
initial_integrate_templated<0, 1, 1>();
} else {
initial_integrate_templated<1, 0, 1>();
}
} else {
if (!noise_flag) {
initial_integrate_templated<0, 0, 0>();
} else if (gaussian_noise_flag) {
initial_integrate_templated<0, 1, 0>();
} else {
initial_integrate_templated<1, 0, 0>();
}
}
return;
}
/* ---------------------------------------------------------------------- */
template <int Tp_UNIFORM, int Tp_GAUSS, int Tp_2D> void FixBrownian::initial_integrate_templated()
{
double **x = atom->x;
double **v = atom->v;
double **f = atom->f;
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
double dx, dy, dz;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
if (Tp_2D) {
dz = 0;
if (Tp_UNIFORM) {
dx = dt * (g1 * f[i][0] + g2 * (rng->uniform() - 0.5));
dy = dt * (g1 * f[i][1] + g2 * (rng->uniform() - 0.5));
} else if (Tp_GAUSS) {
dx = dt * (g1 * f[i][0] + g2 * rng->gaussian());
dy = dt * (g1 * f[i][1] + g2 * rng->gaussian());
} else {
dx = dt * g1 * f[i][0];
dy = dt * g1 * f[i][1];
}
} else {
if (Tp_UNIFORM) {
dx = dt * (g1 * f[i][0] + g2 * (rng->uniform() - 0.5));
dy = dt * (g1 * f[i][1] + g2 * (rng->uniform() - 0.5));
dz = dt * (g1 * f[i][2] + g2 * (rng->uniform() - 0.5));
} else if (Tp_GAUSS) {
dx = dt * (g1 * f[i][0] + g2 * rng->gaussian());
dy = dt * (g1 * f[i][1] + g2 * rng->gaussian());
dz = dt * (g1 * f[i][2] + g2 * rng->gaussian());
} else {
dx = dt * g1 * f[i][0];
dy = dt * g1 * f[i][1];
dz = dt * g1 * f[i][2];
}
}
x[i][0] += dx;
v[i][0] = dx / dt;
x[i][1] += dy;
v[i][1] = dy / dt;
x[i][2] += dz;
v[i][2] = dz / dt;
}
}
return;
}

View File

@ -0,0 +1,60 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/ Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
// clang-format off
FixStyle(brownian,FixBrownian);
// clang-format on
#else
#ifndef LMP_FIX_BROWNIAN_H
#define LMP_FIX_BROWNIAN_H
#include "fix_brownian_base.h"
namespace LAMMPS_NS {
class FixBrownian : public FixBrownianBase {
public:
FixBrownian(class LAMMPS *, int, char **);
virtual ~FixBrownian(){};
void init();
void initial_integrate(int);
private:
template <int Tp_UNIFORM, int Tp_GAUSS, int Tp_2D> void initial_integrate_templated();
};
} // namespace LAMMPS_NS
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal fix brownian command.
Wrong number/type of input arguments.
E: Fix brownian viscous drag coefficient must be > 0.
Self-explanatory.
E: Fix brownian diffusion coefficient must be > 0.
Self-explanatory.
E: Fix brownian seed must be > 0.
Self-explanatory.
*/

View File

@ -0,0 +1,264 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/ Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Originally modified from CG-DNA/fix_nve_dotc_langevin.cpp.
Contributing author: Sam Cameron (University of Bristol)
------------------------------------------------------------------------- */
#include "fix_brownian_asphere.h"
#include "atom.h"
#include "atom_vec_ellipsoid.h"
#include "domain.h"
#include "error.h"
#include "math_extra.h"
#include "random_mars.h"
using namespace LAMMPS_NS;
using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixBrownianAsphere::FixBrownianAsphere(LAMMPS *lmp, int narg, char **arg) :
FixBrownianBase(lmp, narg, arg), avec(nullptr)
{
if (!gamma_t_eigen_flag || !gamma_r_eigen_flag) {
error->all(FLERR, "Illegal fix brownian command.");
}
if (gamma_t_flag || gamma_r_flag) error->all(FLERR, "Illegal fix brownian command.");
if (dipole_flag && !atom->mu_flag)
error->all(FLERR, "Fix brownian/asphere dipole requires atom attribute mu");
}
/* ---------------------------------------------------------------------- */
void FixBrownianAsphere::init()
{
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec) error->all(FLERR, "Compute brownian/asphere requires atom style ellipsoid");
// check that all particles are finite-size ellipsoids
// no point particles allowed, spherical is OK
int *ellipsoid = atom->ellipsoid;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (ellipsoid[i] < 0) error->one(FLERR, "Fix brownian/asphere requires extended particles");
if (dipole_flag) {
double f_rot[3];
double *quat;
AtomVecEllipsoid::Bonus *bonus = avec->bonus;
double Q[3][3];
double **mu = atom->mu;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
quat = bonus[ellipsoid[i]].quat;
MathExtra::quat_to_mat(quat, Q);
MathExtra::matvec(Q, dipole_body, f_rot);
mu[i][0] = f_rot[0];
mu[i][1] = f_rot[1];
mu[i][2] = f_rot[2];
}
}
}
FixBrownianBase::init();
}
/* ---------------------------------------------------------------------- */
void FixBrownianAsphere::initial_integrate(int /*vflag */)
{
if (domain->dimension == 2) {
if (dipole_flag) {
if (!noise_flag) {
initial_integrate_templated<0, 0, 1, 1>();
} else if (gaussian_noise_flag) {
initial_integrate_templated<0, 1, 1, 1>();
} else {
initial_integrate_templated<1, 0, 1, 1>();
}
} else {
if (!noise_flag) {
initial_integrate_templated<0, 0, 0, 1>();
} else if (gaussian_noise_flag) {
initial_integrate_templated<0, 1, 0, 1>();
} else {
initial_integrate_templated<1, 0, 0, 1>();
}
}
} else {
if (dipole_flag) {
if (!noise_flag) {
initial_integrate_templated<0, 0, 1, 0>();
} else if (gaussian_noise_flag) {
initial_integrate_templated<0, 1, 1, 0>();
} else {
initial_integrate_templated<1, 0, 1, 0>();
}
} else {
if (!noise_flag) {
initial_integrate_templated<0, 0, 0, 0>();
} else if (gaussian_noise_flag) {
initial_integrate_templated<0, 1, 0, 0>();
} else {
initial_integrate_templated<1, 0, 0, 0>();
}
}
}
return;
}
/* ---------------------------------------------------------------------- */
template <int Tp_UNIFORM, int Tp_GAUSS, int Tp_DIPOLE, int Tp_2D>
void FixBrownianAsphere::initial_integrate_templated()
{
double **x = atom->x;
double **v = atom->v;
double **f = atom->f;
int *mask = atom->mask;
int nlocal = atom->nlocal;
AtomVecEllipsoid::Bonus *bonus = avec->bonus;
double **mu = atom->mu;
double **torque = atom->torque;
double qw[4];
double *quat;
int *ellipsoid = atom->ellipsoid;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
// project dipole along x axis of quat
double f_rot[3];
double rotationmatrix_transpose[3][3];
double tmp[3];
double dv[3];
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
// update orientation first
quat = bonus[ellipsoid[i]].quat;
MathExtra::quat_to_mat_trans(quat, rotationmatrix_transpose);
// tmp holds angular velocity in body frame
MathExtra::matvec(rotationmatrix_transpose, torque[i], tmp);
if (Tp_2D) {
tmp[0] = tmp[1] = 0.0;
if (Tp_UNIFORM) {
tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * (rng->uniform() - 0.5) * g2;
} else if (Tp_GAUSS) {
tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * rng->gaussian() * g2;
} else {
tmp[2] = g1 * tmp[2] * gamma_r_inv[2];
}
} else {
if (Tp_UNIFORM) {
tmp[0] = g1 * tmp[0] * gamma_r_inv[0] + gamma_r_invsqrt[0] * (rng->uniform() - 0.5) * g2;
tmp[1] = g1 * tmp[1] * gamma_r_inv[1] + gamma_r_invsqrt[1] * (rng->uniform() - 0.5) * g2;
tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * (rng->uniform() - 0.5) * g2;
} else if (Tp_GAUSS) {
tmp[0] = g1 * tmp[0] * gamma_r_inv[0] + gamma_r_invsqrt[0] * rng->gaussian() * g2;
tmp[1] = g1 * tmp[1] * gamma_r_inv[1] + gamma_r_invsqrt[1] * rng->gaussian() * g2;
tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * rng->gaussian() * g2;
} else {
tmp[0] = g1 * tmp[0] * gamma_r_inv[0];
tmp[1] = g1 * tmp[1] * gamma_r_inv[1];
tmp[2] = g1 * tmp[2] * gamma_r_inv[2];
}
}
// convert body frame angular velocity to quaternion
MathExtra::quatvec(quat, tmp, qw);
quat[0] = quat[0] + 0.5 * dt * qw[0];
quat[1] = quat[1] + 0.5 * dt * qw[1];
quat[2] = quat[2] + 0.5 * dt * qw[2];
quat[3] = quat[3] + 0.5 * dt * qw[3];
// normalisation introduces the stochastic drift term
// to recover the Boltzmann distribution for the case of conservative torques
MathExtra::qnormalize(quat);
// next, update centre of mass positions and velocities
// tmp now holds force in body frame
MathExtra::matvec(rotationmatrix_transpose, f[i], tmp);
// and then converts to gamma_t^{-1} * F (velocity) in body frame
if (Tp_2D) {
tmp[2] = 0.0;
if (Tp_UNIFORM) {
tmp[0] = g1 * tmp[0] * gamma_t_inv[0] + gamma_t_invsqrt[0] * (rng->uniform() - 0.5) * g2;
tmp[1] = g1 * tmp[1] * gamma_t_inv[1] + gamma_t_invsqrt[1] * (rng->uniform() - 0.5) * g2;
} else if (Tp_GAUSS) {
tmp[0] = g1 * tmp[0] * gamma_t_inv[0] + gamma_t_invsqrt[0] * rng->gaussian() * g2;
tmp[1] = g1 * tmp[1] * gamma_t_inv[1] + gamma_t_invsqrt[1] * rng->gaussian() * g2;
} else {
tmp[0] = g1 * tmp[0] * gamma_t_inv[0];
tmp[1] = g1 * tmp[1] * gamma_t_inv[1];
}
} else {
if (Tp_UNIFORM) {
tmp[0] = g1 * tmp[0] * gamma_t_inv[0] + gamma_t_invsqrt[0] * (rng->uniform() - 0.5) * g2;
tmp[1] = g1 * tmp[1] * gamma_t_inv[1] + gamma_t_invsqrt[1] * (rng->uniform() - 0.5) * g2;
tmp[2] = g1 * tmp[2] * gamma_t_inv[2] + gamma_t_invsqrt[2] * (rng->uniform() - 0.5) * g2;
} else if (Tp_GAUSS) {
tmp[0] = g1 * tmp[0] * gamma_t_inv[0] + gamma_t_invsqrt[0] * rng->gaussian() * g2;
tmp[1] = g1 * tmp[1] * gamma_t_inv[1] + gamma_t_invsqrt[1] * rng->gaussian() * g2;
tmp[2] = g1 * tmp[2] * gamma_t_inv[2] + gamma_t_invsqrt[2] * rng->gaussian() * g2;
} else {
tmp[0] = g1 * tmp[0] * gamma_t_inv[0];
tmp[1] = g1 * tmp[1] * gamma_t_inv[1];
tmp[2] = g1 * tmp[2] * gamma_t_inv[2];
}
}
// finally, convert this back to lab-frame velocity and store in dv
MathExtra::transpose_matvec(rotationmatrix_transpose, tmp, dv);
v[i][0] = dv[0];
v[i][1] = dv[1];
v[i][2] = dv[2];
x[i][0] += dv[0] * dt;
x[i][1] += dv[1] * dt;
x[i][2] += dv[2] * dt;
if (Tp_DIPOLE) {
MathExtra::quat_to_mat_trans(quat, rotationmatrix_transpose);
MathExtra::transpose_matvec(rotationmatrix_transpose, dipole_body, f_rot);
mu[i][0] = f_rot[0];
mu[i][1] = f_rot[1];
mu[i][2] = f_rot[2];
}
}
}
return;
}

View File

@ -0,0 +1,81 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/ Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
// clang-format off
FixStyle(brownian/asphere,FixBrownianAsphere);
// clang-format on
#else
#ifndef LMP_FIX_BROWNIAN_ASPHERE_H
#define LMP_FIX_BROWNIAN_ASPHERE_H
#include "fix_brownian_base.h"
namespace LAMMPS_NS {
class FixBrownianAsphere : public FixBrownianBase {
public:
FixBrownianAsphere(class LAMMPS *, int, char **);
virtual ~FixBrownianAsphere(){};
void initial_integrate(int);
void init();
protected:
class AtomVecEllipsoid *avec;
private:
template <int Tp_UNIFORM, int Tp_GAUSS, int Tp_DIPOLE, int Tp_2D>
void initial_integrate_templated();
};
} // namespace LAMMPS_NS
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal fix brownian/asphere command.
Wrong number/type of input arguments.
E: Compute brownian/asphere requires atom style sphere
Self-explanatory.
E: Compute brownian/asphere requires atom style ellipsoid
Self-explanatory.
E: Compute brownian/asphere dipole requires atom attribute mu
Self-explanatory.
E: Fix brownian/asphere translational viscous drag coefficient must be > 0.
Self-explanatory.
E: Fix brownian/asphere rotational viscous drag coefficient must be > 0.
Self-explanatory.
E: Fix brownian/asphere translational diffusion coefficient must be > 0.
Self-explanatory.
E: Fix brownian/asphere rotational diffusion coefficient must be > 0.
Self-explanatory.
E: Fix brownian/asphere seed must be > 0.
*/

View File

@ -0,0 +1,216 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/ Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Originally modified from CG-DNA/fix_nve_dotc_langevin.cpp.
Contributing author: Sam Cameron (University of Bristol)
------------------------------------------------------------------------- */
#include "fix_brownian_base.h"
#include "comm.h"
#include "domain.h"
#include "error.h"
#include "force.h"
#include "random_mars.h"
#include "update.h"
#include <cmath>
#include <cstring>
using namespace LAMMPS_NS;
using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixBrownianBase::FixBrownianBase(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
{
time_integrate = 1;
noise_flag = 1;
gaussian_noise_flag = 0;
gamma_t_flag = gamma_r_flag = 0;
gamma_t_eigen_flag = gamma_r_eigen_flag = 0;
dipole_flag = 0;
g2 = 0.0;
if (narg < 5) error->all(FLERR, "Illegal fix brownian command.");
temp = utils::numeric(FLERR, arg[3], false, lmp);
if (temp <= 0) error->all(FLERR, "Fix brownian temp must be > 0.");
seed = utils::inumeric(FLERR, arg[4], false, lmp);
if (seed <= 0) error->all(FLERR, "Fix brownian seed must be > 0.");
int iarg = 5;
while (iarg < narg) {
if (strcmp(arg[iarg], "rng") == 0) {
if (narg == iarg + 1) error->all(FLERR, "Illegal fix brownian command.");
if (strcmp(arg[iarg + 1], "uniform") == 0) {
noise_flag = 1;
} else if (strcmp(arg[iarg + 1], "gaussian") == 0) {
noise_flag = 1;
gaussian_noise_flag = 1;
} else if (strcmp(arg[iarg + 1], "none") == 0) {
noise_flag = 0;
} else {
error->all(FLERR, "Illegal fix brownian command.");
}
iarg = iarg + 2;
} else if (strcmp(arg[iarg], "dipole") == 0) {
if (narg == iarg + 3) error->all(FLERR, "Illegal fix brownian command.");
dipole_flag = 1;
dipole_body = new double[3];
dipole_body[0] = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
dipole_body[1] = utils::numeric(FLERR, arg[iarg + 2], false, lmp);
dipole_body[2] = utils::numeric(FLERR, arg[iarg + 3], false, lmp);
iarg = iarg + 4;
} else if (strcmp(arg[iarg], "gamma_t_eigen") == 0) {
if (narg == iarg + 3) error->all(FLERR, "Illegal fix brownian command.");
gamma_t_eigen_flag = 1;
gamma_t_inv = new double[3];
gamma_t_invsqrt = new double[3];
gamma_t_inv[0] = 1. / utils::numeric(FLERR, arg[iarg + 1], false, lmp);
gamma_t_inv[1] = 1. / utils::numeric(FLERR, arg[iarg + 2], false, lmp);
if (domain->dimension == 2) {
if (strcmp(arg[iarg + 3], "inf") != 0) {
error->all(FLERR, "Fix brownian gamma_t_eigen third value must be inf for 2D system.");
}
gamma_t_inv[2] = 0;
} else {
gamma_t_inv[2] = 1.0 / utils::numeric(FLERR, arg[iarg + 3], false, lmp);
}
if (gamma_t_inv[0] < 0 || gamma_t_inv[1] < 0 || gamma_t_inv[2] < 0)
error->all(FLERR, "Fix brownian gamma_t_eigen values must be > 0.");
gamma_t_invsqrt[0] = sqrt(gamma_t_inv[0]);
gamma_t_invsqrt[1] = sqrt(gamma_t_inv[1]);
gamma_t_invsqrt[2] = sqrt(gamma_t_inv[2]);
iarg = iarg + 4;
} else if (strcmp(arg[iarg], "gamma_r_eigen") == 0) {
if (narg == iarg + 3) error->all(FLERR, "Illegal fix brownian command.");
gamma_r_eigen_flag = 1;
gamma_r_inv = new double[3];
gamma_r_invsqrt = new double[3];
if (domain->dimension == 2) {
if (strcmp(arg[iarg + 1], "inf") != 0) {
error->all(FLERR, "Fix brownian gamma_r_eigen first value must be inf for 2D system.");
}
gamma_r_inv[0] = 0;
if (strcmp(arg[iarg + 2], "inf") != 0) {
error->all(FLERR, "Fix brownian gamma_r_eigen second value must be inf for 2D system.");
}
gamma_r_inv[1] = 0;
} else {
gamma_r_inv[0] = 1. / utils::numeric(FLERR, arg[iarg + 1], false, lmp);
gamma_r_inv[1] = 1. / utils::numeric(FLERR, arg[iarg + 2], false, lmp);
}
gamma_r_inv[2] = 1. / utils::numeric(FLERR, arg[iarg + 3], false, lmp);
if (gamma_r_inv[0] < 0 || gamma_r_inv[1] < 0 || gamma_r_inv[2] < 0)
error->all(FLERR, "Fix brownian gamma_r_eigen values must be > 0.");
gamma_r_invsqrt[0] = sqrt(gamma_r_inv[0]);
gamma_r_invsqrt[1] = sqrt(gamma_r_inv[1]);
gamma_r_invsqrt[2] = sqrt(gamma_r_inv[2]);
iarg = iarg + 4;
} else if (strcmp(arg[iarg], "gamma_t") == 0) {
if (narg == iarg + 1) { error->all(FLERR, "Illegal fix brownian command."); }
gamma_t_flag = 1;
gamma_t = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
if (gamma_t <= 0) error->all(FLERR, "Fix brownian gamma_t must be > 0.");
iarg = iarg + 2;
} else if (strcmp(arg[iarg], "gamma_r") == 0) {
if (narg == iarg + 1) { error->all(FLERR, "Illegal fix brownian command."); }
gamma_r_flag = 1;
gamma_r = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
if (gamma_r <= 0) error->all(FLERR, "Fix brownian gamma_r must be > 0.");
iarg = iarg + 2;
} else {
error->all(FLERR, "Illegal fix brownian command.");
}
}
// initialize Marsaglia RNG with processor-unique seed
rng = new RanMars(lmp, seed + comm->me);
}
/* ---------------------------------------------------------------------- */
int FixBrownianBase::setmask()
{
int mask = 0;
mask |= INITIAL_INTEGRATE;
return mask;
}
/* ---------------------------------------------------------------------- */
FixBrownianBase::~FixBrownianBase()
{
if (gamma_t_eigen_flag) {
delete[] gamma_t_inv;
delete[] gamma_t_invsqrt;
}
if (gamma_r_eigen_flag) {
delete[] gamma_r_inv;
delete[] gamma_r_invsqrt;
}
if (dipole_flag) { delete[] dipole_body; }
delete rng;
}
/* ---------------------------------------------------------------------- */
void FixBrownianBase::init()
{
dt = update->dt;
sqrtdt = sqrt(dt);
g1 = force->ftm2v;
if (noise_flag == 0) {
g2 = 0.0;
} else if (gaussian_noise_flag == 1) {
g2 = sqrt(2 * force->boltz * temp / dt / force->mvv2e);
} else {
g2 = sqrt(24 * force->boltz * temp / dt / force->mvv2e);
}
}
void FixBrownianBase::reset_dt()
{
double sqrtdt_old = sqrtdt;
dt = update->dt;
sqrtdt = sqrt(dt);
g2 *= sqrtdt_old / sqrtdt;
}

View File

@ -0,0 +1,88 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/ Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifndef LMP_FIX_BROWNIAN_BASE_H
#define LMP_FIX_BROWNIAN_BASE_H
#include "fix.h"
namespace LAMMPS_NS {
class FixBrownianBase : public Fix {
public:
FixBrownianBase(class LAMMPS *, int, char **);
virtual ~FixBrownianBase();
void init();
int setmask();
void reset_dt();
protected:
int seed; // RNG seed
double dt, sqrtdt; // time step interval and its sqrt
int gamma_t_flag; // 0/1 if isotropic translational damping is unset/set
int gamma_r_flag; // 0/1 if isotropic rotational damping is unset/set
int gamma_t_eigen_flag; // 0/1 if anisotropic translational damping is unset/set
int gamma_r_eigen_flag; // 0/1 if anisotropic rotational damping is unset/set
double gamma_t, gamma_r; // translational and rotational (isotropic) damping params
double *gamma_t_inv; // anisotropic damping parameter eigenvalues
double *gamma_r_inv;
double *gamma_t_invsqrt;
double *gamma_r_invsqrt;
int dipole_flag; // set if dipole is used for asphere
double *dipole_body; // direction dipole is slaved to in body frame
int noise_flag; // 0/1 for noise off/on
int gaussian_noise_flag; // 0/1 for uniform/gaussian noise
double temp; // temperature
double g1, g2; // prefactors in time stepping
class RanMars *rng;
};
} // namespace LAMMPS_NS
#endif
/* ERROR/WARNING messages:
E: Illegal fix brownian command.
Wrong number/type of input arguments.
E: Fix brownian gamma_t_eigen values must be > 0.
Self-explanatory.
E: Fix brownian gamma_r_eigen values must be > 0.
Self-explanatory.
E: Fix brownian seed must be > 0.
Self-explanatory.
E: Fix brownian temp must be > 0.
Self-explanatory.
E: Fix brownian gamma_t must be > 0.
Self-explanatory.
E: Fix brownian gamma_r must be > 0.
Self-explanatory.
*/

View File

@ -0,0 +1,180 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/ Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Originally modified from CG-DNA/fix_nve_dotc_langevin.cpp.
Contributing author: Sam Cameron (University of Bristol)
------------------------------------------------------------------------- */
#include "fix_brownian_sphere.h"
#include "atom.h"
#include "domain.h"
#include "error.h"
#include "math_extra.h"
#include "random_mars.h"
#include <cmath>
using namespace LAMMPS_NS;
using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixBrownianSphere::FixBrownianSphere(LAMMPS *lmp, int narg, char **arg) :
FixBrownianBase(lmp, narg, arg)
{
if (gamma_t_eigen_flag || gamma_r_eigen_flag) {
error->all(FLERR, "Illegal fix brownian command.");
}
if (!gamma_t_flag || !gamma_r_flag) { error->all(FLERR, "Illegal fix brownian command."); }
if (!atom->mu_flag) error->all(FLERR, "Fix brownian/sphere requires atom attribute mu");
}
/* ---------------------------------------------------------------------- */
void FixBrownianSphere::init()
{
FixBrownianBase::init();
g3 = g1 / gamma_r;
g4 = g2 / sqrt(gamma_r);
g1 /= gamma_t;
g2 /= sqrt(gamma_t);
}
/* ---------------------------------------------------------------------- */
void FixBrownianSphere::initial_integrate(int /*vflag */)
{
if (domain->dimension == 2) {
if (!noise_flag) {
initial_integrate_templated<0, 0, 1>();
} else if (gaussian_noise_flag) {
initial_integrate_templated<0, 1, 1>();
} else {
initial_integrate_templated<1, 0, 1>();
}
} else {
if (!noise_flag) {
initial_integrate_templated<0, 0, 0>();
} else if (gaussian_noise_flag) {
initial_integrate_templated<0, 1, 0>();
} else {
initial_integrate_templated<1, 0, 0>();
}
}
return;
}
/* ---------------------------------------------------------------------- */
template <int Tp_UNIFORM, int Tp_GAUSS, int Tp_2D>
void FixBrownianSphere::initial_integrate_templated()
{
double **x = atom->x;
double **v = atom->v;
double **f = atom->f;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double wx, wy, wz;
double **torque = atom->torque;
double **mu = atom->mu;
double mux, muy, muz, mulen;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
double dx, dy, dz;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
if (Tp_2D) {
dz = 0;
wx = wy = 0;
if (Tp_UNIFORM) {
dx = dt * (g1 * f[i][0] + g2 * (rng->uniform() - 0.5));
dy = dt * (g1 * f[i][1] + g2 * (rng->uniform() - 0.5));
wz = (rng->uniform() - 0.5) * g4;
} else if (Tp_GAUSS) {
dx = dt * (g1 * f[i][0] + g2 * rng->gaussian());
dy = dt * (g1 * f[i][1] + g2 * rng->gaussian());
wz = rng->gaussian() * g4;
} else {
dx = dt * g1 * f[i][0];
dy = dt * g1 * f[i][1];
wz = 0;
}
} else {
if (Tp_UNIFORM) {
dx = dt * (g1 * f[i][0] + g2 * (rng->uniform() - 0.5));
dy = dt * (g1 * f[i][1] + g2 * (rng->uniform() - 0.5));
dz = dt * (g1 * f[i][2] + g2 * (rng->uniform() - 0.5));
wx = (rng->uniform() - 0.5) * g4;
wy = (rng->uniform() - 0.5) * g4;
wz = (rng->uniform() - 0.5) * g4;
} else if (Tp_GAUSS) {
dx = dt * (g1 * f[i][0] + g2 * rng->gaussian());
dy = dt * (g1 * f[i][1] + g2 * rng->gaussian());
dz = dt * (g1 * f[i][2] + g2 * rng->gaussian());
wx = rng->gaussian() * g4;
wy = rng->gaussian() * g4;
wz = rng->gaussian() * g4;
} else {
dx = dt * g1 * f[i][0];
dy = dt * g1 * f[i][1];
dz = dt * g1 * f[i][2];
wx = wy = wz = 0;
}
}
x[i][0] += dx;
v[i][0] = dx / dt;
x[i][1] += dy;
v[i][1] = dy / dt;
x[i][2] += dz;
v[i][2] = dz / dt;
wx += g3 * torque[i][0];
wy += g3 * torque[i][1];
wz += g3 * torque[i][2];
// store length of dipole as we need to convert it to a unit vector and
// then back again
mulen = sqrt(mu[i][0] * mu[i][0] + mu[i][1] * mu[i][1] + mu[i][2] * mu[i][2]);
// unit vector at time t
mux = mu[i][0] / mulen;
muy = mu[i][1] / mulen;
muz = mu[i][2] / mulen;
// un-normalised unit vector at time t + dt
mu[i][0] = mux + (wy * muz - wz * muy) * dt;
mu[i][1] = muy + (wz * mux - wx * muz) * dt;
mu[i][2] = muz + (wx * muy - wy * mux) * dt;
// normalisation introduces the stochastic drift term due to changing from
// Stratonovich to Ito interpretation
MathExtra::norm3(mu[i]);
// multiply by original magnitude to obtain dipole of same length
mu[i][0] = mu[i][0] * mulen;
mu[i][1] = mu[i][1] * mulen;
mu[i][2] = mu[i][2] * mulen;
}
}
}

View File

@ -0,0 +1,74 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/ Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
// clang-format off
FixStyle(brownian/sphere,FixBrownianSphere);
// clang-format on
#else
#ifndef LMP_FIX_BROWNIAN_SPHERE_H
#define LMP_FIX_BROWNIAN_SPHERE_H
#include "fix_brownian_base.h"
namespace LAMMPS_NS {
class FixBrownianSphere : public FixBrownianBase {
public:
FixBrownianSphere(class LAMMPS *, int, char **);
virtual ~FixBrownianSphere(){};
void init();
void initial_integrate(int);
private:
template <int Tp_UNIFORM, int Tp_GAUSS, int Tp_2D> void initial_integrate_templated();
double g3, g4;
};
} // namespace LAMMPS_NS
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal fix brownian/sphere command.
Wrong number/type of input arguments.
E: Compute brownian/sphere requires atom style sphere
Self-explanatory.
E: Compute brownian/sphere requires atom attribute mu
Self-explanatory.
E: Fix brownian/sphere translational viscous drag coefficient must be > 0.
Self-explanatory.
E: Fix brownian/sphere rotational viscous drag coefficient must be > 0.
Self-explanatory.
E: Fix brownian/sphere translational diffusion coefficient must be > 0.
Self-explanatory.
E: Fix brownian/sphere rotational diffusion coefficient must be > 0.
Self-explanatory.
E: Fix brownian/sphere seed must be > 0.
*/

View File

@ -0,0 +1,300 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/ Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------
Contributed by Stefan Paquay @ Brandeis University
Thanks to Liesbeth Janssen @ Eindhoven University for useful discussions!
Current maintainer: Sam Cameron @ University of Bristol
----------------------------------------------------------------------- */
#include "fix_propel_self.h"
#include "atom.h"
#include "atom_vec_ellipsoid.h"
#include "domain.h"
#include "error.h"
#include "math_extra.h"
#include <cmath>
#include <cstring>
using namespace LAMMPS_NS;
using namespace FixConst;
enum { DIPOLE, VELOCITY, QUAT };
#define TOL 1e-14
/* ---------------------------------------------------------------------- */
FixPropelSelf::FixPropelSelf(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), avec(nullptr)
{
virial_global_flag = virial_peratom_flag = 1;
if (narg != 5 && narg != 9) error->all(FLERR, "Illegal fix propel/self command");
if (strcmp(arg[3], "velocity") == 0) {
mode = VELOCITY;
thermo_virial = 0;
} else if (strcmp(arg[3], "dipole") == 0) {
mode = DIPOLE;
thermo_virial = 1;
} else if (strcmp(arg[3], "quat") == 0) {
mode = QUAT;
thermo_virial = 1;
} else {
error->all(FLERR, "Illegal fix propel/self command");
}
magnitude = utils::numeric(FLERR, arg[4], false, lmp);
// check for keyword
if (narg == 9) {
if (mode != QUAT) { error->all(FLERR, "Illegal fix propel/self command"); }
if (strcmp(arg[5], "qvector") == 0) {
sx = utils::numeric(FLERR, arg[6], false, lmp);
sy = utils::numeric(FLERR, arg[7], false, lmp);
sz = utils::numeric(FLERR, arg[8], false, lmp);
double snorm = sqrt(sx * sx + sy * sy + sz * sz);
sx = sx / snorm;
sy = sy / snorm;
sz = sz / snorm;
} else {
error->all(FLERR, "Illegal fix propel/self command");
}
} else {
sx = 1.0;
sy = 0.0;
sz = 0.0;
}
}
/* ---------------------------------------------------------------------- */
int FixPropelSelf::setmask()
{
int mask = 0;
mask |= POST_FORCE;
return mask;
}
/* ---------------------------------------------------------------------- */
void FixPropelSelf::init()
{
if (mode == DIPOLE && !atom->mu_flag)
error->all(FLERR, "Fix propel/self requires atom attribute mu with option dipole");
if (mode == QUAT) {
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec) error->all(FLERR, "Fix propel/self requires atom style ellipsoid with option quat");
// check that all particles are finite-size ellipsoids
// no point particles allowed, spherical is OK
int *ellipsoid = atom->ellipsoid;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (ellipsoid[i] < 0)
error->one(FLERR, "Fix propel/self requires extended particles with option quat");
}
}
/* ---------------------------------------------------------------------- */
void FixPropelSelf::setup(int vflag)
{
post_force(vflag);
}
/* ---------------------------------------------------------------------- */
void FixPropelSelf::post_force(int vflag)
{
if (mode == DIPOLE)
post_force_dipole(vflag);
else if (mode == VELOCITY)
post_force_velocity(vflag);
else if (mode == QUAT)
post_force_quaternion(vflag);
}
/* ---------------------------------------------------------------------- */
void FixPropelSelf::post_force_dipole(int vflag)
{
double **f = atom->f;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double **x = atom->x;
double **mu = atom->mu;
double fx, fy, fz;
// energy and virial setup
double vi[6];
if (vflag)
v_setup(vflag);
else
evflag = 0;
// if domain has PBC, need to unwrap for virial
double unwrap[3];
imageint *image = atom->image;
// Add the active force to the atom force:
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
fx = magnitude * mu[i][0];
fy = magnitude * mu[i][1];
fz = magnitude * mu[i][2];
f[i][0] += fx;
f[i][1] += fy;
f[i][2] += fz;
if (evflag) {
domain->unmap(x[i], image[i], unwrap);
vi[0] = fx * unwrap[0];
vi[1] = fy * unwrap[1];
vi[2] = fz * unwrap[2];
vi[3] = fx * unwrap[1];
vi[4] = fx * unwrap[2];
vi[5] = fy * unwrap[2];
v_tally(i, vi);
}
}
}
/* ---------------------------------------------------------------------- */
void FixPropelSelf::post_force_velocity(int vflag)
{
double **f = atom->f;
double **v = atom->v;
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
double nv2, fnorm, fx, fy, fz;
// energy and virial setup
double vi[6];
if (vflag)
v_setup(vflag);
else
evflag = 0;
// if domain has PBC, need to unwrap for virial
double unwrap[3];
imageint *image = atom->image;
// Add the active force to the atom force:
for (int i = 0; i < nlocal; ++i) {
if (mask[i] & groupbit) {
nv2 = v[i][0] * v[i][0] + v[i][1] * v[i][1] + v[i][2] * v[i][2];
fnorm = 0.0;
if (nv2 > TOL) {
// Without this check you can run into numerical
// issues because fnorm will blow up.
fnorm = magnitude / sqrt(nv2);
}
fx = fnorm * v[i][0];
fy = fnorm * v[i][1];
fz = fnorm * v[i][2];
f[i][0] += fx;
f[i][1] += fy;
f[i][2] += fz;
if (evflag) {
domain->unmap(x[i], image[i], unwrap);
vi[0] = fx * unwrap[0];
vi[1] = fy * unwrap[1];
vi[2] = fz * unwrap[2];
vi[3] = fx * unwrap[1];
vi[4] = fx * unwrap[2];
vi[5] = fy * unwrap[2];
v_tally(i, vi);
}
}
}
}
/* ---------------------------------------------------------------------- */
void FixPropelSelf::post_force_quaternion(int vflag)
{
double **f = atom->f;
double **x = atom->x;
int *mask = atom->mask;
int nlocal = atom->nlocal;
int *ellipsoid = atom->ellipsoid;
// ellipsoidal properties
AtomVecEllipsoid::Bonus *bonus = avec->bonus;
double f_act[3] = {sx, sy, sz};
double f_rot[3];
double *quat;
double Q[3][3];
double fx, fy, fz;
// energy and virial setup
double vi[6];
if (vflag)
v_setup(vflag);
else
evflag = 0;
// if domain has PBC, need to unwrap for virial
double unwrap[3];
imageint *image = atom->image;
// Add the active force to the atom force:
for (int i = 0; i < nlocal; ++i) {
if (mask[i] & groupbit) {
quat = bonus[ellipsoid[i]].quat;
MathExtra::quat_to_mat(quat, Q);
MathExtra::matvec(Q, f_act, f_rot);
fx = magnitude * f_rot[0];
fy = magnitude * f_rot[1];
fz = magnitude * f_rot[2];
f[i][0] += fx;
f[i][1] += fy;
f[i][2] += fz;
if (evflag) {
domain->unmap(x[i], image[i], unwrap);
vi[0] = fx * unwrap[0];
vi[1] = fy * unwrap[1];
vi[2] = fz * unwrap[2];
vi[3] = fx * unwrap[1];
vi[4] = fx * unwrap[2];
vi[5] = fy * unwrap[2];
v_tally(i, vi);
}
}
}
}

View File

@ -0,0 +1,68 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
// clang-format off
FixStyle(propel/self,FixPropelSelf);
// clang-format on
#else
#ifndef LMP_FIX_PROPEL_SELF_H
#define LMP_FIX_PROPEL_SELF_H
#include "fix.h"
namespace LAMMPS_NS {
class FixPropelSelf : public Fix {
public:
FixPropelSelf(class LAMMPS *, int, char **);
virtual ~FixPropelSelf(){};
void init();
void post_force(int);
void setup(int);
int setmask();
private:
double magnitude;
double sx, sy, sz;
int mode;
void post_force_dipole(int);
void post_force_velocity(int);
void post_force_quaternion(int);
class AtomVecEllipsoid *avec;
};
} // namespace LAMMPS_NS
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal fix propel/self command.
Wrong number/type of input arguments.
E: Fix propel/self requires atom attribute mu with option dipole.
Self-explanatory.
E: Fix propel/self requires atom style ellipsoid with option quat.
Self-explanatory.
Fix propel/self requires extended particles with option quat.
Self-explanatory.
*/

View File

@ -26,8 +26,25 @@ action () {
fi
}
# the CG-DNA package cannot be used without
# the MOLECULE and ASPHERE packages installed.
if (test $1 = 1) then
if (test ! -e ../bond_harmonic.cpp) then
echo "Must install MOLECULE package with CG-DNA"
exit 1
fi
if (test ! -e ../fix_nve_asphere.cpp) then
echo "Must install ASPHERE package with CG-DNA"
exit 1
fi
fi
# list of files with dependcies
action atom_vec_oxdna.cpp
action atom_vec_oxdna.h
action bond_oxdna_fene.cpp bond_fene.h
action bond_oxdna2_fene.cpp bond_fene.h
action bond_oxrna2_fene.cpp bond_fene.h

View File

@ -40,13 +40,13 @@ gradient thermostats for rigid body dynamics", J. Chem. Phys. 142,
144114 (2015).
Example input and data files can be found in
/examples/USER/cgdna/examples/oxDNA/, /oxDNA2/ and /oxRNA2/.
examples/PACKAGES/cgdna/examples/oxDNA/, /oxDNA2/ and /oxRNA2/.
Python setup tools which create single straight or helical DNA or RNA
strands as well as DNA or RNA duplexes or arrays of duplexes can be
found in /examples/USER/cgdna/util/. A technical report with more
found in examples/PACKAGES/cgdna/util/. A technical report with more
general information on the model, its implementation and performance
as well as the structure of the data and input file can be found
in /doc/src/PDF/USER-CGDNA.pdf.
in doc/src/PDF/CG-DNA.pdf.
IMPORTANT NOTE: This package can only be used if LAMMPS is compiled
with the MOLECULE and ASPHERE packages. These should be included in

View File

@ -0,0 +1,92 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "atom_vec_oxdna.h"
#include "atom.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
AtomVecOxdna::AtomVecOxdna(LAMMPS *lmp) : AtomVec(lmp)
{
molecular = Atom::MOLECULAR;
bonds_allow = 1;
mass_type = PER_TYPE;
atom->molecule_flag = 1;
// strings with peratom variables to include in each AtomVec method
// strings cannot contain fields in corresponding AtomVec default strings
// order of fields in a string does not matter
// except: fields_data_atom & fields_data_vel must match data file
fields_grow = (char *) "id5p";
fields_copy = (char *) "id5p";
fields_comm = (char *) "";
fields_comm_vel = (char *) "";
fields_reverse = (char *) "";
fields_border = (char *) "id5p";
fields_border_vel = (char *) "";
fields_exchange = (char *) "id5p";
fields_restart = (char *) "id5p";
fields_create = (char *) "";
fields_data_atom = (char *) "id type x";
fields_data_vel = (char *) "id v";
setup_fields();
if (!force->newton_bond)
error->warning(FLERR, "Write_data command requires newton on to preserve 3'->5' bond polarity");
}
/* ----------------------------------------------------------------------
set local copies of all grow ptrs used by this class, except defaults
needed in replicate when 2 atom classes exist and it calls pack_restart()
------------------------------------------------------------------------- */
void AtomVecOxdna::grow_pointers()
{
id5p = atom->id5p;
}
/* ----------------------------------------------------------------------
initialize atom quantity 5' partner
------------------------------------------------------------------------- */
void AtomVecOxdna::data_atom_post(int ilocal)
{
tagint *id5p = atom->id5p;
id5p[ilocal] = -1;
}
/* ----------------------------------------------------------------------
process bond information as per data file
store 5' partner to inform 3'->5' bond directionality
------------------------------------------------------------------------- */
void AtomVecOxdna::data_bonds_post(int /*m*/, int /*num_bond*/, tagint atom1, tagint atom2,
tagint id_offset)
{
int n;
tagint *id5p = atom->id5p;
if (id_offset) {
atom1 += id_offset;
atom2 += id_offset;
}
if ((n = atom->map(atom1)) >= 0) { id5p[n] = atom2; }
}

View File

@ -0,0 +1,47 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef ATOM_CLASS
// clang-format off
AtomStyle(oxdna,AtomVecOxdna);
// clang-format on
#else
#ifndef LMP_ATOM_VEC_OXDNA_H
#define LMP_ATOM_VEC_OXDNA_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecOxdna : public AtomVec {
public:
AtomVecOxdna(class LAMMPS *);
~AtomVecOxdna() = default;
void grow_pointers();
void data_atom_post(int);
void data_bonds_post(int, int, tagint, tagint, tagint);
private:
tagint *id5p;
};
} // namespace LAMMPS_NS
#endif
#endif
/* ERROR/WARNING messages:
*/

View File

@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -18,30 +18,16 @@
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
BondOxdna2Fene::BondOxdna2Fene(LAMMPS *lmp) : BondOxdnaFene(lmp)
{
}
/* ---------------------------------------------------------------------- */
BondOxdna2Fene::~BondOxdna2Fene()
{
}
/* ----------------------------------------------------------------------
compute vector COM-sugar-phosphate backbone interaction site in oxDNA2
------------------------------------------------------------------------- */
void BondOxdna2Fene::compute_interaction_sites(double e1[3], double e2[3],
double /*e3*/[3], double r[3])
void BondOxdna2Fene::compute_interaction_sites(double e1[3], double e2[3], double /*e3*/[3],
double r[3]) const
{
double d_cs_x=-0.34, d_cs_y=+0.3408;
r[0] = d_cs_x*e1[0] + d_cs_y*e2[0];
r[1] = d_cs_x*e1[1] + d_cs_y*e2[1];
r[2] = d_cs_x*e1[2] + d_cs_y*e2[2];
constexpr double d_cs_x = -0.34;
constexpr double d_cs_y = +0.3408;
r[0] = d_cs_x * e1[0] + d_cs_y * e2[0];
r[1] = d_cs_x * e1[1] + d_cs_y * e2[1];
r[2] = d_cs_x * e1[2] + d_cs_y * e2[2];
}

Some files were not shown because too many files have changed in this diff Show More