Skip to content

Commit

Permalink
Merge pull request #73 from OpenSEMBA/luis
Browse files Browse the repository at this point in the history
`movie components` changed to be a single entry, not array.
  • Loading branch information
lmdiazangulo authored Nov 9, 2024
2 parents 173914c + efb237e commit c545cb2
Show file tree
Hide file tree
Showing 15 changed files with 911 additions and 43 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ if (SEMBA_FDTD_MAIN_LIB)
"src_main_pub/timestepping.F90"
"src_main_pub/observation.F90"
"src_main_pub/vtk.F90"
"src_main_pub/xdmf.F90"
"src_main_pub/xdmf_h5.F90"
"src_wires_pub/wires.F90"
"src_wires_pub/wires_mtln.F90"
)
Expand Down Expand Up @@ -147,6 +149,7 @@ add_definitions(
-DCompileWithDMMA
-DCompileWithSGBC
-DCompileWithWires
-DCompileWithXDMF
)


4 changes: 2 additions & 2 deletions doc/smbjson.md
Original file line number Diff line number Diff line change
Expand Up @@ -634,15 +634,15 @@ If not `magnitudeFile` is specified and only one `source` is defined, the `magni

Probes of type `movie` record a vector field in a volume region indicated by `elementIds`. `[field]` can be `electric`, `magnetic`, or `currentDensity`; defaults to `electric`.
`currentDensity` will store only the surface density currents on `pec` or lossy surfaces.
The stored values can be selected using `[components]`, which stores an array of the following labels `x`, `y`, `z`, or `magnitude`; if no components are specified, defaults to `magnitude`.
The stored values can be selected using the `[component]` entry, which stores one of the following labels `x`, `y`, `z`, or `magnitude`; if no component is specified, defaults to `magnitude`.

An example follows:
```json
{
"name": "electric_field_movie",
"type": "movie",
"field": "electric",
"components": ["x"],
"component": "x",
"elementIds": [4]
}
```
Expand Down
2 changes: 1 addition & 1 deletion src_json_parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ add_library (jsonfortran
)

add_library(smbjson
"labels_mod.F90"
"smbjson_labels.F90"
"cells.F90"
"smbjson.F90"
"idchildtable.F90"
Expand Down
2 changes: 1 addition & 1 deletion src_json_parser/idchildtable.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module idchildtable_mod

#ifdef CompileWithSMBJSON
use json_module
use smbjson_labels_mod, only: J_ID
use fhash, only: fhash_tbl_t, key=>fhash_key
use labels_mod
use parser_tools_mod, only: json_value_ptr

type :: IdChildTable_t
Expand Down
1 change: 0 additions & 1 deletion src_json_parser/parser_tools.F90
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module parser_tools_mod

#ifdef CompileWithSMBJSON
use labels_mod
use mesh_mod
use cells_mod
use json_module
Expand Down
18 changes: 6 additions & 12 deletions src_json_parser/smbjson.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module smbjson
use NFDETypes

use NFDETypes_extension
use labels_mod
use smbjson_labels_mod
use mesh_mod
use parser_tools_mod
use idchildtable_mod
Expand Down Expand Up @@ -985,19 +985,13 @@ function readVolProbe(p) result(res)
cs = cellIntervalsToCoords(cRs(1)%intervals)

fieldType = this%getStrAt(p, J_FIELD, default=J_FIELD_ELECTRIC)
call this%core%get(p, J_PR_MOVIE_COMPONENTS, compsPtr, found=componentsFound)
call this%core%get(p, J_PR_MOVIE_COMPONENT, compsPtr, found=componentsFound)
allocate(res%cordinates(1))
if (componentsFound) then
numberOfComponents = this%core%count(compsPtr)
allocate(res%cordinates(numberOfComponents))
do i = 1, numberOfComponents
call this%core%get_child(compsPtr, i, compPtr)
call this%core%get(compPtr, component)
res%cordinates(i) = cs(1)
res%cordinates(i)%Or = buildVolProbeType(fieldType, component)
end do
else
allocate(res%cordinates(1))
call this%core%get(compsPtr, component)
res%cordinates(1) = cs(1)
res%cordinates(1)%Or = buildVolProbeType(fieldType, component)
else
component = J_DIR_M
res%cordinates(1)%Or = buildVolProbeType(fieldType, component)
endif
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module labels_mod
module smbjson_labels_mod

#ifdef CompileWithSMBJSON
! LABELS
Expand Down Expand Up @@ -155,7 +155,7 @@ module labels_mod

character (len=*), parameter :: J_PR_POINT_DIRECTIONS = "directions"

character (len=*), parameter :: J_PR_MOVIE_COMPONENTS = "components"
character (len=*), parameter :: J_PR_MOVIE_COMPONENT = "component"

character (len=*), parameter :: J_PR_FAR_FIELD_THETA = "theta"
character (len=*), parameter :: J_PR_FAR_FIELD_PHI = "phi"
Expand Down
Loading

0 comments on commit c545cb2

Please sign in to comment.