System matrices filled with nan values

23 views
Skip to first unread message

Emin Torabi

unread,
Nov 30, 2021, 9:12:24 AM11/30/21
to ProjectChrono
Dear all,

I am trying to build a model and then use the system matrices in a postprocessing step. But The system matrices are filled with nan values, even when I use the simplest model possible (4 nodes, 1 element). The code is added here. Do you see the problem with this simple model?

Many thanks,
Emin

# import libraries
import pychrono as chrono
import pychrono.fea as fea
import pychrono.irrlicht as chronoirr

my_system = chrono.ChSystemSMC()
my_mesh = fea.ChMesh()

my_nodes = []
my_nodes.append(fea.ChNodeFEAxyz(chrono.ChVectorD(0,0,0)))
my_nodes.append(fea.ChNodeFEAxyz(chrono.ChVectorD(1,0,0)))
my_nodes.append(fea.ChNodeFEAxyz(chrono.ChVectorD(0,1,0)))
my_nodes.append(fea.ChNodeFEAxyz(chrono.ChVectorD(0,0,1)))

for node in my_nodes:
    my_mesh.AddNode(node)
    
# create material and elements. add elements to mesh
E_steel  = 210e9
nu_steel = 0.265
ro_steel = 7750

my_material = fea.ChContinuumElastic(E_steel, nu_steel)
my_material.Set_density(ro_steel)

my_element = fea.ChElementTetra_4()
my_element.SetMaterial(my_material)
my_element.SetNodes(my_nodes[0],
                    my_nodes[1],
                    my_nodes[2],
                    my_nodes[3])

my_mesh.AddElement(my_element)
my_mesh.SetAutomaticGravity(False)
my_system.Add(my_mesh)

# add a ground body and fix a node
Isys = chrono.ChBody()
Isys.SetBodyFixed(True)
my_system.Add(Isys)

Fix_const_container = []
Fix_const_container.append(fea.ChLinkPointFrame())
Fix_const_container[-1].Initialize(my_nodes[0], Isys)
my_system.Add(Fix_const_container[-1])

file_title = 'test'
my_system.DoFullAssembly() 
my_system.DumpSystemMatrices(True, True, True, True, file_title)

Alessandro Tasora

unread,
Nov 30, 2021, 9:27:06 AM11/30/21
to projec...@googlegroups.com

dear Emin,

probably the DoAssembly() could have destroyed the system - please do a 3d visualization and a time stepping simulation to understand if your system is effectively a structure that can stay in place.

Do you have the same issue if you just do  my_system.Update()  instead of my_system.DoAssembly() ?

A.


This email and any attachments thereto may contain private, confidential, and privileged material for the sole use of the intended recipient. Any review, copying, or distribution of this email (or any attachments thereto) by others is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently delete the original and any copies of this email and any attachments thereto.
--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/c961fb4a-ea81-456e-996d-24ab43f81fd1n%40googlegroups.com.

Emin Torabi

unread,
Nov 30, 2021, 9:48:08 AM11/30/21
to ProjectChrono
dear Alessandro,

Thanks a lot for the reply. I simulated 1 timestep and then called the DumpSystemMatrices. Now it is fine, I get the system matrice that I expect. So the problem was DoFullAssembly(). Interestingly,  DoFullAssembly() worked well with systems that contained beams only.

Best regards,
Emin
Reply all
Reply to author
Forward
0 new messages