diff --git a/src/Plasma.jl b/src/Plasma.jl index 6f5c8bd..166d5b0 100644 --- a/src/Plasma.jl +++ b/src/Plasma.jl @@ -17,6 +17,15 @@ abstract type AbstractGeometry end abstract type AbstractDistribution end abstract type AbstractCoil end + +""" +Species holds + +q – charge in C +m – mass in Kg + +to describe a particle species +""" struct Species{ T <: Number } q::T # charge in C m::T # mass in Kg @@ -27,10 +36,28 @@ struct Species{ T <: Number } ) end end + +""" +Velocity distribution of particles + +P – probability function +species – which species of particle +""" struct Distribution <: AbstractDistribution P::Function species::Species end + + +""" +Describes the initial geometry of a plasma + +f – conditional function + +# Example + +Geometry(x -> x > 0.4 ? 1. : 0) +""" struct Geometry{F <: Function} <: AbstractGeometry f::F @@ -38,14 +65,40 @@ struct Geometry{F <: Function} <: AbstractGeometry new{typeof(f)}(f) end end + +""" +CollisionlessPlasma object that can be passed to Plasma.solve for simulation + +It takes a geometry and a vector of distributions (one for every particle). +""" struct CollisionlessPlasma{ G <: AbstractGeometry } <: AbstractPlasma distributions::Vector{Distribution} geometry::G end + +""" +ElectrostaticPlasma object that can be passed to Plasma.solve for simulation + +It takes a geometry and a vector of distributions (one for every particle). +""" struct ElectrostaticPlasma{ G <: AbstractGeometry } <: AbstractPlasma distributions::Vector{Distribution} geometry::G end + +""" +Object to hold (and save) the results of Plasma.solve. + +It consists of + +plasma – CollisionlessPlasma or ElectrostaticPlasma object +vars – dependent variables +dict_vars – dictionary of dependent variables +phi – trained trial solution that approximates plasma movement +res – result of optimization +initθ – weights of the neural network +domains – domains of the simulation +""" struct PlasmaSolution{ P <: AbstractPlasma, V, DV, PHI, RE, IN, DO } plasma::P vars::V diff --git a/src/solve.jl b/src/solve.jl index 2c1135b..f2876a6 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -34,7 +34,16 @@ function print_loss(prob) end """ -Solve dispatch for collisionless plasmas +Simulates a collisionless plasma given: + +plasma – Struct of type CollisionlessPlasma +lb – lower bound +ub – upper bound +time_lb – lower time boundary +time_ub – upper time boundary +GPU – whether this should be executed on the GPU or not +inner_layers – how many layers in the neural network +strategy – what NeuralPDE training strategy should be used """ function solve(plasma::CollisionlessPlasma; lb=0.0, ub=1.0, time_lb=lb, time_ub=ub, @@ -152,7 +161,17 @@ function solve(plasma::CollisionlessPlasma; end """ -Solve dispatch for electrostatic plasmas +Simulates an electrostatic plasma given: + +plasma – Struct of type ElectrostaticPlasma +dim – in how many D and V dimensions should the simulation happen +lb – lower bound +ub – upper bound +time_lb – lower time boundary +time_ub – upper time boundary +GPU – whether this should be executed on the GPU or not +inner_layers – how many layers in the neural network +strategy – what NeuralPDE training strategy should be used """ function solve(plasma::ElectrostaticPlasma; lb=0.0, ub=1.0, time_lb=lb, time_ub=ub,