distance_to_boundary Subroutine

public subroutine distance_to_boundary(equi, x, y, phi, dphi_max, arclength_fwd, arclength_bwd, target_reached_fwd, target_reached_bwd, maxstepsize, dphi_fwd, dphi_bwd)

Computes the distance to the target in each direction If the (x,y,phi) point is located outside of the vessel, the distances are defined negative

Arguments

Type IntentOptional Attributes Name
class(equilibrium_t), intent(inout), target :: equi

Equilibrium defining the field line

real(kind=FP), intent(in) :: x

Spatial coordinate x at which the field line is located

real(kind=FP), intent(in) :: y

Spatial coordinate y at which the field line is located

real(kind=FP), intent(in) :: phi

Spatial coordinate phi at which the field line is located

real(kind=FP), intent(in) :: dphi_max

Maximum toroidal angle to be traced

real(kind=FP), intent(out) :: arclength_fwd

For points that are inside vessel (based on equi%in_vessel): Arclength in the direction of B until the target is reached For points that are not inside vessel: Negative arclength in the direction of -B until target is reached

real(kind=FP), intent(out) :: arclength_bwd

For points that are inside vessel (based on equi%in_vessel): Arclength in the direction of -B until the target is reached For points that are not inside vessel: Negative arclength in the direction of B until target is reached

logical, intent(inout) :: target_reached_fwd

True, if the target is reached during the forward (as defined above) tracing

logical, intent(inout) :: target_reached_bwd

True, if the target is reached during the backward (as defined above) tracing

real(kind=FP), intent(in) :: maxstepsize

Maximum stepsize for the DOP853 integrator

real(kind=FP), intent(out), optional :: dphi_fwd

Toroidal angle traced in direction of B until target is reached It follows the same sign convention as arclength_fwd

real(kind=FP), intent(out), optional :: dphi_bwd

Toroidal angle traced in direction of -B until target is reached It follows the same sign convention as arclength_bwd


Calls

proc~~distance_to_boundary~~CallsGraph proc~distance_to_boundary distance_to_boundary in_vessel in_vessel proc~distance_to_boundary->in_vessel proc~handle_error handle_error proc~distance_to_boundary->proc~handle_error proc~trace trace proc~distance_to_boundary->proc~trace none~handle_error error_handler_t%handle_error proc~handle_error->none~handle_error proc~trace->proc~handle_error destroy destroy proc~trace->destroy initialize initialize proc~trace->initialize integrate integrate proc~trace->integrate proc~get_stderr get_stderr proc~trace->proc~get_stderr

Called by

proc~~distance_to_boundary~~CalledByGraph proc~distance_to_boundary distance_to_boundary proc~connection_length connection_length proc~connection_length->proc~distance_to_boundary proc~init immersed_trace_t%init proc~init->proc~distance_to_boundary proc~shortest_dist_to_bound shortest_dist_to_bound proc~shortest_dist_to_bound->proc~distance_to_boundary