Commit 35188cf3 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Implement YAML configuration for INCLUSION development case

parent caad85e9
Loading
Loading
Loading
Loading
+61 −19
Original line number Diff line number Diff line
@@ -139,7 +139,8 @@ def load_model(model_file):
            )
        }
        sconf['nsph'] = int(model['particle_settings']['n_spheres'])
        sconf['ies'] = 1 if model['particle_settings']['application'] == "INCLUSION" else 0
        sconf['application'] = model['particle_settings']['application']
        sconf['ies'] = 1 if sconf['application'] == "INCLUSION" else 0
        sconf['exdc'] = float(model['material_settings']['extern_diel'])
        sconf['wp'] = float(model['radiation_settings']['wp'])
        sconf['xip'] = float(model['radiation_settings']['xip'])
@@ -163,6 +164,8 @@ def load_model(model_file):
            sconf['nshl'] = [0 for i in range(sconf['configurations'])]
            for i in range(sconf['configurations']):
                sconf['nshl'][i] = int(model['particle_settings']['n_layers'][i])
            if (sconf['application'] == "INCLUSION"):
                sconf['nshl'][0] += 1
        max_layers = max(sconf['nshl'])
        if (num_dielec != sconf['configurations']):
            print("ERROR: declared array of optical constants does not match configurations!")
@@ -531,11 +534,15 @@ def write_legacy_sconf(conf):
    if (sphere_count != 0):
        output.write("\n")
    for ci in range(conf['configurations']):
        str_line = "{0:3d}   {1:15.7E}\n".format(conf['nshl'][ci], conf['ros'][ci])
        layers = conf['nshl'][ci]
        if (conf['application'] == "INCLUSION" and ci == 0):
            layers -= 1
        str_line = "{0:3d}   {1:15.7E}\n".format(layers, conf['ros'][ci])
        output.write(str_line)
        for cj in range(conf['nshl'][ci]):
            str_line = " {0:.7E}\n".format(conf['rcf'][ci][cj])
            output.write(str_line)
    if (conf['application'] != "INCLUSION"):
        if (conf['idfc'] == 0):
            # Write all wavelength dependent constants for each layer in each configuration
            for xi in range(conf['configurations']):
@@ -556,6 +563,41 @@ def write_legacy_sconf(conf):
                    if (rdc0 != 0.0 or idc0 != 0.0):
                        str_line = "({0:11.5E},{1:11.5E})\n".format(rdc0, idc0)
                        output.write(str_line)
    else: # specialized output for INCLUSION
        if (conf['idfc'] == 0):
            # Write all wavelength dependent constants for each layer in each configuration
            for xi in range(conf['configurations']):
                layers = conf['nshl'][xi] - 1
                for xj in range(layers):
                    for xk in range(conf['nxi']):
                        for xii in range(conf['configurations']):
                            rdc0 = conf['rdc0'][xj][xii][xk]
                            idc0 = conf['idc0'][xj][xii][xk]
                            if (rdc0 != 0.0 or idc0 != 0.0):
                                str_line = "({0:11.5E},{1:11.5E})\n".format(rdc0, idc0)
                                output.write(str_line)
                            if (xii == conf['configurations'] - 1):
                                rdc0 = conf['rdc0'][layers][0][xk]
                                idc0 = conf['idc0'][layers][0][xk]
                                if (rdc0 != 0.0 or idc0 != 0.0):
                                    str_line = "({0:11.5E},{1:11.5E})\n".format(rdc0, idc0)
                                    output.write(str_line)
        elif (conf['idfc'] == -1):
            # Write reference scale constants for each layer in each configuration
            for xi in range(conf['configurations']):
                layers = conf['nshl'][xi] - 1
                for xj in range(layers):
                    rdc0 = conf['rdc0'][xj][xi][0]
                    idc0 = conf['idc0'][xj][xi][0]
                    if (rdc0 != 0.0 or idc0 != 0.0):
                        str_line = "({0:11.5E},{1:11.5E})\n".format(rdc0, idc0)
                        output.write(str_line)
                    if (xi == conf['configurations'] - 1):
                        rdc0 = conf['rdc0'][layers][0][0]
                        idc0 = conf['idc0'][layers][0][0]
                        if (rdc0 != 0.0 or idc0 != 0.0):
                            str_line = "({0:11.5E},{1:11.5E})\n".format(rdc0, idc0)
                            output.write(str_line)
    output.write("0\n")
    output.close()
    return result
+135 −0
Original line number Diff line number Diff line
system_settings:
  # Limit on host RAM use in Gb (0 for no configuration limit)
  max_host_ram : 0
  # Limit on GPU RAM use in Gb ( 0 for no configuration limit)
  max_gpu_ram  : 0

input_settings:
  # Folder to write the code input configuration files
  input_folder : "."
  # Name of the scatterer description file
  spheres_file : "DEDFB"
  # Name of the geometry description file
  geometry_file: "DINCLU"
  
output_settings:
  # Folder for the code output storage
  output_folder: "."
  # Name of the main output file
  output_name  : "c_OCLU"
  # Requested output formats
  formats      : [ "LEGACY", "HDF5" ]
  # Index of the scale for transition matrix output
  jwtm         : 2

particle_settings:
  # What application to use (SPHERE | CLUSTER | INCLUSION)
  application : "INCLUSION"
  # Number of spheres
  n_spheres   : 2
  # Number of sphere types
  n_types     : 2
  # Vector of sphere type identifiers (what type is each sphere)
  sph_types   : [ 1, 2 ]
  # Vector of layers in types (how many layers in each type)
  n_layers    : [ 1, 1 ]
  # Spherical monomer radii in m (one size for each type)
  radii       : [ 2.0e-8, 2.0e-8 ]
  # Layer fractional radii (one per layer in each type)
  rad_frac    : [ [ 1.0, 3.0 ], [ 1.0 ] ]
  # Index of the dielectric constants (one per layer in each type)
  #
  # 1 is first file in `dielec_file`, 2 is second ...
  dielec_id   : [ [ 1, 3 ], [ 2 ] ]

material_settings:
  diel_flag   : 0
  # External medium dielectric constant
  extern_diel : 1.0e+00
  # Dielectric constant files folder
  dielec_path : "../../test_data/inclusion"
  # List of dielectric constant files (used if diel_flag = 0)
  dielec_file : [ "eps_sp1.csv", "eps_sp2.csv", "eps_spe.csv" ]
  # Dielectric constant files format (same for all files)
  dielec_fmt  : [ "CSV" ]
  # Matching method between optical constants and radiation wavelengths
  #
  # INTERPOLATE: the constants are interpolated on wavelengths
  # GRID: only the wavelengths with defined constants are computed
  #
  match_mode  : "GRID"
  # Reference dielectric constants (used if diel_flag = -1)
  #
  # One real and one imaginary part for each layer in each type.
  diel_const  : [ ]

radiation_settings:
  # Radiation field polarization (LINEAR | CIRCULAR)
  polarization: "LINEAR"
  # First scale to be used
  scale_start : 1.0e-07
  # Last scale to be used
  scale_end   : 1.5e-07
  # Calculation step (overridden if `match_mode` is GRID)
  scale_step  : 5.0e-08
  # Peak Omega
  wp          : 3.00e+08
  # Peak scale
  xip         : 1.00e+00
  # Define scale explicitly (0) or in equal steps (1)
  step_flag   : 0
  # Type of scaling variable
  scale_name  : "WAVELENGTH"

geometry_settings:
  # Maximum internal field expansion
  li          : 3
  # Maximum external field expansion (not used by SPHERE)
  le          : 3
  # Number of transition layer integration points
  npnt        : 149
  # Number of non transition layer integration points
  npntts      : 300
  # Averaging mode
  iavm        : 0
  # Meridional plane flag
  isam        : 0
  # Starting incidence azimuth angle
  in_th_start : 0.0
  # Incidence azimuth angle incremental step
  in_th_step  : 0.0
  # Ending incidence azimuth angle
  in_th_end   : 0.0
  # Starting incidence elevation angle
  in_ph_start : 0.0
  # Incidence elevation angle incremental step
  in_ph_step  : 0.0
  # Ending incidence elevation angle
  in_ph_end   : 0.0
  # Starting scattered azimuth angle
  sc_th_start : 0.0
  # Scattered azimuth angle incremental step
  sc_th_step  : 0.0
  # Ending scattered azimuth angle
  sc_th_end   : 0.0
  # Starting scattered elevation angle
  sc_ph_start : 0.0
  # Scattered elevation angle incremental step
  sc_ph_step  : 0.0
  # Ending scattered elevation angle
  sc_ph_end   : 0.0
  # Vector of sphere X coordinates (one per sphere)
  x_coords    : [
    2.10e-08,
    -2.10e-08
    ]
  # Vector of sphere Y coordinates (one per sphere)
  y_coords    : [
    0.00e+00,
    0.00e+00
    ]
  # Vector of sphere Z coordinates (one per sphere)
  z_coords    : [
    0.00e+00,
    0.00e+00
    ]
+7 −0
Original line number Diff line number Diff line
# Dielectric constants of SPHERE 1 for INCLUSION
#
# Wavelengths are in meters.
#
#Wavelength,Re(EPS),Im(EPS)
1.0000000e-07,2.560000e00,0.000000e-01
1.5000000e-07,4.000000e00,0.000000e-01
+7 −0
Original line number Diff line number Diff line
# Dielectric constants of SPHERE 2 for INCLUSION
#
# Wavelengths are in meters.
#
#Wavelength,Re(EPS),Im(EPS)
1.0000000e-07,1.690000e00,0.000000e-01
1.5000000e-07,2.000000e00,0.000000e-01
+7 −0
Original line number Diff line number Diff line
# Dielectric constants of EXTERNAL SPHERE for INCLUSION
#
# Wavelengths are in meters.
#
#Wavelength,Re(EPS),Im(EPS)
1.0000000e-07,2.000000e00,0.010000e-01
1.5000000e-07,3.200000e00,0.030000e-01