Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into reduce-compilation-flags
Browse files Browse the repository at this point in the history
  • Loading branch information
lmdiazangulo committed Nov 9, 2024
2 parents d44c2c3 + c545cb2 commit bca8dbb
Show file tree
Hide file tree
Showing 15 changed files with 914 additions and 46 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 @@ -146,6 +148,7 @@ add_definitions(
-DCompileWithDMMA
-DCompileWithSGBC
-DCompileWithWires
-DCompileWithXDMF
)


8 changes: 4 additions & 4 deletions doc/smbjson.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ An interval allows specifying regions within the grid which can be a point, an o
+ The first one represents a single rectangular surface with its normal oriented towards the $+\hat{z}$ direction (light green).
+ The second one is formed by an square surface oriented towards the $-\hat{z}$ direction (light red) and a line oriented towards $-\hat{x}$.
+ The third is formed by two oriented lines towards $+\hat{x}$ and $+\hat{y}$, respectively.
+ Finally, the fourth `cell` is formed by a single line, oriented towards $-\hat{y}$. Note that the integer in the ending segment is $-1$ as it falls out from the lower bound of the grid.
+ Finally, the fourth `cell` is formed by a single line, oriented towards $-\hat{y}$.

![Intervals example](fig/grid-intervals.png)

Expand All @@ -230,7 +230,7 @@ An interval allows specifying regions within the grid which can be a point, an o
[[5,4,0], [3,4,0]] ]},
{"id": 3, "type": "cell", "intervals": [ [[3,2,0], [5,2,0]],
[[5,2,0], [5,3,0]] ]},
{"id": 4, "type": "cell", "intervals": [ [[7,3,0], [7,-1,0]] ]},
{"id": 4, "type": "cell", "intervals": [ [[7,3,0], [7,0,0]] ]},
]
}
```
Expand Down 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
3 changes: 1 addition & 2 deletions 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 Expand Up @@ -153,7 +152,7 @@ subroutine convertInterval(xi, xe, interval, dir)
xi = a
xe = b
else
xi = b + 1
xi = b
xe = a - 1
end if

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 bca8dbb

Please sign in to comment.