Giter VIP home page Giter VIP logo

electro's Introduction

electro

A basic test EM solver for test particles.

Usage / Configuration

electro has no configuration save the "main" file.

The basic concept is that the type Electro represents the simulation. Its constructor has four arguments:

  • A std::function to a function (subroutine) that gives the Electric Field as a function (mathematical) of spacetime
  • A std::function to a function that gives the Magnetic Field as a function of spacetime
  • The time step.
  • A bool that declares whether threads will be used or not. Currently, each particle is stepped by its own thread. The default value is false.

Honestly, just look at electro.hpp. It is simple enough to read, I prefer to code this way.

The units used are cgs and natural units. To use natural units, define the macro ELECTRO_USE_NATURAL before the start including electro.hpp.

Electro has two public methods of interest, the first is add. Use this to add particles into the simulation. The second method is step, which advances the simulation in time. This returns a vector of first a timestamp, position, and then velocities, from x to z in that order, for each particle in queue order to when they were appended by add.

Technical

Mostly everything I wrote (haven't attached a copyright yet, this isn't quite heavy stuff, though). The lorentz force is integrated using the so called "leapfrog" algorithm. See noob3d/numer.hpp for details. Yes, it is relativistic ;)

electro's People

Contributors

noobermin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.