Header = { 'Release' : '2025', 'Revision' : '78048', 'BuildDate' : '12 Sep 2024', 'CreationDate' : '13 Sep 2024', 'CreationTime' : '12:34:05', 'Creator' : 'hilden', 'Platform' : '64 bit Windows', } Description = ''' Parameter macro for a parameter study varying Solid Volume Percentage and Random Seed in combination to generate random seed series of increasingly dense fibrous structures with infinite circular fibers. This is the example shown in the GeoPy Scripting User Guide for Parameter Studies. ''' Variables = [ { 'Name' : 'gd_SVP', 'Label' : 'Solid Volume Percentage', 'Type' : 'double', 'Unit' : '%', 'ToolTip' : 'Solid volume percentage of the created structure.', 'BuiltinDefault' : 10.0, 'Check' : 'min0;max100' }, { 'Name' : 'gd_RandomSeed', 'Label' : 'Random Seed', 'Type' : 'int', 'Unit' : '', 'ToolTip' : 'Random Seed of the created structure.', 'BuiltinDefault' : 42 }, { 'Name' : 'gd_FiberDiameter', 'Label' : 'Fiber Diameter', 'Type' : 'double', 'Unit' : 'µm', 'ToolTip' : 'Diameter of the created fibers', 'BuiltinDefault' : 10.0, }, ] # Explanations of variables syntax: ################################### # Name: mandatory, name of the variable by that it can be addressed in the macro, must not contain white spaces! # Label: optional, appears as text in the GeoDict GUI. If not present, then Name is used also as Label # Type: mandatory, known types are bool, boolgroup, double, uint, int, string, filestring, folderstring, material, combo, table, combogroup, labelgroup # Unit: optional, appears only in GUI (not used to rescale any input parameters automatically) # for type filestring, Unit contains the file suffix # for type material, Unit must be solid, fluid or porous # for type combo, Unit must contain the possible string-values for the variable separated by semicolon # for type table, Unit must be a list of type strings, allowed is "int", "float", "string". E.g. ["int", "float", "string"] for three columns. # ToolTip: optional, appears in GUI (must be in one line) # BuiltinDefault: optional, default value which is used in macro (if not given, defaults to 0 or empty string) # for type table, this should be a python list of entries, left to right, top to bottom, e.g. [1,2.0,"three"]. # ColumnHeaders: optional, only valid for type table: List of header texts for each table column, e.g. ["Column 1", "Second column", "Third Column"] # Check: optional, known checks are positive, negative, min, max (checks are separated by semicolon) # Member: optional, defines the member of group type variables. For Labelgroups defined by a list, for combogroup and boolgroup defined by a dictionary that maps states to lists # Examples of variable usage in GeoDict command argument lists: ############################################################### # 'SolidVolumePercentage' : (gd_SVP, '%'), # Set parameter SolidVolumePercentage value of variable gd_SVP # 'ResultFileName' : f'FilterEfficiency_{gd_SVP}.gdr' # Make parameter ResultFileName include the string converted from the value of variable gd_SVP # Frequently used Python syntax: ##################################################### # print('The solid volume percentage is:', gd_SVP) # Print to console and log - file # # for x in range(0, 100) : # Use "for" loop statement # x_sq = x * x # # if gd_SVP < 0: # Use "if" statement # print('error') ChangeProjectFolder_args = { 'FolderName' : 'Variable_Study', 'CreateIfNotPresent' : True, } gd.runCmd('GeoDict:ChangeProjectFolder', ChangeProjectFolder_args) Create_args_1 = { 'ResultFileName' : f'FiberGeo_{gd_SVP}_{gd_RandomSeed}_{gd_FiberDiameter}.gdr', 'MaterialMode' : 'Material', # Possible values: Material, MaterialID 'MaterialIDMode' : 'MaterialIDPerObjectType',# Possible values: MaterialIDPerObjectType, MaterialIDPerMaterial 'Parallelization' : { 'Mode' : 'LOCAL_MAX', # Possible values: Sequential, LOCAL_THREADS, LOCAL_MPI, LOCAL_MAX, CLUSTER, Undefined }, 'Domain' : { 'PeriodicX' : False, 'PeriodicY' : False, 'PeriodicZ' : False, 'OriginX' : (0, 'm'), 'OriginY' : (0, 'm'), 'OriginZ' : (0, 'm'), 'VoxelLength' : (1e-06, 'm'), 'DomainMode' : 'VoxelNumber', 'NX' : 400, 'NY' : 400, 'NZ' : 400, 'OverlapMode' : 'GivenMaterial', # Possible values: OverlapMaterial, NewMaterial, OldMaterial, GivenMaterial 'Material' : { 'Type' : 'Fluid', 'Name' : 'Air', 'Information' : '', }, 'OverlapMaterialID' : 3, 'NumOverlapRules' : 2, 'OverlapRule1' : { 'MaterialID1' : 1, 'MaterialID2' : 1, 'OverlapMaterialID' : 1, }, 'OverlapRule2' : { 'MaterialID1' : 2, 'MaterialID2' : 2, 'OverlapMaterialID' : 2, }, 'HollowMaterialID' : 0, 'PostProcessing' : { 'ResolveOverlap' : False, 'MarkContactVoxels' : False, 'ContactMaterialID' : 3, }, }, 'MaximalTime' : (24, 'h'), 'OverlapMode' : 'AllowOverlap', # Possible values: AllowOverlap, RemoveOverlap, ForceConnection, IsolationDistance, ProhibitWithExisting, ProhibitOverlap, MatchSVFDistribution 'NumberOfObjects' : 100, 'StoppingCriterion' : 'SolidVolumePercentage',# Possible values: SolidVolumePercentage, NumberOfObjects, Grammage, Density, WeightPercentage, FillToRim, SVP, Number 'SolidVolumePercentage' : (gd_SVP, '%'), 'Grammage' : (10, 'g/m^2'), 'SaveGadStep' : 10, 'RecordIntermediateResult' : False, 'InExisting' : False, 'KeepStructure' : False, 'WeightPercentage' : (0, '%'), 'Density' : (0, 'g/cm^3'), 'RemoveOverlap' : { 'Iterations' : 1000, 'OverlapSVP' : (0, '%'), 'SVPUnchanged' : 20, 'AllowShift' : True, 'AllowRotation' : True, 'AllowDeformation' : True, 'NumberOfShifts' : 10, 'ShiftDistance' : (2, 'Voxel'), 'NumberOfRotations' : 20, 'MaximalAngle' : 60, 'DistanceMode' : 'Touch', # Possible values: Touch, Overlap, Isolation, AvoidContact 'IsolationDistance' : (0, 'm'), 'MaximalOverlap' : (0, 'm'), }, 'MatchSVFDistribution' : { 'ErrorBound' : 0.001, 'CorrelationLengthX' : (2e-05, 'm'), 'CorrelationLengthY' : (2e-05, 'm'), 'CorrelationLengthZ' : (1e-05, 'm'), 'StandardDeviation' : 0.5, 'CoarseningFactor' : 10, 'MatchMode' : 'Gauss', # Possible values: Gauss, Gradient 'RelativeDensity' : True, 'DensityFunction' : { 'XValues' : [0, 0.5, 1], 'YValues' : [1, 0.1, 1], }, }, 'PercentageType' : 0, 'RandomSeed' : gd_RandomSeed, 'IsolationDistance' : (0, 'm'), 'MatrixDensity' : (0, 'g/cm^3'), 'OverlapMaterial' : { 'Type' : 'Solid', 'Name' : 'Glass', 'Information' : 'Overlap', }, 'ContactMaterial' : { 'Type' : 'Solid', 'Name' : 'Glass', 'Information' : 'Contact', }, 'NumberOfGenerators' : 2, 'Generator1' : { 'Material' : { 'Type' : 'Solid', 'Name' : 'Glass', 'Information' : 'Fiber', }, 'Probability' : (0.5, '1'), 'SpecificWeight' : (2.58, 'g/cm^3'), 'Type' : 'InfiniteCircularFiberGenerator', 'UseDTex' : False, 'DiameterDistribution' : { 'Type' : 'Constant', # Possible values: Constant, UniformlyInInterval, Gaussian, Table, LogNormal 'Value' : gd_FiberDiameter * 1e-06, }, 'OrientationDistribution' : { 'Type' : 'AnisotropicDirection',# Possible values: Isotropic, AnisotropicDirection, AnisotropicOrientation, GivenDirection, InXYPlane, AngleAroundDirection, UNDEF 'DirectionMode' : 'AnisotropyParameter',# Possible values: AnisotropyParameter, DirectionTensor 'Anisotropy1' : 7, 'Anisotropy2' : 1, 'Phi' : 0, 'Theta' : 0, 'Psi' : 0, }, }, 'Generator2' : { 'Material' : { 'Type' : 'Solid', 'Name' : 'Glass', 'Information' : 'Fiber', }, 'Probability' : (0.5, '1'), 'SpecificWeight' : (2.58, 'g/cm^3'), 'Type' : 'InfiniteCircularFiberGenerator', 'UseDTex' : False, 'DiameterDistribution' : { 'Type' : 'Constant', # Possible values: Constant, UniformlyInInterval, Gaussian, Table, LogNormal 'Value' : 6e-06, }, 'OrientationDistribution' : { 'Type' : 'AnisotropicDirection',# Possible values: Isotropic, AnisotropicDirection, AnisotropicOrientation, GivenDirection, InXYPlane, AngleAroundDirection, UNDEF 'DirectionMode' : 'AnisotropyParameter',# Possible values: AnisotropyParameter, DirectionTensor 'Anisotropy1' : 5, 'Anisotropy2' : 1, 'Phi' : 0, 'Theta' : 0, 'Psi' : 0, }, }, 'Temperature' : (293.15, 'K'), } gd.runCmd("FiberGeo:Create", Create_args_1, Header['Release'])