# \[ANN\] Trixi.jl v0.3: SciML integration and a new modular approach for easy extension

**URL:** <https://discourse.julialang.org/t/ann-trixi-jl-v0-3-sciml-integration-and-a-new-modular-approach-for-easy-extension/50419>\
**Category:** Package Announcements\
**Tags:** parallel, pde, numerics, physics, math\
**Created:** [November 19, 2020, 10:06am UTC](https://discourse.julialang.org/t/ann-trixi-jl-v0-3-sciml-integration-and-a-new-modular-approach-for-easy-extension/50419 "2020-11-19T10:06:42Z")\
**Posts on this page:** 2\
**Page:** 5

<div class="post-metadata">

**Author:** ![ranocha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ranocha/32/35588_2.png) [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Post date:** [June 21, 2022, 10:41am UTC](https://discourse.julialang.org/t/ann-trixi-jl-v0-3-sciml-integration-and-a-new-modular-approach-for-easy-extension/50419/82 "2022-06-21T10:41:21Z")

</div>

Depends on what you mean by that (since DG solutions are discontinuous across interfaces). If you just want the local gradients without neighbor coupling, you could write something like

```julia
mesh, equations, solver, cache = Trixi.mesh_equations_solver_cache(semi)
derivative_matrix = dg.basis.derivative_matrix
du_dx .= 0
for element in eachelement(dg, cache)
  jacobian_factor = cache.elements.inverse_jacobian[element]
  for j in eachnode(dg), i in eachnode(dg)
    # x derivative
    for ii in eachnode(dg)
      u_node = get_node_vars(u, equations, dg, ii, j, element)
      multiply_add_to_node_vars!(du_dx, jacobian_factor * derivative_matrix[i, ii], u_node, equations, dg, i, j, element)
    end

    # same in y
  end
end

```

Note that this uses internal API extensively and I didn’t test it. See

> <https://github.com/trixi-framework/Trixi.jl/blob/c7de88710b80d73fed6f181d1605eb897402908d/src/solvers/dgsem_tree/dg_2d.jl#L157-L196>

> <https://github.com/trixi-framework/Trixi.jl/blob/c7de88710b80d73fed6f181d1605eb897402908d/src/solvers/dgsem_tree/dg_2d.jl#L1002-L1016>

for similar stuff.

---

<div class="post-metadata">

**Author:** ![ziolai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ziolai/32/23422_2.png) [@ziolai](https://discourse.julialang.org/u/ziolai)\
**Post date:** [June 21, 2022, 11:09am UTC](https://discourse.julialang.org/t/ann-trixi-jl-v0-3-sciml-integration-and-a-new-modular-approach-for-easy-extension/50419/83 "2022-06-21T11:09:54Z")

</div>

Thx! Food for thought.

[Previous page](https://discourse.julialang.org/t/ann-trixi-jl-v0-3-sciml-integration-and-a-new-modular-approach-for-easy-extension/50419.md?page=4)
