Skip to content

Commit

Permalink
Avoid division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalinen committed Aug 26, 2024
1 parent a178076 commit ec82dfe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fem/src/modules/VectorHelmholtz.F90
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,15 @@ SUBROUTINE VectorHelmholtzSolver( Model,Solver,dt,Transient )

Found = .FALSE.
IF( ASSOCIATED( Model % Constants ) ) THEN
mu0inv = 1.0_dp / GetConstReal( Model % Constants, 'Permeability of Vacuum', Found )
IF (ListCheckPresent(Model % Constants, 'Permeability of Vacuum')) &
mu0inv = 1.0_dp / GetConstReal( Model % Constants, 'Permeability of Vacuum', Found )
END IF
IF(.NOT. Found ) mu0inv = 1.0_dp / ( PI * 4.0d-7 )

Found = .FALSE.
IF( ASSOCIATED( Model % Constants ) ) THEN
eps0 = GetConstReal ( Model % Constants, 'Permittivity of Vacuum', Found )
IF (ListCheckPresent(Model % Constants, 'Permittivity of Vacuum')) &
eps0 = GetConstReal ( Model % Constants, 'Permittivity of Vacuum', Found )
END IF
IF(.NOT. Found ) eps0 = 8.854187817d-12

Expand Down

0 comments on commit ec82dfe

Please sign in to comment.