# 4.7. Transfer

Transfer allows you to send fields from one region to another. There are two kinds of transfer - copy and interpolate. Copy transfer requires identical meshes (same node/element locations and same global IDs), while interpolation interpolates fields on dissimilar meshes. The benefit of the copy transfer is that a search is not required to transfer the information. With interpolation on the other hand, the sender and receiver need not be of same topology but the source and target destinations should overlap geometrically so that a search can be performed to find entities to interpolate.

The specification of this choice is as follows

    Begin Transfer Transfer_name
      [TRANSFER_TYPE] [PART_TYPE] [TOPOLOGY] From [SRC_REGION] To [DST_REGION]
      ...
    End

Here `SRC_REGION`/`DST_REGION` are the participating regions, `TRANSFER_TYPE` can be `COPY` or `INTERPOLATE`, `PART_TYPE` can be `SURFACE` or `VOLUME`, and `TOPOLOGY` can be `CONSTRAINTS`, `ELEMENTS`, or `NODES`. The remainder of this section discusses the major components that must be present in a Transfer block. See the command reference for a detailed list of all possible options.

## 4.7.1. Field

First, one must specify which quantities are to be transferred across regions. Each field transfer will have the general form

    Send Field [SRC_FIELD] State [SRC_STATE] To [DST_FIELD] State [DST_STATE]

The `SRC_FIELD`/`DST_FIELD` can be any Fuego field. See the command reference for more details on specifying a send field.

The `SRC_STATE`/`DST_STATE` refer to the state of the field (or `NONE` if the field is not stated).

## 4.7.2. Location

The source and destination parts dictate what portion of the domain is transferred. These parts be specified using the Send Blocks line command.

Note that for copy transfer, each part must be specified in unique send block lines

    # Scope: Sierra > Procedure
    Begin Transfer foo
      Send Block block_1 to block_1
      Send Block block_2 to block_2
      ...
    End

For interpolation transfer on the other hand, they must be specified in one line

    # Scope: Sierra > Procedure
    Begin Transfer foo
      Send Block block_1 block_2 to block_3 block_4
      ...
    End

Note that in either case, assemblies can be used to simplify the definitions. Alternatively, the transfer send and receive blocks can be specified in block form using Send Blocks and Receive Blocks respectively. This form is useful when one wishes to send or receive all blocks in the mesh, since it allows the use of the `Include All Blocks` alias instead of having to list them manually.

    # Scope: Sierra > Procedure
    Begin Transfer foo
      Begin Send Blocks
        Include All Blocks
      End
      Begin Receive Blocks
        Include Block = block_3 block_4
      End
      ...
    End

Note that if these lines are omitted, the transfer is performed over the entire domain.

### 4.7.2.1. Search Tolerance

In cases of interpolation, a search over the two meshes must be performed to communicate values. By default, the tolerance used in this search is a function of the geometric problem size. For cases in which the source and destination do not overlap, one should specify tolerancing in order to guarantee that values will be mapped to the destination. If the the separation between source and destination varies, then one should specify a Geometric Tolerance consistent with the largest separation distance.

### 4.7.2.2. Extrapolation Handling

When source and destination entities partially overlap, then by default source values will be extrapolated to the destination. This behavior can be explicitly controlled with the Nodes Outside Region command. The most common options for the command are described below:

`EXTRAPOLATE`

  This is the default behavior. The sending field is extrapolated beyond the bounds of the sending mesh. This can lead to extrapolation error, such as when a large gradient at the surface causes a negative values when only positive values are acceptable. If this happens, upper and lower bounds can be set per field within the `SEND FIELD` command.

      Send Field field1 State none To field2 State none Lower Bound 0.0 Upper Bound 1.0

`TRUNCATE`

  The receiving coordinate is projected back to the surface of the sending mesh to determine a value. This ensures that the receiving value is not outside of the field values in the sending mesh.

`ABORT`

  If any receiving point is outside the sending mesh by more than the geometric tolerance, abort the simulation. Do not attempt to project, extrapolate, or otherwise handle the point. This can be useful for detecting problem setup errors that otherwise may have been silently extrapolated.

`IGNORE`

  The receiving mesh object can be ignored and will receive no value. This is usually not recommended as it can cause mesh objects just outside to have a zero value when the nodes just inside the mesh might have very large values.

## 4.7.3. Skeleton Examples

Since several different uses of transfer can arise, some examples are included below.

Note

While this example shows only steady problems, the same basic setup of transfer would apply to transient problems as well.

A skeleton outline of one-way transfer between two regions

    # Scope: Sierra > Procedure
    Begin Solution Control Description
      Use System Main
      Begin System Main
        Begin Sequential MySolveBlock
          Advance first_Region
          transfer my_transfer
          Advance second_Region
        End
      End
      ...
    End

    Begin Fuego Region first_region
      Use Finite Element Model fem_model_A

      ...
    End

    Begin Fuego Region second_region
      Use Finite Element Model fem_model_B

      ...
    End

    Begin Transfer my_transfer
      interpolate volume nodes from first_region to second_region
      send block block_1 to block_1
      send field Afield state new to Bfield state new
    End

A skeleton outline of two-way transfer between two regions:

    # Scope: Sierra > Procedure
    Begin Solution Control Description
      Use System Main
      Begin System Main
        Begin Sequential MySolveBlock
          Advance RegionA
          Transfer AtoB
          Advance RegionB
          Transfer BtoA
        End
      End
      ...
    End

    Begin Fuego Region RegionA
      Use Finite Element Model same_model

      ...
    End

    Begin Aria Region RegionB
      Use Finite Element Model same_model

      ...
    End

    Begin Transfer AtoB
      copy volume nodes from first_region to second_region
      send block block_1 to block_1
      send field Afield state new to Bfield state new
    End

    Begin Transfer BtoA
      copy volume nodes from second_region to first_region
      send block block_2 to block_2
      send field Bsendfield state new to Arecvfield state new
    End

Transfer is not exclusive to Fuego regions. For example, an IO Region can be used to distribute data from external mesh databases.