Model.compute_midmesh_thickness#
- Model.compute_midmesh_thickness(mesh_collection, geom_collection, AbsoluteGroupingTolerance=0.0, AppendToTable=0, AssignMidIntervalAsThickness=0, CardImage='', ConnectionInterpolationFactor=0.0, CornerThicknessCorrectionThreshold=1.500000, FeatureAngle=30.0, FixedInterval=0.0, GroupThickness=0, GroupingTolerance=0.0, HighlightCorrected=0, LogFile='', MaxInclinationOfMidMeshWithSolid=35.0, MaxRelativeChordalDeviation=0.100000, MaxSearchDistance=0.0, MaxThickness=0.0, MaxThicknessGradient=2.0, MinThickness=0.0, NeedOffset=0, NewPropertyPrefix='thickness', NumDecimals='', RegroupThicknessVariationFactor=0.200000, RenameRetainedComponents=0, SampleProperty='', SkipOutsideMeshFromCorrection=0, StartThickness=0.0, ThicknessAssignMethod='Average', ThicknessCorrectionMethod='Interpolation', ThicknessOutputOption='', WriteToInclude=0, ThicknessMeasurementLocation='', NumDecimalsOffset='')#
Computes the thickness of the midmesh elements based on the proximity with the geometry. New properties are created with thickness assigned. The function expects a baseline property with the name t0 to exist before execution. It estimates thickness and assigns the thicknesses to new properties, using the t0 property as a template. Optionally, an expected minimum and maximum thicknesses can be supplied, which will be used and a guide for the computation.
This functionality is currently supported for the OptiStruct, Radioss, Nastran, Abaqus, LS-DYNA and ANSYS user profiles.
- Parameters:
mesh_collection (Collection) – The collection containing the entities to be used for mesh input. Valid entities are elements and components.
geom_collection (Collection) – The collection containing the entities to be used for geometry input. Valid entities are solids, surfaces, elements and components.
AbsoluteGroupingTolerance (double) – The band width of the thickness group. This is applicable only when
ThicknessOutputOption="PropertyOnElements"orThicknessOutputOption="PropertyOnComponents2", or whenGroupThicknessis enabled. It takes value >0 but the default is equal to 0, which means this option is ignored andGroupingToleranceis used.AppendToTable (int) – If set to 1, when run for the second time, the current computation results will be added to an existing table. This option is valid only for Radioss.
AssignMidIntervalAsThickness (int) –
Specifies whether to use the mid-value of the interval as the thickness of the group. Valid values are:
-1 - The function chooses the behavior (for
FixedInterval = 1, behaves as 1, 0 otherwise). Default if not specified.0 - Assigns the average thickness of all elements in the group.
1 - Assigns the mid-value of the interval.
CardImage (hwString) – The card image to be used to create new properties. This is applicable only if the
ThicknessOutputOption="PropertyOnElements"orThicknessOutputOption="PropertyOnComponents2". As a default value a suitable default card image is used according to the selected solver profile.ConnectionInterpolationFactor (double) –
The factor used in interpolating the thickness values near a connection (sharp corners, t/x-junctions). Valid factors are:
0 - Approximate mass conserved thickness estimation at connections.
0 <
ConnectionInterpolationFactor< 1 - Thickness linearly decreases towards the connection.1 - Thickness is interpolated constantly (default).
> 1 - Thickness linearly increases towards the connection.
CornerThicknessCorrectionThreshold (double) – The ratio of the maximum thickness allowed at corners to the maximum thickness of the rest of the face. If a thickness exceeds this ratio at the corners, it will be corrected. The inverse of this ratio is used to limit the maximum thickness at the corners as well. Valid values are > 1, but the default is 1.5.
FeatureAngle (double) – The angle used to decide the features of the mid-mesh. The corner scaling options are applied to these features. Valid values are 0 \(\lt\)
FeatureAngle\(\gt\) 180. The default value is 30.0.FixedInterval (double) – User defined “fixed” thickness interval value for each group of elements.
GroupThickness (int) –
Defines whether the calculated exact thickness needs to be grouped and an average value needs to be assigned. This helps reduce the number of different thickness values, at the cost of accuracy of the results. This is applicable only if
ThicknessOutputOption="Element". This is always turned on ifThicknessOutputOption="PropertyOnElements"orThicknessOutputOption="PropertyOnComponents2", and always turned off ifThicknessOutputOption="Node"orThicknessOutputOption="ElementNodal".0 - Do not group thickness (default).
1 - Group thickness.
GroupingTolerance (double) – The relative band width of the thickness group (in terms of a factor of the average group thickness). This is applicable only when
ThicknessOutputOption=PropertyOnElementsorThicknessOutputOption=PropertyOnComponents, or whenGroupThicknessis enabled. This is ignored if,AbsoluteGroupingToleranceis provided. Valid values are 0 \(\lt\)GroupingTolerance\(\gt\) 1.0. The default value is 0.2.HighlightCorrected (int) –
0 - Assign an extrapolated thickness value to any mesh outside the solid.
1 - Highlight the corrected entities.
LogFile (hwString) – The full path and name of the file where the function execution information is to be logged.
MaxInclinationOfMidMeshWithSolid (double) – The maximum angle that the mid-mesh makes with the solid, beyond which the estimated thickness will be ignored and corrected. Valid values are 0 \(\lt\)
MaxInclinationOfMidMeshWithSolid\(\gt\) 90.0. The default value is 35.0.MaxRelativeChordalDeviation (double) – The maximum chordal deviation to use when generating facets used for internal calculations, relative to the minimum thickness. Applicable only if the entity type in
geom_collectionis surfaces or solids. The default is 0.1, which means for a minimum thickness of 1.0, the geometry faceting will use a maximum chordal deviation of 0.1.MaxSearchDistance (double) – The maximum proximity distance which is considered for the thickness calculation. Valid values are ≥ 0, where 0 means the max distance is calculated internally, based on the model bounding box dimensions.
MaxThickness (double) – The maximum thickness expected in the model. Any thickness estimated more than this is set to this value.
MaxThicknessGradient (double) – The maximum change in thickness allowed across two adjacent measurement locations, as a factor of the distance between the locations. Valid values are 0 \(\lt\) :python:` MaxThicknessGradient` \(\ge\) 10.0. The default value is 2.0.
MinThickness (double) – The minimum thickness expected in the model. Any thickness less than this is corrected.
NeedOffset (int) –
Defines whether element offset values are required or not. Valid values are:
0 - Offset values are not needed (default).
1 - Offset values are needed.
NewPropertyPrefix (hwString) – The prefix to be used for naming the newly created properties/components. This is applicable only if the ThicknessOutputOption is
ThicknessOutputOption=PropertyOnElementsorThicknessOutputOption=PropertyOnComponents. Default value isNewPropertyPrefix="thickness". IfSamplePropertyis supplied, its name is used instead.NumDecimals (hwString) –
The number of decimal digits to use in the output. The output will be truncated with the given value: value > 0 - The number of digits required after the decimal point. value = 0 - Rounded off to nearest integer. value < 0 - The minimum number of zeros required before the decimal point. auto - 1% of the estimated min thickness. AbsoluteGroupingTolerance - Use the same precision as
AbsoluteGroupingTolerance. .. note:**Examples:** :python:`NumDecimals="2"` 303.2134 -> 303.21 316.6666 -> 316.67 :python:`NumDecimals="0"` 303.2134 -> 303 316.6666 -> 307 :python:`NumDecimals="-1"` 303.2134 -> 300 316.6666 -> 310 :python:`NumDecimals="auto"` 303.2134 -> 303 4316.6666 -> 4320
RegroupThicknessVariationFactor (double) – The tolerance factor used to determine if element is going to be regrouped in case of merging isolated elements into adjacent groups. For example, if the value is 0.2, elements can only be regrouped if the percentage change in thickness is going to be less than 20%. Valid values are 0 \(\lt\)
RegroupThicknessVariationFactor\(\gt\) 1.0. The default value is 0.2.RenameRetainedComponents (int) – New components are created only if the existing component contains more than one thickness groups. If all the elements in an existing component have the same thickness, the component is retained as it is. In that case, setting this option to
RenameRetainedComponents=1ensures that the retained component is renamed as per the naming rules for new components. This is applicable only when theThicknessOutputOption="PropertyOnComponents2".SampleProperty (hwString) – If
CardImageis not supplied, a sample property can be supplied which will be used as a template to create the new properties. This is applicable only if theThicknessOutputOption=PropertyOnElementsorThicknessOutputOption=PropertyOnComponents. This is also applicable when theCardImageoption is not supported by this function.SkipOutsideMeshFromCorrection (int) –
0 - Assign an extrapolated thickness value to any mesh outside the solid (default).
1 - Do not assign any thickness to any mesh which is determined to be outside the solid, even if it is connected to the mid-mesh inside.
StartThickness (double) – User defined “fixed” start thickness value of the first group. This is applicable only for the user-defined fixed interval scheme.
ThicknessAssignMethod (hwString) –
The method of assigning thickness. Valid values are Average (default), Min-interval, Mid-interval, and Max-interval.
If set to Average, the thickness assigned to the group will be the average thickness value of all the elements in that group.
If set to Min-interval, the thickness assigned to the group will be set to the minimum thickness element in that group if automatic method is chosen, and the left boundary thickness if fixed interval method is chosen.
ThicknessCorrectionMethod (hwString) –
The method to be used to correct the thickness on elements/nodes where thickness could not be estimated, or estimated incorrectly. Valid methods are:
Interpolation - Interpolates the thickness from the neighborhood (default).
UseMinOrMaxThickness - Resets the estimated thicknesses which exceeds the min or max limits to the set limits.
ThicknessOutputOption (hwString) –
Specify how the thickness data should be output. Valid options are:
Node - Thickness assigned on node card.
Element - Thickness assigned on element card (default for Radioss).
ElementNodal - Thickness assigned as nodal thickness on element card (default for LS-DYNA).
PropertyOnComponents2 – Thickness assigned on component properties, additionally make sure that elements originally from different components are not grouped into the same component because they have the same thickness. This is achieved by creating components with naming scheme <component_name>_<prefix>_<thickness>.
PropertyOnElements - Thickness assigned on element properties (default for OptiStruct, Abaqus and Nastran).
WriteToInclude (int) – If set to 1, the computation results will be written to an include file. This option is valid only for Radioss.
ThicknessMeasurementLocation (hwString) – Reserved for future development.
NumDecimalsOffset (hwString) – Reserved for future development. Users can set the value auto when
NumDecimals="auto".
Examples#
Calculate the midmesh thickness for all shell elements , based off of the displayed surfaces , use a min thickness of 0.1 and a max thickness of 1.0#import hm import hm.entities as ent model = hm.Model() elems_collection = hm.Collection(model, ent.Element) surfs_collection = hm.CollectionByDisplayed(model, ent.Surface) model.compute_midmesh_thickness( mesh_collection=elems_collection, geom_collection=surfs_collection, MinThickness=0.1, MaxThickness=1.0, )
Calculate the midmesh thickness for all shell elements , based off of the displayed surfaces , use a min thickness of 0.1 and a max thickness of 1.0 with “ SHELL63p “ property for ANSYS#import hm import hm.entities as ent model = hm.Model() elems_collection = hm.Collection(model, ent.Element) surfs_collection = hm.CollectionByDisplayed(model, ent.Surface) model.compute_midmesh_thickness( mesh_collection=elems_collection, geom_collection=surfs_collection, ThicknessOutputOption="PropertyOnComponents2", NeedOffset=0, ThicknessCorrectionMethod="Interpolation", ConnectionInterpolationFactor=1.0, LogFile="C:/Users/Temp/__ThicknessCalculationLog263.log", CardImage="SHELL63p", GroupingTolerance=0.2, NumDecimals="auto", NumDecimalsOffset="auto", MaxInclinationOfMidMeshWithSolid=35, MaxThicknessGradient=2.0, SkipOutsideMeshFromCorrection=0, MaxRelativeChordalDeviation=0.1, )
Calculate the midmesh thickness for all shell elements , based off of the displayed surfaces , use a min thickness of 0.1 and a max thickness of 1.0 with “ SECTYPE “ property for ANSYS#import hm import hm.entities as ent model = hm.Model() elems_collection = hm.Collection(model, ent.Element) surfs_collection = hm.CollectionByDisplayed(model, ent.Surface) model.compute_midmesh_thickness( mesh_collection=elems_collection, geom_collection=surfs_collection, ThicknessOutputOption="PropertyOnComponents2", NeedOffset=0, ThicknessCorrectionMethod="Interpolation", ConnectionInterpolationFactor=1.0, LogFile="C:/Users/Temp/__ThicknessCalculationLog263.log", CardImage="SECTYPE", GroupingTolerance=0.2, NumDecimals="auto", NumDecimalsOffset="auto", MaxInclinationOfMidMeshWithSolid=35, MaxThicknessGradient=2.0, SkipOutsideMeshFromCorrection=0, MaxRelativeChordalDeviation=0.1, )