jacobian_block_add_block Function

private function jacobian_block_add_block(this, rhs) result(sum)

Produces a Jacobian block which is the sum of two existing blocks. Boundary conditions are set by the first operand (this).

Arguments

Type IntentOptional AttributesName
class(jacobian_block), intent(in) :: this
class(jacobian_block), intent(in), target:: rhs

A second block which should be added to this block

Return Value type(jacobian_block)


Contents


Source Code

  function jacobian_block_add_block(this, rhs) result(sum)
    !* Author: Chris MacMackin 
    !  Date: May 2017
    !
    ! Produces a Jacobian block which is the sum of two existing
    ! blocks. Boundary conditions are set by the first operand
    ! (`this`).
    !
    class(jacobian_block), intent(in)         :: this
    class(jacobian_block), target, intent(in) :: rhs
      !! A second block which should be added to this block
    type(jacobian_block)                      :: sum
    sum = this
    sum%block_increment => rhs
#ifdef DEBUG
    call logger%debug('jacobian_block%add','Added field to a Jacobian block.')
#endif
  end function jacobian_block_add_block