Hello,
i am trying to retrieve displacements for select nodes in a very large rst file (>800 gb) in order to do a sumproduct on the results files (mode shapes) with modal displacements that i have computed in a third party software.
I have tried the pyMAPDL method, which executes, but provides the incorrect displacements (displacements are zero for all nodes), and ignores my requests to only retrieve the data for my nodes of interest via the "nodes=" input on the nodal_displacement method.
import glob,os,time
from ansys.mapdl import reader as pymapdl_reader
working_dir = os.getcwd()
rst_file=sorted(glob.glob(os.path.join(working_dir,'ansexp.rst')))[0]
result = pymapdl_reader.read_binary(rst_file)
num, disp = result.nodal_displacement(0)
I have also tried the DPF method, which does not execute. I set up my data source, my operator (displacement) with nodal and temporal scoping as inputs. When i request the output field container it hangs and i get killed () at the end.
import glob,os,time
from datetime import date
from ansys.dpf.core import mesh_scoping_factory
from ansys.dpf.core import locations
from ansys.dpf import core as dpf
from ansys.dpf.core import operators as ops
working_dir = os.getcwd()
rst_file=sorted(glob.glob(os.path.join(working_dir,'ansexp.rst')))[0]
my_nodal_scoping = mesh_scoping_factory.nodal_scoping()
my_nodal_scoping = dpf.Scoping()
my_nodal_scoping.location = "Nodal"
with open('nodeids.dat') as file:
all_ids = [int(line.rstrip()) for line in file]
my_nodal_scoping.ids = all_ids
my_time_scoping = dpf.Scoping()
my_time_scoping.ids = range(0,2)
data_sources = dpf.DataSources()
data_sources.set_result_file_path(rst_file)
data_sources.result_files
#model=dpf.Model(data_sources)
op=ops.result.displacement(time_scoping=my_time_scoping,mesh_scoping=my_nodal_scoping)
op.inputs.data_sources(data_sources)
fc=op.outputs.fields_container()
I am looking for some guidance as to how to efficiently get the sumproduct of my results files with a set of scale factors (modal displacements) as doing it in APDL is too clunky and cumbersome (takes >12 hours).
Thanks in advance