-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from marjanAlbouye/update-auto-scale
Update apply_forcefield and molecule forcefield
- Loading branch information
Showing
16 changed files
with
632 additions
and
351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Base classes for hoomd_organics.""" | ||
from .forcefield import BaseHOOMDForcefield, BaseXMLForcefield | ||
from .molecule import CoPolymer, Molecule, Polymer | ||
from .simulation import Simulation | ||
from .system import Lattice, Pack, System |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Base forcefield classes.""" | ||
import forcefield_utilities as ffutils | ||
import foyer | ||
|
||
|
||
class BaseXMLForcefield(foyer.Forcefield): | ||
"""Base XML forcefield class.""" | ||
|
||
def __init__(self, forcefield_files=None, name=None): | ||
super(BaseXMLForcefield, self).__init__( | ||
forcefield_files=forcefield_files, name=name | ||
) | ||
self.gmso_ff = ( | ||
ffutils.FoyerFFs().load(forcefield_files or name).to_gmso_ff() | ||
) | ||
|
||
|
||
class BaseHOOMDForcefield: | ||
"""Base HOOMD forcefield class.""" | ||
|
||
def __init__(self, hoomd_forces): | ||
self.hoomd_forces = hoomd_forces | ||
if hoomd_forces is None: | ||
raise NotImplementedError( | ||
"`hoomd_forces` must be defined in the subclass." | ||
) | ||
if not isinstance(hoomd_forces, list): | ||
raise TypeError("`hoomd_forces` must be a list.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.