File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1073,6 +1073,19 @@ def calculate_grid_convergence_index(
10731073 gci: float
10741074 Grid Convergence Index (GCI).
10751075 """
1076+
1077+ # Validate inputs
1078+ if not (np .issubdtype (type (refinement_ratio ), np .number )):
1079+ raise TypeError ("refinement_ratio must be a numeric values" )
1080+ if not (np .issubdtype (type (factor_of_safety ), np .number )):
1081+ raise TypeError ("factor_of_safety must be a numeric values" )
1082+ if not (np .issubdtype (type (order ), np .number )):
1083+ raise TypeError ("order must be a numeric values" )
1084+ if not (np .issubdtype (fine_grid .dtype , np .number ) and np .issubdtype (coarse_grid .dtype , np .number )):
1085+ raise TypeError ("fine_grid and coarse_grid must contain numeric values" )
1086+ if fine_grid .shape != coarse_grid .shape :
1087+ raise ValueError ("fine_grid and coarse_grid must have the same shape" )
1088+
10761089 # Calculate the approximate relative error
10771090 error = np .abs ((fine_grid - coarse_grid ) / fine_grid )
10781091
You can’t perform that action at this time.
0 commit comments