From ed2d11b9a25c66ac152dc7733869f98ca0dca4de Mon Sep 17 00:00:00 2001 From: Matteo Cicuttin <datafl4sh@toxicnet.eu> Date: Thu, 20 May 2021 18:20:32 +0200 Subject: [PATCH] Updated changelog & api doc. --- doc/changelog.md | 4 ++++ doc/lua_api.md | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/doc/changelog.md b/doc/changelog.md index 9305240..d3defac 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -21,3 +21,7 @@ Unavailable features: - Improved export to SILO. E, H, and J fields are now exportable as nodal or zonal variables. It is also possible to disable the export of a specific field, see `lua_api.md` (8a831181). - Leapfrog integration on CPU & GPU (e3d95022). +## Version v0.3 (NOT RELEASED YET) +- Volumetric sources on CPU & GPU (2ed2e9e7). + + diff --git a/doc/lua_api.md b/doc/lua_api.md index 3633234..d74839f 100644 --- a/doc/lua_api.md +++ b/doc/lua_api.md @@ -68,6 +68,19 @@ The solver expects that the callbacks for materials have 4 parameters: - `tag`: the current subdomain tag - `x`, `y` and `z`: the current coordinates at which the material needs to be evaluated. Note that currently the materials are assumed to be piecewise constant and that the material is evaluated in the barycenter of the element. +### Volumetric sources +Current sources in volumes can be specified by providing a function that evaluates the current density field in a given subdomain. For example the following code defines a volumetric source in the subdomain with tag `4`: +``` +function J_source(tag, x, y, z, t) + local Ex = 0 + local Ey = 0 + local Ez = math.sin(2*math.pi*freq*t) + return Ex, Ey, Ez +end + +sources[4] = J_source +``` + ### Boundary conditions Boundary conditions are specified for each surface with tag `tag` via the table `bndconds`. If a surface does not have an entry in `bndconds` it is assumed to be PEC. -- GitLab