Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edition update #71

Merged
merged 2 commits into from
Mar 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "eom"
version = "0.10.1-alpha.0"
authors = ["Toshiki Teramura <[email protected]>"]
edition = "2018"

description = "Configurable ODE/PDE solver"
documentation = "https://docs.rs/eom/"
Expand Down
8 changes: 0 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
//! Configurable ODE/PDE solver

#[macro_use]
extern crate derive_new;
extern crate fftw;
extern crate ndarray;
extern crate ndarray_linalg;
extern crate num_complex;
extern crate num_traits;

pub mod adaptor;
pub mod explicit;
pub mod lyapunov;
Expand Down
2 changes: 1 addition & 1 deletion src/lyapunov.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use ndarray::*;
use ndarray_linalg::*;
use num_traits::{Float, One};

use traits::*;
use crate::traits::*;

/// Jacobian operator using numerical-differentiation
pub struct Jacobian<'jac, A, D, TEO>
Expand Down
4 changes: 2 additions & 2 deletions src/ode/goy_shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use ndarray::*;
use num_complex::Complex64 as c64;
use num_traits::{PrimInt, Zero};

use traits::*;
use crate::traits::*;

#[derive(Clone, Copy, Debug, new)]
#[derive(Clone, Copy, Debug)]
pub struct GoyShell {
size: usize,
nu: f64,
Expand Down
2 changes: 1 addition & 1 deletion src/ode/lorenz63.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use ndarray::*;

use traits::*;
use crate::traits::*;

#[derive(Clone, Copy, Debug)]
pub struct Lorenz63 {
Expand Down
4 changes: 2 additions & 2 deletions src/ode/lorenz96.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! Lorenz 96 model
//! https://en.wikipedia.org/wiki/Lorenz_96_model

use crate::traits::*;
use ndarray::*;
use traits::*;

#[derive(Clone, Copy, Debug, new)]
#[derive(Clone, Copy, Debug)]
pub struct Lorenz96 {
pub f: f64,
pub n: usize,
Expand Down
2 changes: 1 addition & 1 deletion src/ode/roessler.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Roessler system
//! https://en.wikipedia.org/wiki/Lorenz_syste://en.wikipedia.org/wiki/R%C3%B6ssler_attractor

use crate::traits::*;
use ndarray::*;
use traits::*;

#[derive(Clone, Copy, Debug)]
pub struct Roessler {
Expand Down
2 changes: 1 addition & 1 deletion src/pde/kse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use ndarray::*;
use std::f64::consts::PI;

use super::Pair;
use traits::*;
use crate::traits::*;

/// One-dimensional Kuramoto-Sivashinsky equation with spectral-method
pub struct KSE {
Expand Down
9 changes: 6 additions & 3 deletions src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ pub trait TimeStep {
/// Core implementation for explicit schemes
pub trait Explicit: ModelSpec {
/// calculate right hand side (rhs) of Explicit from current state
fn rhs<'a, S>(&mut self, &'a mut ArrayBase<S, Self::Dim>) -> &'a mut ArrayBase<S, Self::Dim>
fn rhs<'a, S>(&mut self, x: &'a mut ArrayBase<S, Self::Dim>) -> &'a mut ArrayBase<S, Self::Dim>
where
S: DataMut<Elem = Self::Scalar>;
}

/// Core implementation for semi-implicit schemes
pub trait SemiImplicit: ModelSpec {
/// non-linear part of stiff equation
fn nlin<'a, S>(&mut self, &'a mut ArrayBase<S, Self::Dim>) -> &'a mut ArrayBase<S, Self::Dim>
fn nlin<'a, S>(
&mut self,
x: &'a mut ArrayBase<S, Self::Dim>,
) -> &'a mut ArrayBase<S, Self::Dim>
where
S: DataMut<Elem = Self::Scalar>;
/// diagonal elements of stiff linear part
Expand All @@ -40,7 +43,7 @@ pub trait TimeEvolution: ModelSpec + TimeStep {
/// calculate next step
fn iterate<'a, S>(
&mut self,
&'a mut ArrayBase<S, Self::Dim>,
x: &'a mut ArrayBase<S, Self::Dim>,
) -> &'a mut ArrayBase<S, Self::Dim>
where
S: DataMut<Elem = Self::Scalar>;
Expand Down
5 changes: 0 additions & 5 deletions tests/lyapunov.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
extern crate eom;
extern crate ndarray;
#[macro_use]
extern crate ndarray_linalg;

use ndarray::*;
use ndarray_linalg::*;

Expand Down
5 changes: 0 additions & 5 deletions tests/pde.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
extern crate eom;
extern crate ndarray;
#[macro_use]
extern crate ndarray_linalg;

use ndarray::*;
use ndarray_linalg::*;
use std::f64::consts::PI;
Expand Down