Giter Club home page Giter Club logo

Comments (2)

lchristm avatar lchristm commented on September 1, 2024 1

I think the simplest way to do this would be to overload the calc_sources! function in the elixir that is used with libtrixi. E.g. define something like

struct Forcing
    data::Vector{Float64} # received from external application
    dof2index::Array{Int, 4} # maps (i,j,k,elem) to idx in data
end
function Trixi.calc_sources!(du, u, t, source_terms::Forcing,
                             equations::AbstractEquations{3}, dg::DG, cache)
    # do something
end

Note that overloading an internal function leads to stricter compat limits, i.e. such elixir is not guaranteed to work with any future version of Trixi.jl. But for initial experimentation this may be fine.

from trixi.jl.

ranocha avatar ranocha commented on September 1, 2024

I do not see a clean and nice way how to do this (but this may be my fault). Instead, I would create another ODE RHS in libtrixi that adds the required source terms via indices. It kind of has to live there since the conversion of the indices to the external data is something Trixi.jl does not know.

from trixi.jl.

Related Issues (20)

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.