I have a PyDPF script and want to remove some contact types from the scoping, how do I do that ?
Below is an example:
from ansys.dpf import core as dpf import os work_dir = os.getcwd() rst_name = "file.rst" model = dpf.Model(os.path.join(work_dir, rst_name)) mesh = model.metadata.meshed_region apdl_types = mesh.property_field('apdl_element_type').data apdl_types_list = list(dict.fromkeys(list(apdl_types))) print('available elements:' + str(apdl_types_list)) full_mesh_scoping_op = dpf.operators.scoping.from_mesh() full_mesh_scoping_op.inputs.mesh.connect(mesh) full_mesh_scoping_op.inputs.requested_location.connect(dpf.locations.elemental) full_mesh_scoping = full_mesh_scoping_op.outputs.scoping() contact_scoping_op = dpf.operators.scoping.on_mesh_property() contact_scoping_op.inputs.property_name.connect('apdl_element_type') contact_scoping_op.inputs.property_id.connect(174) contact_scoping_op.inputs.mesh.connect(mesh) contact_scoping = contact_scoping_op.outputs.mesh_scoping() all_mesh_but_contact_op = dpf.operators.scoping.intersect() # operator instantiation all_mesh_but_contact_op.inputs.scopingA.connect(full_mesh_scoping) all_mesh_but_contact_op.inputs.scopingB.connect(contact_scoping) remaining_mesh_scoping = all_mesh_but_contact_op.outputs.scopingA_min_intersection() mesh_extract = dpf.operators.mesh.mesh_extraction() # operator instantiation mesh_extract.inputs.mesh.connect(mesh) mesh_extract.inputs.mesh_scoping.connect(remaining_mesh_scoping) mesh_subscoped = mesh_extract.outputs.abstract_meshed_region() temperature_op = model.results.structural_temperature() temperature_op.inputs.requested_location.connect(dpf.locations.nodal) temperature_op.inputs.mesh.connect(mesh_subscoped) temp = temperature_op.outputs.fields_container()