Model.realizeentity_fields_byentity#
- Model.realizeentity_fields_byentity(field, target_collection=Collection(), fieldtype='', interpolation='', searchradius=0.0, face_nodes_collection=Collection(), resultdatatypes='', resultdatacomps='', reportfilename='', surface=Entity(), minmaxnodes=s_defaultEntityList, cyclicsystem=Entity(), tolerance=0.0, resultloadcases=hwStringList())#
Realizes a field into solver data.
- Parameters:
field (Entity) – The object describing the field entity.
target_collection (Collection) – The collection containing the target entities. Valid entities are nodes and elements.
fieldtype (hwString) –
The type of field to realize.
Valid values are pressure, materialorientation, propertyid and table for realizing on elements.
Valid values are temperature, displacement and table for realizing on nodes.
interpolation (hwString) –
The interpolation method. Valid values are forcebalancing, inversedistanceweighting, linearinterpolation, proximity, shapefunction, shapefunctionandproximity and triangulation.
The triangulation interpolation is valid for discrete fields only.
For shape function and proximity interpolation, initially it will map using shape function interpolation. Then for failed entities, it will map using proximity interpolation.
Force balancing is for mapping forces and is done using the solver.
searchradius (double) –
The search radius for proximity interpolation or linear interpolation, or the normal distance tolerance for shape function interpolation (the distance from source to target entity along the normal of the source mesh).
If the search radius is 0, the nearest value will be taken for proximity or shape function interpolation.
The search radius for linear interpolation option must be > 0.
face_nodes_collection (Collection) – The collection containing the face nodes entities of target entities, when realizing on solid elements.
resultdatatypes (hwString) – The data types when realizing from result files. Examples may include Displacement, Grid temperatures, etc. Valid values are dependent on the particular result file.
resultdatacomps (hwString) – The data component of the selected result data type. Examples may include Scalar value for temperatures, X, Y, Z for Displacement, etc. Valid values are dependent on the particular result file.
reportfilename (hwString) – The CSV report path and file name for source and target entity mapping details.
surface (Entity) – The object describing the surface entity.
minmaxnodes (EntityList) –
Used to modify the parametric position of the target mesh. This takes the node ID’s at the (0,0) and (1,1) parametric position.
This option is valid for realizing parametric field types only.
cyclicsystem (Entity) – The ID of a cylindrical coordinate system to use for cyclic symmetry. This option is not valid for parametric fields or for realizing using linear interpolation.
tolerance (double) – The merge tolerance if the projected target point on the source mesh is outside of the element. This is valid only for shape function interpolation or triangulation interpolation. The default if not specified is the global node tolerance.
resultloadcases (hwStringList) – The list of load cases from result files, for which the field is to be realized. If all load cases and time steps are to be realized, then create the string array with value
["all"].
Examples#
Realize field with ID 1 for property ID mapping on elements from a field have a source mesh , use proximity interpolation#import hm import hm.entities as ent model = hm.Model() model.realizeentity_fields_byentity( field=ent.Field(model, 1), target_collection=hm.Collection(model, ent.Element), fieldtype="propertyid", interpolation="proximity", )
Realize parametric field with ID 2 for temperatures on nodes of surface with ID 1579 have ( 0,0 ) parametric position at node with ID 1 and ( 1,1 ) parametric position at node with ID 1000 , use shapefunction interpolation#import hm import hm.entities as ent model = hm.Model() # Creating a collection that contains the nodes with IDs 1-1440 filter_nodes = hm.FilterByEnumeration(ent.Node, list(range(1, 1441))) nodes_collection = hm.Collection(model, filter_nodes) model.realizeentity_fields_byentity( field=ent.Field(model, 2), target_collection=nodes_collection, fieldtype="temperature", surface=ent.Surface(model, 1579), minmaxnodes=[ent.Node(model, 1), ent.Node(model, 1000)], interpolation="shapefunction", )
Realize field with ID 3 on all nodes have result file name as “curve_shell_nastran.op2” , for subcase “SUBCASE 1” and time steps of the selected subcase {Time = 0.140000 , Time=0.020000 and Time=0.0220000}#import hm import hm.entities as ent model = hm.Model() model.realizeentity_fields_byentity( field=ent.Field(model, 3), target_collection=hm.Collection(model, ent.Node), fieldtype="temperature", interpolation="shapefunction", resultloadcases=[ "curve_shells_nastran.op2;{SUBCASE 1}", "{Time = 0.020000} {Time = 0.140000} {Time = 0.220000}", ], )
Realize field with ID 5 for cyclic symmetry using cylindrical system with ID 5 on all nodes having temperatures by using value from file and source is of current model#import hm import hm.entities as ent model = hm.Model() model.realizeentity_fields_byentity( field=ent.Field(model, 5), target_collection=hm.Collection(model, ent.Node), fieldtype="temperature", interpolation="shapefunction", cyclicsystem=ent.System(model, 5), )