Luthaf / Jumos.jl

Julia toolbox for molecular simulations
http://jumos.readthedocs.org/en/latest/
Other
23 stars 11 forks source link

More generic propagator #5

Closed Luthaf closed 9 years ago

Luthaf commented 9 years ago

It would be great to have a Propagator type, with the following subtypes :

Luthaf commented 9 years ago

More thought about this point: we can define the Simulation type as follow

type Simulation{T<:Propagator}
    propagator::Propagator
    interactions :: Interactions
    controls :: Vector{BaseControl}
    checks :: Vector{BaseCheck}
    computes :: Vector{BaseCompute}
    outputs :: Vector{BaseOutput}
# Data
    topology :: Topology
    cell :: UnitCell
    frame :: Frame
    masses :: Vector{Float64}
# all other data to be shared
    data :: Dict{Symbol, Any}
end

And then have

type MolecularDynamic <: Propagator
    forces_computer :: BaseForcesComputer
    integrator :: BaseIntegrator
    forces :: Array3D{Float64}
end

type Metadynamic <: Propagator
    md :: MolecularDynamic
    gaussians::Array{Float64, 1}
    # other parameters
end

type Replay <: Propagator
    reader :: Reader
end

type MonteCarlo <: Propagator
    moves::Array{Move, 1}
    energy_computer::energy
end

# And so on
Luthaf commented 9 years ago

Done in 1e696ac28154640d4432b7ebd64f099ec1a16b23