def CastNode(nb): feaNB = fea.CastToChNodeFEAbase(nb) nodeFead = fea.CastToChNodeFEAxyzD(feaNB) return nodeFead
node = fea.ChNodeFEAxyzD(chrono.ChVectorD(loc_x, loc_y, loc_z), chrono.ChVectorD(dir_x, dir_y, dir_z)) node.SetMass(0) # Fix all nodes along the axis X=0 if (i % (numDiv_x + 1) == 0): node.SetFixed(True) # Add node to mesh my_mesh.AddNode(node) # Get a handle to the tip node. tempnode = my_mesh.GetNode(TotalNumNodes - 1) tempfeanode = fea.CastToChNodeFEAbase(tempnode) nodetip = fea.CastToChNodeFEAxyzD(tempfeanode) # Create an orthotropic material. # All layers for all elements share the same material. rho = 500 E = chrono.ChVectorD(2.1e7, 2.1e7, 2.1e7) nu = chrono.ChVectorD(0.3, 0.3, 0.3) G = chrono.ChVectorD(8.0769231e6, 8.0769231e6, 8.0769231e6) mat = fea.ChMaterialShellANCF(rho, E, nu, G) # Create the elements for i in range(TotalNumElements): # Adjacent nodes node0 = (i // numDiv_x) * N_x + i % numDiv_x node1 = (i // numDiv_x) * N_x + i % numDiv_x + 1 node2 = (i // numDiv_x) * N_x + i % numDiv_x + 1 + N_x node3 = (i // numDiv_x) * N_x + i % numDiv_x + N_x