def procMat(materials, max_thickness, min_thickness):
newmat = []<EOL>newthickness = []<EOL>k = materials.layerThermalCond<EOL>Vhc = materials.layerVolHeat<EOL>if len(materials.layerThickness) > <NUM_LIT:1>:<EOL><INDENT>for j in range(len(materials.layerThickness)):<EOL><INDENT>if materials.layerThickness[j] > max_thickness:<EOL><INDENT>nlayers = math.ceil(materials.layerThickness[j]/float(max_thickness))<EOL>for i in range(int(nlayers)):<EOL><INDENT>newmat.append(Material(k[j], Vhc[j], name=materials._name))<EOL>newthickness.append(materials.layerThickness[j]/float(nlayers))<EOL><DEDENT><DEDENT>elif materials.layerThickness[j] < min_thickness:<EOL><INDENT>print("<STR_LIT>").format(<EOL>materials._name, min_thickness*<NUM_LIT:100>)<EOL><DEDENT>else:<EOL><INDENT>newmat.append(Material(k[j], Vhc[j], name=materials._name))<EOL>newthickness.append(materials.layerThickness[j])<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>if materials.layerThickness[<NUM_LIT:0>] > max_thickness:<EOL><INDENT>nlayers = math.ceil(materials.layerThickness[<NUM_LIT:0>]/float(max_thickness))<EOL>for i in range(int(nlayers)):<EOL><INDENT>newmat.append(Material(k[<NUM_LIT:0>], Vhc[<NUM_LIT:0>], name=materials._name))<EOL>newthickness.append(materials.layerThickness[<NUM_LIT:0>]/float(nlayers))<EOL><DEDENT><DEDENT>elif materials.layerThickness[<NUM_LIT:0>] < min_thickness*<NUM_LIT:2>:<EOL><INDENT>newthickness = [min_thickness/<NUM_LIT>, min_thickness/<NUM_LIT>]<EOL>newmat = [Material(k[<NUM_LIT:0>], Vhc[<NUM_LIT:0>], name=materials._name),<EOL>Material(k[<NUM_LIT:0>], Vhc[<NUM_LIT:0>], name=materials._name)]<EOL>print("<STR_LIT>".format(<EOL>materials._name))<EOL><DEDENT>else:<EOL><INDENT>newthickness = [materials.layerThickness[<NUM_LIT:0>]/<NUM_LIT>, materials.layerThickness[<NUM_LIT:0>]/<NUM_LIT>]<EOL>newmat = [Material(k[<NUM_LIT:0>], Vhc[<NUM_LIT:0>], name=materials._name),<EOL>Material(k[<NUM_LIT:0>], Vhc[<NUM_LIT:0>], name=materials._name)]<EOL><DEDENT><DEDENT>return newmat, newthickness<EOL>
Processes material layer so that a material with single
    layer thickness is divided into two and material layer that is too
    thick is subdivided