diff --git a/docs/source/api.rst b/docs/source/api.rst index fb9156d9..3f1edec2 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -280,6 +280,12 @@ Snapshot -------- .. autoclass:: gprMax.cmds_multiple.Snapshot +Subgrid +------- +.. autoclass:: gprMax.subgrids.user_objects.SubGridHSG + + + PML === diff --git a/gprMax/subgrids/base.py b/gprMax/subgrids/base.py index d16ad879..1923e69f 100644 --- a/gprMax/subgrids/base.py +++ b/gprMax/subgrids/base.py @@ -26,7 +26,7 @@ class SubGridBase(FDTDGrid): raise ValueError('Subgrid Error: Only odd ratios are supported') # Name of the grid - self.name = kwargs['ID'] + self.name = kwargs['id'] self.filter = kwargs['filter'] diff --git a/gprMax/subgrids/user_objects.py b/gprMax/subgrids/user_objects.py index eb8d2902..ec3c2d90 100644 --- a/gprMax/subgrids/user_objects.py +++ b/gprMax/subgrids/user_objects.py @@ -130,18 +130,37 @@ class SubGridBase(UserObjectMulti): class SubGridHSG(SubGridBase): - """HSG User Object.""" + """Huygens Surface subgridding (HSG) user object. + + :param p1: Position of the lower left corner of the Inner Surface (x, y, z) in the main grid. + :type p1: list, non-optional + :param p2: Position of the upper right corner of the Inner Surface (x, y, z) in the main grid. + :type p2: list, non-optional + :param ratio: Ratio of the main grid spatial step to the sub-grid spatial step. Must be an odd integer. + :type ratio: int, non-optional + :param id: Identifier for the sub-grid. + :type id: str, non-optional + :param is_os_sep: Number of main grid cells between the Inner Surface and the Outer Surface. Defaults to 3. + :type is_os_sep: str, optional + :param pml_separation: Number of sub-grid cells between the Outer Surface and the PML. Defaults to ratio // 2 + 2 + :type pml_separation: int, optional + :param subgrid_pml_thickness: Thickness of the PML on each of the 6 sides of the sub-grid. Defaults to 6. + :type subgrid_pml_thickness: int, optional + :param interpolation: Degree of the interpolation scheme used for spatil interpolation of the fields at the Inner Surface. Defaults to Linear + :type interpolation: str, optional + :param filter: Turn on the 3-pole filter. Increases numerical stability. Defaults to True + :type filter: bool, optional + + """ def __init__(self, p1=None, p2=None, ratio=3, - ID='', + id='', is_os_sep=3, pml_separation=4, subgrid_pml_thickness=6, interpolation='linear', - loss_mechanism=False, - loss_factor=False, filter=True, **kwargs): """Constructor.""" @@ -152,14 +171,12 @@ class SubGridHSG(SubGridBase): kwargs['p1'] = p1 kwargs['p2'] = p2 kwargs['ratio'] = ratio - kwargs['ID'] = ID + kwargs['id'] = id kwargs['is_os_sep'] = is_os_sep kwargs['pml_separation'] = pml_separation kwargs['subgrid_pml_thickness'] = subgrid_pml_thickness kwargs['interpolation'] = interpolation kwargs['filter'] = filter - kwargs['loss_mechanism'] = loss_mechanism - kwargs['loss_factor'] = loss_factor super().__init__(**kwargs) self.order = 18