Comments (3)
I ended up using exactly that approach and it's fine. A little more verbose then a System(oldsys, coordinates=newcoords) but certainly no priority.
I was just surprised that the 'common' approach did not work (and the type parameter list was too long to spot the problem :D) and Accessors failed too. IMHO in the long run compatibility with Accessors or a 're-constructor' would be nice to have, but I'm fine off knowing about it now.
Thanks for the info!
from molly.jl.
Perhaps there is use for a
System
constructor that takes in an existingSystem
and keyword arguments for any properties that should be changed, returning a copy.
This is now on master, e.g. System(sys; coords=(sys.coords .* 0.5))
.
from molly.jl.
The type parameters of System
require some calculation and don't map directly to the fields. This is to allow certain properties to be put into the type domain for dispatch and performance. If you are constructing directly with fields...
you would need to specify the type parameters, see:
Lines 391 to 394 in b172d0d
You can copy a System
with deepcopy
too. In general, though, I would use the keyword argument constructor for System
since it won't be the bottleneck in most code.
Perhaps there is use for a System
constructor that takes in an existing System
and keyword arguments for any properties that should be changed, returning a copy. At the moment I just do something like:
sys2 = System(
atoms=sys.atoms,
coords=sys.coords,
...
)
from molly.jl.
Related Issues (20)
- key "HB1" not found in forcefield HOT 1
- Links in Docs are broken HOT 2
- Boltzmann Constant in LAMMPS 'real' units does not work HOT 5
- AtomsBase not properly implemented HOT 4
- GPU error with custom pairwise interactions HOT 5
- Inconsistent Units Crash Simulation HOT 5
- apply_coupling! method is not found for custom coupling function HOT 2
- Example for new MC membrane barostat HOT 12
- How to cite? HOT 6
- [feature request] velocity-dependent forces HOT 2
- Should we pass more properties (e.g. velocities, step number) to `force`/`potential_energy`? HOT 4
- Should we have functions to add and remove atoms to/from a `System`? HOT 3
- open an sdf file HOT 10
- Molly.jl: AD with Enyzme returns 0 gradient HOT 1
- Units in Nose Hoover temperature HOT 1
- GPU error with the example HOT 4
- return type for force for pairwise potential in CUDA HOT 1
- sys.coords does not work as Vector{Vector} HOT 2
- EAM implementation and dimension error HOT 5
- Boundary Conditions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from molly.jl.