Produces a Jacobian block which has been offset by a scalar field.
This operation will overwrite any previous sums which
have been performed to produce this
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(jacobian_block), | intent(in) | :: | this | |||
class(scalar_field), | intent(in) | :: | rhs | A scalar which should be added to this block |
function jacobian_block_add_field(this, rhs) result(sum)
!* Author: Chris MacMackin
! Date: May 2017
!
! Produces a Jacobian block which has been offset by a scalar
! field.
!
! @Warning This operation will overwrite any previous sums which
! have been performed to produce `this`.
!
class(jacobian_block), intent(in) :: this
class(scalar_field), intent(in) :: rhs
!! A scalar which should be added to this block
type(jacobian_block) :: sum
sum = this
allocate(sum%field_increment, mold=rhs)
sum%field_increment = rhs
sum%has_increment = sum%has_increment + 2
#ifdef DEBUG
call logger%debug('jacobian_block%add','Added field to a Jacobian block.')
#endif
end function jacobian_block_add_field