Stress output in Fenics Mechanics

Hi,

I am using fenics meshanics. I just want to know how to output stress and deformation gradient in the .vtu file? Currently, this line:

solver = fm.SolidMechanicsSolver(problem, fname_disp="./UnitDomain/displacement.pvd")

gives the nodal displacements in the output. Is there any similar way to output deformation gradient and stress?

My code is given below.

Regards
Swati

======================================================

import sys
sys.path.append("…/fenicsmechanics-master") # important command

import fenicsmechanics as fm

material = {
‘type’: ‘elastic’,
‘const_eqn’: ‘neo_hookean’,
‘density’: 0.0,
‘incompressible’: True,
‘kappa’: 10e9, # Pa
‘mu’: 1.5e6 # Pa
}

mesh_file, boundaries = fm.get_mesh_file_names(“unit_domain”, ret_facets=True,
refinements=[20,20])
mesh = {
‘mesh_file’: mesh_file,
‘boundaries’: boundaries
}

formulation = {
‘time’: {
‘dt’: 0.1,
‘interval’: [0., 1.]
},
‘element’: ‘p2-p1’,
‘domain’: ‘lagrangian’,
‘bcs’: {
‘dirichlet’: {
‘displacement’: [[0.0, 0.0]],
‘regions’: [1]
},
‘neumann’: {
‘values’: [[‘10.0*t’, ‘0.0’]],
‘regions’: [2],
‘types’: [‘piola’]
}
}
}

config = {
‘material’: material,
‘mesh’: mesh,
‘formulation’: formulation
}

problem = fm.SolidMechanicsProblem(config)

solver = fm.SolidMechanicsSolver(problem, fname_disp="./UnitDomain/displacement.pvd")
solver.set_parameters(linear_solver=“mumps”)
solver.full_solve()

print(“Done”)

Hi Swati:

I have the same questions as you. Have you had a solution for that?