GithubHelp home page GithubHelp logo

eschnett / ddf.jl Goto Github PK

View Code? Open in Web Editor NEW
10.0 5.0 0.0 949 KB

Discrete Differential Forms in arbitrary dimensions

License: MIT License

Julia 80.69% Mathematica 19.31%
exterior-calculus discretization high-performance-computing partial-differential-equations finite-element-method finite-elements discrete-exterior-calculus finite-element-exterior-calculus differential-forms

ddf.jl's Introduction

Discrete Differential Forms

A Julia package for discretizing functions via finite elements.

Overview

The DDF package discretizes functions on arbitrary domains. The domain is decomposed into simplices, and the function is represented via a basis in each simplex. This is a form of a Finite Element discretization. For example, a scalar function in two dimensions might be represented via its values at the vertices. In between the vertices it might be defined via linear interpolation.

The DDF package is based on FEEC, the Finite Element Exterior Calculus. FEEC bears a certain similarity to DEC, the Discrete Exterior Calculus.

The design goals of the DDF package are:

  • supports unstructured meshes (e.g. simplices)
  • works in arbitrary dimensions
  • supports higher order accurate discretizations
  • is efficient enough for parallel/distributed calculations with large meshes with billions of elements
  • is flexible and relatively easy to use so that it is useful for experimental mathematics

The DDF package is currently (2020-10-17) work in progress. Functionality is missing, and the current API is too tedious (too many details need to be specified explicitly).

Examples

Define a 2d manifold with Float64 coordinates that consists of a single simplex:

using DDF
D = 2
mfd = simplex_manifold(Val(D), Float64)
mfd = refined_manifold(mfd);
mfd = refined_manifold(mfd);

Calculate the gradient operator for the primal mesh:

grad = deriv(Val(Pr), Val(0), mfd)

Calculate the hodge dual operator for scalars on the primal mesh:

h = hodge(Val(Pr), Val(0), mfd)

Define a scalar function living on the primal vertices:

using DifferentialForms
f(x) = Form{D,0}((sin(x[1]) * cos(x[2]), ))
f̃ = sample(Fun{D,Pr,0,D,Float64,Float64}, f, mfd)

Plot the scalar function:

using AbstractPlotting
using GLMakie
using StaticArrays

coordinates = [mfd.coords[0][i][d] for i in 1:nsimplices(mfd, 0), d in 1:D]
connectivity = [SVector{D + 1}(i
                               for i in sparse_column_rows(mfd.simplices[D], j))
                for j in 1:size(mfd.simplices[D], 2)];
connectivity = [connectivity[i][n]
                for i in 1:nsimplices(mfd, D), n in 1:(D + 1)]
color =.values;

scene = Scene()
poly!(scene, coordinates, connectivity, color=color, strokecolor=(:black, 0.6),
      strokewidth=4)
scale!(scene, 1, 1)

# using Makie
# Makie.save("simplex.png", scene; resolution=(350,300))

Simplex manifold

Literature and Related Work

ddf.jl's People

Contributors

eschnett avatar juliatagbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ddf.jl's Issues

Correct licence

The current MIT licence is incompatible with the licence of Grassmann.jl (GNU Affero General Public License v3.0).

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.