jacobian_block_bounds Subroutine

private subroutine jacobian_block_bounds(contents, derivative, rhs, boundary_locs, boundary_types, boundary_values)

A default implementation of the get_boundaries procedure pointer for the jacobian_block type. It corresponds to setting all boundaries to 0 when multiplying a field by the Jacobian block.

Arguments

Type IntentOptional AttributesName
class(scalar_field), intent(in) :: contents

The field used to construct the Jacobian block

class(scalar_field), intent(in) :: derivative

The first spatial derivative of the field used to construct the Jacobian block, in the direction specified

class(scalar_field), intent(in) :: rhs

The scalar field representing the vector being multiplied by Jacobian

integer, intent(in), dimension(:), allocatable:: boundary_locs

The locations in the raw representation of rhs containing the boundaries.

integer, intent(in), dimension(:), allocatable:: boundary_types

Integers specifying the type of boundary condition. The type of boundary condition corresponding to a given integer is specified in boundary_types_mod. Only Dirichlet and Neumann conditions are supported. The storage order must correspond to that of boundary_locs.

real(kind=r8), intent(out), dimension(:), allocatable:: boundary_values

The values to go at the boundaries when multiplying a field by the Jacobian block. The storage order must be the same as for boundary_locs.


Contents

Source Code


Source Code

  subroutine jacobian_block_bounds(contents, derivative, rhs,   &
                                 boundary_locs, boundary_types, &
                                 boundary_values)
    !* Author: Chris MacMackin
    !  Date: January 2016
    !
    ! A default implementation of the `get_boundaries` procedure
    ! pointer for the `jacobian_block` type. It corresponds to setting
    ! all boundaries to 0 when multiplying a field by the Jacobian
    ! block.
    !
    class(scalar_field), intent(in)                 :: contents
      !! The field used to construct the Jacobian block
    class(scalar_field), intent(in)                 :: derivative
      !! The first spatial derivative of the field used to construct
      !! the Jacobian block, in the direction specified
    class(scalar_field), intent(in)                 :: rhs
      !! The scalar field representing the vector being multiplied
      !! by Jacobian
    integer, dimension(:), allocatable, intent(in)  :: boundary_locs
      !! The locations in the raw representation of `rhs` containing
      !! the boundaries.
    integer, dimension(:), allocatable, intent(in)  :: boundary_types
      !! Integers specifying the type of boundary condition. The type
      !! of boundary condition corresponding to a given integer is
      !! specified in [[boundary_types_mod]]. Only Dirichlet and
      !! Neumann conditions are supported. The storage order must
      !! correspond to that of `boundary_locs`.
    real(r8), dimension(:), allocatable, intent(out) :: boundary_values
      !! The values to go at the boundaries when multiplying a field
      !! by the Jacobian block. The storage order must be the same as
      !! for `boundary_locs`.
    allocate(boundary_values(size(boundary_locs)))
    boundary_values = 0._r8
  end subroutine jacobian_block_bounds