On 10/30/2017 03:59 PM, Kathrin Sobe wrote:
thank you for the help.
The interplation was working according to the examples from tests.
This is a part of the code from my linear elastic problem, the result extraction (displacements, stress and strain) and the additional interpolation of certain points at the end:
# field and field variables field = Field.from_args('displacement', numpy.float64, 3, omega, approx_order=1) u = FieldVariable('u', 'unknown', field, order=0) v = FieldVariable('v', 'test', field, primary_var_name='u') ... # run simulation vec = pb.solve() # postprocessing and saving results output_dict = vec.create_output_dict(fill_value=None, extend=True, linearization=None) # u als key # struct array displacements, strain, stress output_dict = post_process(output_dict, pb, state, extend=True) nodes_displacements = output_dict['u'].data strain_tensors = output_dict['cauchy_strain'].data stress_tensors = output_dict['cauchy_stress'].data ... p1 = numpy.array([1120, 53.375, 60.804]) coors = numpy.array([p1]) interpolations = u.evaluate_at(coors)
My question is: Is it possible to run the point interpolation after everything is finished and closed just by loading the saved result data. What I mean is, I run the FE simulation in a first step and I save the results (displacements, stress, strain). Later, I would like to load the saved data and run the point interpolation. As far as I understand the code, I would need the FieldVariable and the Field, but also the results data of the problem. Could you give some advice what would be necessary for saving to reload the required data structures for the interpolation?
You could try using Problem.save_restart() (to save the state after the problem is solved) and Problem.load_restart() (to load the state instead of solving again). But this needs the full problem instance, which might be too heavy. This use case was not really considered.
Thank you, Kathrin
2017-10-24 21:24 GMT+02:00 Robert Cimrman email@example.com:
On 10/24/2017 06:08 PM, Kathrin Sobe wrote:
I was looking for a postprocessing method to calculate the displacements for points on the surface of the mesh that are not necessarily node points. Precisely I need a interpolation function that gives me the displacement of these points. The input would be the already calculated linear elastic problem from my earlier example with the node displacements as result.
In the sfepy documentation I found the probing described here: http://sfepy.org/doc-devel/primer.html#sec-primer
Is this the right way to solve the interpolation? Do you recommend something different?
Yes, the best is to use FieldVariable.evaluate_at(), which can evaluate a FE field variable in physical points coordinates (i.e. not reference element coordinates) - check tests/test_projections.py or tests/test_mesh_interp.py. Unfortunately, there is no example showing this feature, just the tests.
Thank you and regards,