I need a little help creating a derived field which will return me the negative gradient of gravitational potential, hence the gravitational acceleration. I tried something like this:
@derived_field(name = "gradient_gravpot", units = " cm/s**2")
def _gradient (field, data):
G = add_gradient_fields(("gas"," gravitational_potental"))
return (- data["gravitational_potential_gradient_x"])
and I got this error
NameError: global name 'add_gradient_fields' is not defined
please suggest me the right method to define the field. thanks