GithubHelp home page GithubHelp logo

juliafem / mortar2d.jl Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 7.0 848 KB

Mortar2D.jl is a Julia package to calculate discrete projections between non-conforming finite element meshes. The resulting "mortar matrices" can be used to tie non-conforming finite elements meshes together in an optimal way.

Home Page: https://juliafem.github.io/Mortar2D.jl/latest

License: MIT License

Julia 100.00%
fem mortar discretization 2d

mortar2d.jl's Introduction

Mortar2D.jl

DOIBuild StatusCoverage StatusIssues

Mortar2D.jl is a Julia package to calculate discrete projections between non-conforming finite element meshes. The resulting "mortar matrices" can be used to tie non-conforming finite element meshes together which are meshed separately to construct bigger models.

Using mortar methods in mesh tie problems results variationally consistent solution. Mathematically, goal is to solve mixed problem with primary field variable and Lagrange multipliers, which have a physical meaning (e.g. contact pressure if unknown field is displacement). The problem arising is a typical saddle point problem with zeros on diagonal.

Installing and testing package

Installing package goes same way like other packages in julia, i.e.

julia> Pkg.add("Mortar2D")

Testing package can be done using Pkg.test, i.e.

julia> Pkg.test("Mortar2D")

Probably the easiest way to test the functionality of package is to use JuliaBox.

Usage example

Let us calculate projection matrices D and M for the following problem:

Problem setup:

Xs = Dict(1 => [0.0, 1.0], 2 => [5/4, 1.0], 3 => [2.0, 1.0])
Xm = Dict(4 => [0.0, 1.0], 5 => [1.0, 1.0], 6 => [2.0, 1.0])
coords = merge(Xm , Xs)
Es = Dict(1 => [1, 2], 2 => [2, 3])
Em = Dict(3 => [4, 5], 4 => [5, 6])
elements = merge(Es, Em)
element_types = Dict(1 => :Seg2, 2 => :Seg2, 3 => :Seg2, 4 => :Seg2)
slave_element_ids = [1, 2]
master_element_ids = [3, 4]

Calculate projection matrices D and M

s, m, D, M = calculate_mortar_assembly(
    elements, element_types, coords,
    slave_element_ids, master_element_ids)

According to theory, the interface should transfer constant without any error. Let's test that:

u_m = ones(3)
u_s = D[s,s] \ (M[s,m]*um)

# output

3-element Array{Float64,1}:
 1.0
 1.0
 1.0

The rest of the story can be read from the documentation. There's also brief review to the theory behind non-conforming finite element meshes.

mortar2d.jl's People

Contributors

ahojukka5 avatar alhirzel avatar femtocleaner[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mortar2d.jl's Issues

Info about upcoming removal of packages in the General registry

As described in https://discourse.julialang.org/t/ann-plans-for-removing-packages-that-do-not-yet-support-1-0-from-the-general-registry/ we are planning on removing packages that do not support 1.0 from the General registry. This package has been detected to not support 1.0 and is thus slated to be removed. The removal of packages from the registry will happen approximately a month after this issue is open.

To transition to the new Pkg system using Project.toml, see https://github.com/JuliaRegistries/Registrator.jl#transitioning-from-require-to-projecttoml.
To then tag a new version of the package, see https://github.com/JuliaRegistries/Registrator.jl#via-the-github-app.

If you believe this package has erroneously been detected as not supporting 1.0 or have any other questions, don't hesitate to discuss it here or in the thread linked at the top of this post.

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.