How do I read custom results from an h5dpf file?
If I have an h5dpf file where there are custom results added (not from the RST file), see an example here
from ansys.dpf import core as dpf dpf.start_local_server(ansys_path=r"C:\Program Files\ANSYS Inc\v252") h5 = r"…\file_custom.h5" ds = dpf.DataSources() ds.set_result_file_path(h5, "h5dpf") model = dpf.Model(ds) print(model) # Read Custom Result custom_res = dpf.Operator("hdf5::h5dpf::custom") custom_res.inputs.data_sources.connect(ds) custom_res.inputs.result_name.connect("Custom Result") my_field_or_fields_container = custom_res.outputs.field_or_fields_container_as_fields_container() print(my_field_or_fields_container[0])
@Ayush Kumar , can you clarify this use case. Where is this hdf5 file coming from and what is the data structure within it? Where is the "Custom Result" name coming from? How does this work with (or not) the operators below?
dpf.operators.serialization.hdf5dpf_custom_read() dpf.operators.serialization.hdf5dpf_generate_result_file() dpf.operators.serialization.serialize_to_hdf5()
dpf.operators.serialization.serialize_to_hdf5()
@Mike.Thompson added context with a link to the example in the description. Since the format is `h5dpf` only DPF can write it.
User can define customized results in form of Fields containers along with standard solver results (like displacement, stresses, strains etc.), to fetch those results later on, one can use the h5dpf custom read operator.