Exemple #1
0
def check_for_mandatory_keys(found_keys, mandatory):
    """ Checks if all required keywords have been found. Exits program if not.

    Parameters
    --------------
        found_keys : list
            list of keys found in the input file

        mandatory : list
            list of mandatory keys
    Returns
    --------
        None

    Notes
    ---------
        None

    """

    print("--> Checking for mandatory keywords")
    missing = []
    for key in mandatory:
        if key not in found_keys:
            missing.append(key)

    if missing != []:
        print("Missing the following mandatory parameters:")
        for key in missing:
            print(f"{key}")
        hf.print_error("Missing parameters!")

    else:
        print("--> All Mandatory keywords have been found")
def check_regions_and_layers_fracture(params, prefix):
    """ Checks that families are only defined in either a region or a layer or the whole domain.

    Parameters
    -------------
        params : dict
            parameter dictionary
        prefix : string
            either 'e' or 'r' for ellipse or rectangle

    Returns
    ---------
        None

    Notes
    ---------
        Exits program is inconsistencies are found.
    """
    shape = "ellipse" if prefix == 'e' else "rectangle"
    num_families = params['nFamEll']['value'] if prefix == 'e' else params[
        'nFamRect']['value']
    for i in range(num_families):
        if params[prefix + 'Region']['value'][i] > 0 and params[
                prefix + 'Layer']['value'][i] > 0:
            hf.print_error(
                f"The {shape} family #{i+1} is defined in both regions and layers. Only one can be specified and the other must be set to 0."
            )
def check_family_prob(params):
    """ Check the list of family probabilities (the list of  probabilities that a fracture is in each family). If the probabilities don't sum to 1, they are rescaled to do so. 

    Parameters
    -------------
        params : dict
            parameter dictionary
    Returns
    ---------
        None

    Notes
    ---------
        Exits program is inconsistencies are found.
    """

    if (params['nFamEll']['value'] + params['nFamRect']['value']) > 0:
        if len(params['famProb']['value']) != (params['nFamEll']['value'] +
                                               params['nFamRect']['value']):
            hf.print_error(
                f"\"famProb\" must have {(params['nFamEll']['value'] + params['nFamRect']['value'])} (nFamEll + nFamRect) non-zero elements, one for each family of ellipses and rectangles. {len(params['famProb']['value'])} probabiliies have been defined."
            )

        total = sum(params['famProb']['value'])
        if total != 1:
            rescaled = [
                float("{:.6}".format(x / total))
                for x in params['famProb']['value']
            ]
            hf.print_warning(
                "'famProb' probabilities did not sum to 1. They have been re-scaled accordingly"
            )
            params['famProb']['value'] = [x / total for x in rescaled]
            print(f"--> New Values: {params['famProb']['value']}")
Exemple #4
0
def process_line(line, found_keys, params):
    """ Find the key and associated value in a line of the input file. Place values into params dictionary and add keyword into the found_keys list. 

    Parameters
    ------------
        line : string
            line of text from input file. 
        found_keys : list
            list of keys that have been found in the input file so far
        params : dictionary 
            input parameter dictionary
    Returns 
    --------
        None

    Notes
    ---------
        None
    """

    if line.strip != "":
        ## Get key
        key = find_key(line)
        ## Check if key has already been found
        if key in found_keys:
            hf.print_error(f"keyword: {key} has been defined multiple times")
        else:
            found_keys.append(key)

        #Check if key is defined
        if key in params.keys():
            params[key]['value'] = find_val(line, key)
        else:
            hf.print_error(f"keyword: {key} is unknown")
def check_family_count(params):
    """Makes sure at least one polygon family has been defined in nFamRect or nFamEll
    OR that there is a user input file for polygons.

    Parameters
    -------------
        params : dict
            parameter dictionary
    Returns
    ---------
        None

    Notes
    ---------
        Exits program is inconsistencies are found.
    """

    if params['userEllipsesOnOff']['value'] or params['userRectanglesOnOff'][
            'value'] or params['userRecByCoord']['value'] or params[
                'userEllByCoord']['value'] or params['userPolygonByCoord'][
                    'value']:
        user_def_exists = True
    else:
        user_def_exists = False

    if params['nFamEll']['value'] + params['nFamRect'][
            'value'] <= 0 and not user_def_exists:
        hf.print_error("Zero polygon families have been defined. Please create at least one family "\
              "of ellipses/rectangles, or provide a user-defined-polygon input file path in "\
              "\"UserEll_Input_File_Path\", \"UserRect_Input_File_Path\", \"UserEll_Input_File_Path\", or "\
              "\"RectByCoord_Input_File_Path\" and set the corresponding flag to '1'.")
Exemple #6
0
def check_for_mandatory_values(params, mandatory):
    """ Checks if all required keywords have a provided value. Exits program if not.

    Parameters
    --------------
        params : dictionary
            input parameter dictionary
        mandatory : list
            list of mandatory keys
    Returns
    --------
        None

    Notes
    ---------
        None
    """

    print("--> Checking for mandatory values")
    missing = []
    for key in mandatory:
        if params[key]['value'] == None:
            missing.append(key)

    if missing != []:
        print("Missing values for the following mandatory parameters:")
        for key in missing:
            print(f"{key}")
        hf.print_error("")
    print("--> All mandatory values have been found")
def check_rejects_per_fracture(rejectsPerFracture):
    """ Check that the value of the rejectsPerFracture is a positive integer. If a value of 0 is provided, it's changed to 1. 

    Parameters
    -------------
        seed : dict
            seed entry of params dictionary
    Returns
    ---------
        None

    Notes
    ---------
        Exits program is inconsistencies are found.
    """

    if rejectsPerFracture['value'] < 0:
        hf.print_error(
            f"\"rejectsPerFracture\" has value {rejectsPerFracture['value']}. Value must be positive"
        )
    if rejectsPerFracture['value'] == 0:
        rejectsPerFracture['value'] = 1
        hf.print_warning(
            "--> Changing \"rejectsPerFracture\" from 0 to 1. Cannot ensure 0 rejections."
        )
Exemple #8
0
def dump_params(params, output_file):
    """ Write the parameters from the verbose input file back to a simplified input file.
    """
    print(f"--> Writing parameters to file {output_file}")
    try:
        writer = open(output_file, 'w')
    except:
        hf.print_error("Check that the path of your output file is valid.")

    keys = params.keys()
    for key in keys:
        if params[key]['value'] is not None:
            if key == 'layers':
                writer.write(key + ': \n')
                for i, layer in enumerate(params['layers']['value']):

                    curl = "{"
                    for val in params['layers']['value'][i]:
                        curl += f"{val},"
                    curl = curl[:-1]
                    curl += "}"
                    writer.write(curl + '\n')

            elif key == 'regions':
                writer.write(key + ': \n')
                for i, layer in enumerate(params['regions']['value']):
                    curl = "{"
                    for val in params['regions']['value'][i]:
                        curl += f"{val},"
                    curl = curl[:-1]
                    curl += "}"
                    writer.write(curl + '\n')

            elif key == 'minimum_fracture_size':
                pass

            elif params[key]['list']:
                curl = "{"
                for val in params[key]['value']:
                    curl += f"{val},"
                curl = curl[:-1]
                curl += "}"
                writer.write(key + ': ' + curl + '\n')

            elif params[key]['type'] is bool:
                if params[key]['value']:
                    writer.write(f"{key}: 1 \n")
                else:
                    writer.write(f"{key}: 0 \n")
            else:
                writer.write(f"{key}: {params[key]['value']} \n")
        else:
            writer.write(key + ": {}\n")
Exemple #9
0
def convert_params(params):
    """ Converts all parameters into their assigned type. Exits program is provided type does not match the assigned values. 

    Parameters
    ------------
        params : dictionary 
            dictionary of input parameters from file

    Returns
    ------------
        params : dictionary 
            dictionary of input parameters from file

    Notes
    -------
        None

    """

    for key in params.keys():
        try:
            # work in individual values
            if not params[key]['list']:
                # This checks if a key in not entered, it's just skipped, which is okay for some keys
                if not params[key]['value'] is None:
                    if params[key]['type'] is bool:
                        if params[key]['value'] == '0' or params[key][
                                'value'] == 0:
                            params[key]['value'] = False
                        elif params[key]['value'] == '1' or params[key][
                                'value'] == 1:
                            params[key]['value'] = True
                        else:
                            hf.print_error(
                                f"Error converting {key} value into assigned type bool (0,1). Value found in file was '{params[key]['value']}'"
                            )
                    else:
                        params[key]['value'] = params[key]['type'](
                            params[key]['value'])
            else:
                if params[key]['value'] == '' or params[key]['value'] == None:
                    params[key]['value'] = None
                else:
                    params[key]['value'] = [
                        params[key]['type'](i) for i in params[key]['value']
                    ]
        except:
            hf.print_error(
                f"Error converting {key} value into assigned type {params[key]['type']}. Value found in file was '{params[key]['value']}'"
            )

    return params
def check_no_dep_flags(params):
    """ Check for dependency flags. Not sure this does anything."""
    no_dependancy_flags = [
        'outputAllRadii', 'outputFinalRadiiPerFamily',
        'outputAcceptedRadiiPerFamily', 'tripleIntersections',
        'printRejectReasons', 'visualizationMode', 'keepOnlyLargestCluster',
        'keepIsolatedFractures', 'insertUserRectanglesFirst',
        'forceLargeFractures', 'orientationOption'
    ]

    for key in no_dependancy_flags:
        if params[key]['value'] is None:
            hf.print_error(f"\"{key}\" not provided.")
def check_beta_distribution(params, prefix):
    """
    Verifies both the "ebetaDistribution" and "rBetaDistribution". If either contain any flags    indicating constant angle (1) then the corresponding "ebeta" and/or "rbeta" parameters are 
    also verified. 
    
    Parameters
    -------------
        params : dict
            parameter dictionary
        prefix : string
            either 'e' or 'r' for ellipse or rectangle

    Returns
    ---------
        None

    Notes
    ---------
        Exits program is inconsistencies are found.
    """

    shape = "ellipse" if prefix == 'e' else "rectangle"
    num_families = params['nFamEll']['value'] if prefix == 'e' else params[
        'nFamRect']['value']
    angle_option_key = prefix + 'AngleOption'

    #check kappa
    key = prefix + 'betaDistribution'
    hf.check_none(key, params[key]['value'])
    hf.check_length(key, params[key]['value'], num_families)

    # check actual values of beta
    num_beta = params[key]['value'].count(1)
    if num_beta > 0:
        beta_key = prefix + "beta"
        hf.check_none(beta_key, params[beta_key]['value'])
        hf.check_length(beta_key, params[beta_key]['value'], num_beta)

        for i, val in enumerate(params[beta_key]['value']):
            if params[angle_option_key]['value'] == 0:
                if val < 0 or val > 2 * pi:
                    hf.print_error(
                        f"\"{key}\" entry {i+1} has value {val} which is outside of acceptable parameter range [0,2*pi). If you want to use degrees, please use {angle_option_key} = 1. "
                    )
            # check degrees
            else:
                if val < 0 or val > 365:
                    hf.print_error(
                        f"\"{key}\" entry {i+1} has value {val} which is outside of acceptable parameter range [0,365). "
                    )
def check_layers_general(params):
    """ Check the number of layers provided matching the requested number. Checks boundaries of layers that they are within the domain.

    Parameters
    -------------
        params : dict
            parameter dictionary
    Returns
    ---------
        None

    Notes
    ---------
        Exits program is inconsistencies are found.
    """
    hf.check_none('layers', params['layers']['value'])
    hf.check_length('layers', params['layers']['value'],
                    params['numOfLayers']['value'])

    half_z_domain = params['domainSize']['value'][
        2] / 2.0  ## -index[2] becaue domainSize = [x,y,z]
    ## -center of z-domain at z = 0 so
    ##  whole Zdomain is -zDomainSize to +zDomainSize
    for i, layer in enumerate(params['layers']['value']):
        if len(layer) != 2:
            hf.print_error(
                f"\"layers\" has defined layer #{i+1} to have {len(layer)} element(s) but each layer must have 2 elements, which define its upper and lower bounds"
            )

        if params['layers']['value'].count(layer) > 1:
            hf.print_error(
                "\"layers\" has defined the same layer more than once.")
        minZ = layer[0]
        maxZ = layer[1]
        if maxZ <= minZ:
            hf.print_error(
                f"\"layers\" has defined layer #{i+1} where zmin: {minZ} is greater than zmax {maxZ}"
            )

        if minZ <= -half_z_domain and maxZ <= -half_z_domain:
            hf.print_error(
                f"\"layers\" has defined layer #{i+1} to have both upper and lower bounds completely below the domain's z-dimensional range ({-half_z_domain} to {half_z_domain}). At least one boundary must be within the domain's range. The domain's range is half of 3rd value in \"domainSize (z-dimension) in both positive and negative directions."
            )

        if minZ >= half_z_domain and maxZ >= half_z_domain:
            hf.print_error(
                f"\"layers\" has defined layer #{i+1} to have both upper and lower bounds completely above the domain's z-dimensional range ({-half_z_domain} to {half_z_domain}). At least one boundary must be within the domain's range. The domain's range is half of 3rd value in \"domainSize\" (z-dimension) in both positive and negative directions."
            )
Exemple #13
0
def parse_input(input_file):
    """ Parse each line of the input file and checks if all mandatory parameters have been found.

    Parameters
    ------------
        input_file : input file name

    Returns
    ------------
        params : dictionary 
            dictionary of input parameters from file

    Notes
    -------
        None

    """
    try:
        reader = open(input_file, 'r')
    except:
        hf.print_error("Input file path is not valid")

    input_iterator = iter(reader)

    params, mandatory = load_parameters()

    found_keys = []
    for i, line in enumerate(input_iterator):
        line = strip_comments(line, input_iterator)
        if (line != "" and ":" in line):
            process_line(line, found_keys, params)

    check_for_mandatory_keys(found_keys, mandatory)
    check_for_mandatory_values(params, mandatory)

    params = convert_params(params)

    # one more pass through to gather layers and regions, could be cleaned up
    if params["numOfLayers"]["value"] > 0:
        get_layers(params, input_file)

    if params["numOfRegions"]["value"] > 0:
        get_regions(params, input_file)

    return params
def check_n_poly(n_poly):
    """ Verifies the number of polygons is a positive integer.
    Parameters
    -------------
        n_poly : int
            number of requested polygons
            
    Returns
    ---------
        None

    Notes
    ---------
        Exits program is inconsistencies are found.
    """

    if n_poly <= 0:
        hf.print_error(
            f"\"nPoly\" must be a positive integer be zero. {n_poly} value provided."
        )
def check_seed(seed):
    """ Check the value of the seed used for pseudorandom number generation.

    Parameters
    -------------
        seed : dict
            seed entry of params dictionary
    Returns
    ---------
        None

    Notes
    ---------
        Exits program is inconsistencies are found.
    """

    if seed['value'] < 0:
        hf.print_error(
            f"\"seed\" must be non-negative. {seed['value']} value provided.")

    elif seed['value'] == 0:
        hf.print_warning(
            "\"seed\" has been set to 0. Random generator will use current wall time so distribution's random selection will not be as repeatable. Use an integer greater than 0 for better repeatability."
        )
def cross_check(params):
    """ Cross check parameters to make sure they are consistent across DFN. Checks that all angle parameters are degree/radians.


    Parameters
    -------------
        params : dict
            parameter dictionary

    Returns
    ---------
        None

    Notes
    ---------
        Exits program is inconsistencies are found.
    """

    keys = ['AngleOption']
    for key in keys:
        if params['e' + key]['value'] != params['r' + key]['value']:
            hf.print_error(
                f"Inconsistent values of \"{key}\" found in ellipses and rectangles. Values must be the same."
            )
def check_aperture(params):
    """ Checks how apertures are being defined. This feature will be removed in the future and apertures will be defined by family.. 

    Parameters
    -------------
        params : dict
            parameter dictionary
    Returns
    ---------
        None

    Notes
    ---------
        Exits program is inconsistencies are found.
    """

    if params['aperture']['value'] == 1:
        hf.check_none('meanAperture', params['meanAperture']['value'])
        hf.check_none('stdAperture', params['stdAperture']['value'])
        hf.check_values('stdAperture', params['stdAperture']['value'], 0)

    elif params['aperture']['value'] == 2:
        hf.check_none('apertureFromTransmissivity',
                      params['apertureFromTransmissivity']['value'])
        hf.check_length('apertureFromTransmissivity',
                        params['apertureFromTransmissivity']['value'], 2)
        if params['apertureFromTransmissivity']['value'][0] == 0:
            hf.print_error(
                "\"apertureFromTransmissivity\"'s first value cannot be 0.")
        if params['apertureFromTransmissivity']['value'][1] == 0:
            hf.print_warning(
                "\"apertureFromTransmissivity\"'s second value is 0, which will result in a constant aperture."
            )

    elif params['aperture']['value'] == 3:
        hf.check_none('constantAperture', params['constantAperture']['value'])
        hf.check_values('constantAperture',
                        params['constantAperture']['value'], 0)

    elif params['aperture']['value'] == 4:
        hf.check_none('lengthCorrelatedAperture',
                      params['lengthCorrelatedAperture']['value'])
        hf.check_length('lengthCorrelatedAperture',
                        params['lengthCorrelatedAperture']['value'], 2)
        if params['lengthCorrelatedAperture']['value'][0] == 0:
            hf.print_error(
                "\"lengthCorrelatedAperture\"'s first value cannot be 0.")
        if params['lengthCorrelatedAperture']['value'][1] == 0:
            hf.print_warning(
                "\"lengthCorrelatedAperture\"'s second value is 0, which will result in a constant aperture."
            )
    else:
        hf.print_error("\"aperture\" must only be option 1 (log-normal), 2 (from transmissivity), "\
              "3 (constant), or 4 (length correlated).")
Exemple #18
0
def check_lognormal_dist(params, prefix, shape, cnt):
    """
    Verifies all logNormal Parameters for ellipses and Rectangles.

     Parameters
    -------------
        params : dict
            parameter dictionary
        prefix : string
            either 'e' or 'r' for ellipse or rectangle

    Returns
    ---------
        None

    Notes
    ---------
        Exits program is inconsistencies are found.
    """
    #print(f"checking log normal {shape}")
    for i in range(cnt):
        min_val = params[prefix + "LogMin"]["value"][i]
        max_val = params[prefix + "LogMax"]["value"][i]
        mean_val = params[prefix + "LogMean"]["value"][i]
        std_val = params[prefix + "sd"]["value"][i]

        hf.check_values(prefix + "LogMax", min_val, 0)
        hf.check_values(prefix + "LogMin", max_val, 0)
        hf.check_min_max(min_val, max_val, i, f"{shape} log-normal")

        if std_val <= 0:
            hf.print_error(
                f"A standard deviation equal of {std_val} was provided for {shape} log-normal entry {i+1}. Value must be post"
            )

        # Get the mean and variance of the final distribution.
        # Note these are the actual values, not the input variables
        mu = np.exp(mean_val + std_val**2 / 2)
        variance = (np.exp(std_val**2) - 1) * np.exp(2 * mean_val + std_val**2)

        if mu <= min_val:
            hf.print_error(
                f"Requested mean value of final {shape} log-normal {mu} is smaller than minimum value {min_val}. Note that the mean value is determined by {prefix+'LogMean'} and {prefix+'sd'}. See documentation for more details."
            )

        if mu >= max_val:
            hf.print_error(
                f"Requested mean value of {shape} log-normal {mu} is larger than maximum value {max_val}. Note that the mean value is determined by {prefix+'LogMean'} and {prefix+'sd'}. See documentation for more details."
            )

        hf.check_min_frac_size(params, min_val)
def check_orientations(params, prefix):
    """ Checks orientation options. If using trend/plunge, degrees must be used. If using spherical, radians are okay as well. Checks that values are within acceptable ranges. 

    Parameters
    -------------
        params : dict
            parameter dictionary
        prefix : string
            either 'e' or 'r' for ellipse or rectangle

    Returns
    ---------
        None

    Notes
    ---------
        Exits program is inconsistencies are found.
    """
    shape = "ellipse" if prefix == 'e' else "rectangle"
    num_families = params['nFamEll']['value'] if prefix == 'e' else params[
        'nFamRect']['value']
    angle_option_key = prefix + 'AngleOption'

    if params["orientationOption"]["value"] == 0:
        #print("--> Using Spherical Coordinates")
        keys = [prefix + name for name in ["theta", "phi"]]

    elif params["orientationOption"]["value"] == 1:
        #print("--> Using Trend and Plunge")
        # 0 is radians, 1 is degrees
        if params[angle_option_key]['value'] == 0:
            hf.print_error(
                f"Using Trend and Plunge but {prefix + 'AngleOption'} is set to use radians. Trend and plunge must use degrees. Set {prefix + 'AngleOption'} = 1. "
            )
        keys = [prefix + name for name in ["trend", "plunge"]]

    elif params["orientationOption"]["value"] == 2:
        # using dip / strike
        if params[angle_option_key]['value'] == 0:
            hf.print_error(
                f"Using Dip and Strike but {prefix + 'AngleOption'} is set to use radians. Trend and plunge must use degrees. Set {prefix + 'AngleOption'} = 1. "
            )
        keys = [prefix + name for name in ["dip", "strike"]]
    else:
        hf.print_error(f"Unknown orientation option. Value must be 0,1, or 2.")

    for key in keys:
        hf.check_none(key, params[key]['value'])
        hf.check_length(key, params[key]['value'], num_families)
        for i, val in enumerate(params[key]['value']):
            # check radians
            if params[angle_option_key]['value'] == 0:
                if val < 0 or val > 2 * pi:
                    hf.print_error(
                        f"\"{key}\" entry {i+1} has value {val} which is outside of acceptable parameter range [0,2*pi). If you want to use degrees, please use {angle_option_key} = 1. "
                    )
            # check degrees
            else:
                if val < 0 or val > 365:
                    hf.print_error(
                        f"\"{key}\" entry {i+1} has value {val} which is outside of acceptable parameter range [0,365). "
                    )
    #check kappa
    key = prefix + 'kappa'
    hf.check_none(key, params[key]['value'])
    hf.check_length(key, params[key]['value'], num_families)
    hf.check_values(key, params[key]['value'], 0, 100)
def check_domain(params):
    """ Check that domain properties. 
    * domainSize, 3 entires greater than 0
    * domainSizeIncrease, 3 entires, must be less than 1/2 corresponding domain size
    * ignoreBoundaryFaces, bool
    * boundaryFaces, 6 entires (0 or 1)

    Parameters
    -------------
        params : dict
            parameter dictionary
    Returns
    ---------
        None

    Notes
    ---------
        Exits program is inconsistencies are found.
    """

    if len(params['domainSize']['value']) != 3:
        hf.print_error(
            f"\"domainSize\" has defined {len(params['domainSize']['value'])} value(s) but there must be 3 non-zero values to represent x, y, and z dimensions"
        )

    for i, val in enumerate(params['domainSize']['value']):
        if val <= 0:
            hf.print_error(
                f"\"domainSize\" entry {i+1} has value {val}. Value must be positive"
            )

    if len(params['domainSizeIncrease']
           ['value']) != 3:
        hf.print_error(
            f"\"domainSizeIncrease\" has defined {len(params['domainSizeIncrease']['value'])} value(s) but there must be 3 non-zero values to represent x, y, and z dimensions"
        )

    ## Check Domain Size increase
    for i, val in enumerate(params['domainSizeIncrease']['value']):
        if val < 0:
            hf.print_error(
                f"\"domainSize\" entry {i+1} has value {val}. Value must be non-negative"
            )

        elif val >= params['domainSize']['value'][i] / 2:
            hf.print_error(
                f"\"domainSizeIncrease\" entry {i+1} is {val}, which is more than half of the domain's range in that dimension. Cannot change the domain's size by more than half of that dimension's value defined in \"domainSize\". This risks collapsing or doubling the domain."
            )

    # Check Boundary Faces
    if not params['ignoreBoundaryFaces']['value']:
        if len(params['boundaryFaces']
               ['value']) != params['boundaryFaces']['list_length']:
            hf.print_error(
                f"\"boundaryFaces\" must be a list of 6 flags (0 or 1), {len(params['boundaryFaces']['value'])} have(has) been defined. Each flag represents a side of the domain, {{+x, -x, +y, -y, +z, -z}}."
            )
        for i, val in enumerate(params['boundaryFaces']['value']):
            if val not in [0, 1]:
                hf.print_error(
                    f"\"boundaryFaces\" entry {i+1} has value {val}. Must be 0 or 1."
                )
    else:
        hf.print_warning("--> Ignoring boundary faces. Keeping all clusters.")
def check_regions_general(params):
    """ Check the number of regions provided matching the requested number. Checks boundaries of regions that they are within the domain. Checks that region_min_value < region_max_value for all three spatial coordinates.

    Parameters
    -------------
        params : dict
            parameter dictionary
    Returns
    ---------
        None

    Notes
    ---------
        Exits program is inconsistencies are found.
    """

    hf.check_none('regions', params['regions']['value'])
    hf.check_length('regions', params['regions']['value'],
                    params['numOfRegions']['value'])

    half_x_domain = params['domainSize']['value'][0] / 2.0
    half_y_domain = params['domainSize']['value'][1] / 2.0
    half_z_domain = params['domainSize']['value'][2] / 2.0

    for i, region in enumerate(params['regions']['value']):
        if len(region) != 6:
            hf.print_error(
                f"\"regions\" has defined layer #{i+1} to have {len(region)} element(s) but each region must have 6 elements, which define its upper and lower bounds"
            )

        if params['regions']['value'].count(region) > 1:
            hf.print_error(
                "\"regions\" has defined the same region more than once.")

        # X direction
        if region[1] <= region[0]:
            hf.print_error(
                f"\"regions\" has defined region #{i+1} where xmin: {region[0]} is greater than xmax: {region[1]}"
            )

        if region[0] <= -half_x_domain and region[1] <= -half_x_domain:
            hf.print_error(
                f"\"regions\" has defined region #{i+1} to have both upper and lower x-bounds completely below the domain's x-dimensional range ({-half_x_domain} to {half_x_domain}). At least one boundary must be within the domain's range. The domain's range is half of 1st value in \"domainSize\" (x-dimension) in both positive and negative directions."
            )

        if region[0] >= half_x_domain and region[1] >= half_x_domain:
            hf.print_error(
                f"\"regions\" has defined region #{i+1} to have both upper and lower x-bounds completely above the domain's x-dimensional range ({-half_x_domain} to {half_x_domain}). At least one boundary must be within the domain's range. The domain's range is half of 1st value in \"domainSize\" (x-dimension) in both positive and negative directions."
            )

        # Y direction
        if region[3] <= region[2]:
            hf.print_error(
                f"\"regions\" has defined region #{i+1} where ymin: {region[2]} is greater than ymax: {region[3]}"
            )

        if region[2] <= -half_y_domain and region[3] <= -half_y_domain:
            hf.print_error(
                f"\"regions\" has defined region #{i+1} to have both upper and lower y-bounds completely below the domain's y-dimensional range ({-half_y_domain} to {half_y_domain}). At least one boundary must be within the domain's range. The domain's range is half of 2nd value in \"domainSize\" (y-dimension) in both positive and negative directions."
            )

        if region[2] >= half_y_domain and region[3] >= half_y_domain:
            hf.print_error(
                f"\"regions\" has defined region #{i+1} to have both upper and lower y-bounds completely above the domain's y-dimensional range ({-half_y_domain} to {half_y_domain}). At least one boundary must be within the domain's range. The domain's range is half of 2nd value in \"domainSize\" (y-dimension) in both positive and negative directions."
            )

        # Z direction
        if region[5] <= region[4]:
            hf.print_error(
                f"\"regions\" has defined region #{i+1} where zmin: {region[4]} is greater than zmax: {region[5]}"
            )

        if region[4] <= -half_z_domain and region[5] <= -half_z_domain:
            hf.print_error(
                f"\"regions\" has defined region #{i+1} to have both upper and lower z-bounds completely below the domain's y-dimensional range ({-half_z_domain} to {half_z_domain}). At least one boundary must be within the domain's range. The domain's range is half of 3rd value in \"domainSize\" (z-dimension) in both positive and negative directions."
            )

        if region[4] >= half_z_domain and region[5] >= half_z_domain:
            hf.print_error(
                f"\"regions\" has defined region #{i+1} to have both upper and lower y-bounds completely above the domain's y-dimensional range ({-half_y_domain} to {half_z_domain}). At least one boundary must be within the domain's range. The domain's range is half of 3rd value in \"domainSize\" (z-dimension) in both positive and negative directions."
            )