get coordinates in constitutive model

10 views
Skip to first unread message

Osama Mahmoud

unread,
Nov 28, 2020, 11:36:05 AM11/28/20
to mastodo...@googlegroups.com
Hello all,

I am implementing a material class in MASTODON to compute the stress for the Equation of State. The class inherits from ComputeStressBase. I want to get the global (x,y,z) coordinates of the point, where I am calculating the stress. 

What function can I use to get these coordinates?

Thanks,
Osama Abdelaleim  

Christopher Wong

unread,
Nov 29, 2020, 7:49:10 PM11/29/20
to mastodon-users
In one of the "qp" functions in your material class, you'll be looping over the quadrature points that you index with the `_qp` variable. The coordinates are stored on the `_q_point` array from the base class, so you'll be able to access the (x, y, z) vector with `_q_point[_qp]`. Finally, to access the individual vector components, you use parenthesis, e.g., `(_q_point[_qp])(0)` gives you x and `(_q_point[_qp])(1)` gives you y.
Reply all
Reply to author
Forward
0 new messages