- source_functorsFunctors providing the values to transfer to the target variables. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:std::vector<MooseFunctorName>
Unit:(no unit assumed)
Controllable:No
Description:Functors providing the values to transfer to the target variables. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- variableThe auxiliary variable to store the transferred values in.
C++ Type:std::vector<AuxVariableName>
Unit:(no unit assumed)
Controllable:No
Description:The auxiliary variable to store the transferred values in.
MultiAppGeneralFieldFunctorTransfer
Transfers functor data at the MultiApp position by evaluating the functor inside its domain of definition and extrapolating with a user-selected behavior outside
This transfer can use any Functor to compute the values to transfer. This provides great flexibility in how to compute source values, but also creates difficults, notably because both the interpolation and extrapolation behavior of a functor depend on its particular implementation.
Interpolation behavior
When a target point (see MultiAppGeneralFieldTransfer for how target points for transfers are chosen) is located inside a source application domain by the point locator associated with the source mesh, the source functor is evaluated.
If the point locator only found a single element, the functor is evaluated with an ElemPointArg (see Functor documentation for definition) with that element and the target point in the source application frame of reference. If multiple elements are found, the functor is evaluated with each element, and a arithmetic average of all evaluations is returned.
If multiple source child applications are overlapping for the same target point, then a source value conflict should be detected and a warning is output.
Extrapolation behavior options
The following options are available when the target point is outside the source application's mesh or outside the source functor's subdomain restriction of the mesh:
"extrapolation_behavior"
= flatwill return the "extrapolation_constant" specified by the user (defaults to -1)."extrapolation_behavior"
= nearest-nodewill return the functor value at the nearest node on the boundary of the functor's domain of definition. If the functor is not defined at nodes, this will likely cause an error when pre-computing these values."extrapolation_behavior"
= nearest-elemwill return the functor value at the nearest element on the boundary of the functor's domain of definition. If the functor is not defined at elements (rare), this will likely cause an error when pre-computing these values."extrapolation_behavior"
= evaluate_oobwill evaluate the functor with anullelement and the target point in the source application frame of reference. Some functors, such as spatial user objects or functions, can often be evaluate out of bounds (oob). Others, like variables, will error on such evaluation.
Source and target spatial restrictions
All the spatial restrictions implemented in MultiAppGeneralFieldTransfer are available to this class. The block restriction of the source functors are respected in that the functors are never evaluated outside their block restriction, unless "extrapolation_behavior" is set to evaluate_oob.
Caveats and known numerical issues
The items below are known difficulties shared with the MultiAppGeneralFieldNearestLocationTransfer. The MultiAppGeneralFieldFunctorTransfer.md is not affected by these issues when interpolating values (where the source and target domains overlap) because it does not use a nearest-location there, it simply evaluates the functors. However, when extrapolating, it uses the same algorithm as MultiAppGeneralFieldNearestLocationTransfer and thus is subject to the same caveats.
Nearest-location algorithms are vulnerable to finite precision round-offs if multiple sources are exactly at the same distance from a given target. This can affect repeatability of results. Use the "search_value_conflicts" parameter to uncover these issues.
The "num_nearest_points" allows for a simple geometric mixing of extrapolation values of several nearest nodes/elements to the target points. This mixing is performed in every origin problem independently, values from different child applications (or from different processes within each application) will not be mixed together.
If "num_nearest_points" is more than 1, the results will differ in parallel if the target locations are near the parallel process boundaries on the origin app mesh. Use the "output_process_domains" parameter to examine process boundaries on Exodus/Nemesis output.
Example Input File Syntax
In this example, a MultiAppGeneralFieldFunctorTransfer is used to transfervalues from a spatial user object to_sub from block '1' in the main app to block '1' in the child app sub, filling the variable from_main.
[UserObjects<<<{"href": "../../syntax/UserObjects/index.html"}>>>]
[to_sub]
type = LayeredAverage<<<{"description": "Computes averages of variables over layers", "href": "../userobjects/LayeredAverage.html"}>>>
direction<<<{"description": "The direction of the layers."}>>> = x
num_layers<<<{"description": "The number of layers."}>>> = 10
variable<<<{"description": "The name of the variable that this object operates on"}>>> = to_sub_var
[]
[to_sub_elem]
type = LayeredAverage<<<{"description": "Computes averages of variables over layers", "href": "../userobjects/LayeredAverage.html"}>>>
direction<<<{"description": "The direction of the layers."}>>> = x
num_layers<<<{"description": "The number of layers."}>>> = 10
variable<<<{"description": "The name of the variable that this object operates on"}>>> = to_sub_var_elem
[]
[]
[Transfers<<<{"href": "../../syntax/Transfers/index.html"}>>>]
[to_sub]
type = MultiAppGeneralFieldFunctorTransfer<<<{"description": "Transfers functor data at the MultiApp position by evaluating the functor inside its domain of definition and extrapolating with a user-selected behavior outside", "href": "MultiAppGeneralFieldFunctorTransfer.html"}>>>
to_multi_app<<<{"description": "The name of the MultiApp to transfer the data to"}>>> = sub
source_functors<<<{"description": "Functors providing the values to transfer to the target variables. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = to_sub
variable<<<{"description": "The auxiliary variable to store the transferred values in."}>>> = from_main
from_blocks<<<{"description": "Subdomain restriction to transfer from (defaults to all the origin app domain)"}>>> = 1
to_blocks<<<{"description": "Subdomain restriction to transfer to, (defaults to all the target app domain)"}>>> = 1
extrapolation_behavior<<<{"description": "How to extrapolate the functors when a target point for the transfer is outside the domain of evaluation"}>>> = 'flat'
extrapolation_constant<<<{"description": "Constant to use when no source app can provide a valid value for a target location."}>>> = -1
# Test features non-overlapping meshes
error_on_miss<<<{"description": "Whether or not to error in the case that a target point is not found in the source domain."}>>> = false
[]
[](test/tests/transfers/general_field/functor/user_object/subdomain/main.i)Input Parameters
- check_multiapp_execute_onTrueWhen false the check between the multiapp and transfer execute on flags is not performed.
Default:True
C++ Type:bool
Controllable:No
Description:When false the check between the multiapp and transfer execute on flags is not performed.
- displaced_source_meshFalseWhether or not to use the displaced mesh for the source mesh.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to use the displaced mesh for the source mesh.
- displaced_target_meshFalseWhether or not to use the displaced mesh for the target mesh.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to use the displaced mesh for the target mesh.
- execute_onSAME_AS_MULTIAPPThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
Default:SAME_AS_MULTIAPP
C++ Type:ExecFlagEnum
Controllable:No
Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.
- extrapolation_behaviornearest-nodeHow to extrapolate the functors when a target point for the transfer is outside the domain of evaluation
Default:nearest-node
C++ Type:MooseEnum
Controllable:No
Description:How to extrapolate the functors when a target point for the transfer is outside the domain of evaluation
- from_multi_appThe name of the MultiApp to receive data from
C++ Type:MultiAppName
Controllable:No
Description:The name of the MultiApp to receive data from
- group_subappsFalseWhether to group source locations and values from all subapps when working with a nearest-position or source mesh-division
Default:False
C++ Type:bool
Controllable:No
Description:Whether to group source locations and values from all subapps when working with a nearest-position or source mesh-division
- num_nearest_points1Number of nearest source (from) points will be chosen to construct a value for the target point. All points will be selected from the same origin mesh!
Default:1
C++ Type:unsigned int
Controllable:No
Description:Number of nearest source (from) points will be chosen to construct a value for the target point. All points will be selected from the same origin mesh!
- post_transfer_extrapolationnonePost treatment to apply to the field after the transfer
Default:none
C++ Type:MooseEnum
Controllable:No
Description:Post treatment to apply to the field after the transfer
- target_variable_componentsThe target array or vector variable component(s).
C++ Type:std::vector<unsigned int>
Controllable:No
Description:The target array or vector variable component(s).
- to_multi_appThe name of the MultiApp to transfer the data to
C++ Type:MultiAppName
Controllable:No
Description:The name of the MultiApp to transfer the data to
- value_conflicts_output10Maximum number of conflicts to output if value-conflicts, from equidistant sources to a given transfer target location, search is turned on
Default:10
C++ Type:unsigned int
Controllable:No
Description:Maximum number of conflicts to output if value-conflicts, from equidistant sources to a given transfer target location, search is turned on
Optional Parameters
- _called_legacy_paramsTrue
Default:True
C++ Type:bool
Controllable:No
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- skip_coordinate_collapsingTrueWhether to skip coordinate collapsing (translation and rotation are still performed, only XYZ, RZ etc collapsing is skipped) when performing mapping and inverse mapping coordinate transformation operations. This parameter should only be set by users who really know what they're doing.
Default:True
C++ Type:bool
Controllable:No
Description:Whether to skip coordinate collapsing (translation and rotation are still performed, only XYZ, RZ etc collapsing is skipped) when performing mapping and inverse mapping coordinate transformation operations. This parameter should only be set by users who really know what they're doing.
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
- allow_skipped_adjustmentFalseIf set to true, the transfer skips adjustment when from or to postprocessor values are either zero or have different signs. If set to false, an error is thrown when encountering these conditions.
Default:False
C++ Type:bool
Controllable:No
Description:If set to true, the transfer skips adjustment when from or to postprocessor values are either zero or have different signs. If set to false, an error is thrown when encountering these conditions.
- from_postprocessors_to_be_preservedThe name of the Postprocessor in the from-app to evaluate an adjusting factor.
C++ Type:std::vector<PostprocessorName>
Unit:(no unit assumed)
Controllable:No
Description:The name of the Postprocessor in the from-app to evaluate an adjusting factor.
- to_postprocessors_to_be_preservedThe name of the Postprocessor in the to-app to evaluate an adjusting factor.
C++ Type:std::vector<PostprocessorName>
Unit:(no unit assumed)
Controllable:No
Description:The name of the Postprocessor in the to-app to evaluate an adjusting factor.
Conservative Transfer Parameters
- assume_nearest_app_holds_evaluation_locationFalseWhen True, transfers from a child application will work by finding the nearest (using the `position` + mesh centroid) sub-app and query that app for the value to transfer.
Default:False
C++ Type:bool
Controllable:No
Description:When True, transfers from a child application will work by finding the nearest (using the `position` + mesh centroid) sub-app and query that app for the value to transfer.
- greedy_searchFalseWhether or not to send a point to all the domains. If true, all the processors will be checked for a given point.The code will be slow if this flag is on but it will give a better solution.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to send a point to all the domains. If true, all the processors will be checked for a given point.The code will be slow if this flag is on but it will give a better solution.
- search_value_conflictsFalseWhether to look for potential conflicts between two valid and different source values for any target point
Default:False
C++ Type:bool
Controllable:No
Description:Whether to look for potential conflicts between two valid and different source values for any target point
- use_bounding_boxesTrueWhen set to false, bounding boxes will not be used to restrict the source of the transfer. Either source applications must be set using the from_mesh_division parameter, or a greedy search must be used.
Default:True
C++ Type:bool
Controllable:No
Description:When set to false, bounding boxes will not be used to restrict the source of the transfer. Either source applications must be set using the from_mesh_division parameter, or a greedy search must be used.
- use_nearest_positionName of the the Positions object (in main app) such that transfers to/from a child application will work by finding the nearest position to a target and query only the app / points closer to this position than to any other position for the value to transfer.
C++ Type:PositionsName
Controllable:No
Description:Name of the the Positions object (in main app) such that transfers to/from a child application will work by finding the nearest position to a target and query only the app / points closer to this position than to any other position for the value to transfer.
Search Algorithm Parameters
- bbox_factor1Factor to inflate or deflate the source app bounding boxes
Default:1
C++ Type:double
Unit:(no unit assumed)
Range:bbox_factor>0
Controllable:No
Description:Factor to inflate or deflate the source app bounding boxes
- fixed_bounding_box_sizeOverride source app bounding box size(s) for searches. App bounding boxes will still be centered on the same coordinates. Only non-zero components passed will override.
C++ Type:std::vector<double>
Unit:(no unit assumed)
Range:fixed_bounding_box_size >= 0
Controllable:No
Description:Override source app bounding box size(s) for searches. App bounding boxes will still be centered on the same coordinates. Only non-zero components passed will override.
Source App Bounding Box Parameters
- elemental_boundary_restrictionsidesWhether elemental variable boundary restriction is considered by element side or element nodes
Default:sides
C++ Type:MooseEnum
Controllable:No
Description:Whether elemental variable boundary restriction is considered by element side or element nodes
- from_blocksSubdomain restriction to transfer from (defaults to all the origin app domain)
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:Subdomain restriction to transfer from (defaults to all the origin app domain)
- from_boundariesThe boundary we are transferring from (if not specified, whole domain is used).
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The boundary we are transferring from (if not specified, whole domain is used).
- from_mesh_divisionMesh division object on the origin application
C++ Type:MeshDivisionName
Controllable:No
Description:Mesh division object on the origin application
- from_mesh_division_usagenoneHow to use the source mesh division in the transfer. See object documentation for description of each option
Default:none
C++ Type:MooseEnum
Controllable:No
Description:How to use the source mesh division in the transfer. See object documentation for description of each option
- to_blocksSubdomain restriction to transfer to, (defaults to all the target app domain)
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:Subdomain restriction to transfer to, (defaults to all the target app domain)
- to_boundariesThe boundary we are transferring to (if not specified, whole domain is used).
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The boundary we are transferring to (if not specified, whole domain is used).
- to_mesh_divisionMesh division object on the target application
C++ Type:MeshDivisionName
Controllable:No
Description:Mesh division object on the target application
- to_mesh_division_usagenoneHow to use the target mesh division in the transfer. See object documentation for description of each option
Default:none
C++ Type:MooseEnum
Controllable:No
Description:How to use the target mesh division in the transfer. See object documentation for description of each option
Transfer Spatial Restriction Parameters
- error_on_missTrueWhether or not to error in the case that a target point is not found in the source domain.
Default:True
C++ Type:bool
Controllable:No
Description:Whether or not to error in the case that a target point is not found in the source domain.
- extrapolation_constant0Constant to use when no source app can provide a valid value for a target location.
Default:0
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Constant to use when no source app can provide a valid value for a target location.
- from_app_must_contain_pointFalseWether on not the origin mesh must contain the point to evaluate data at. If false, this allows for interpolation between origin app meshes. Origin app bounding boxes are still considered so you may want to increase them with 'fixed_bounding_box_size'
Default:False
C++ Type:bool
Controllable:No
Description:Wether on not the origin mesh must contain the point to evaluate data at. If false, this allows for interpolation between origin app meshes. Origin app bounding boxes are still considered so you may want to increase them with 'fixed_bounding_box_size'
Extrapolation Behavior Parameters
Input Files
- (test/tests/transfers/general_field/functor/user_object/boundary/main.i)
- (test/tests/transfers/general_field/functor/siblings/main_between_multiapp_functor.i)
- (test/tests/transfers/general_field/functor/mesh_division/main_match_subapps_functor.i)
- (test/tests/transfers/general_field/functor/user_object/subdomain/main.i)
- (test/tests/transfers/general_field/functor/user_object/regular/main.i)
- (test/tests/transfers/general_field/functor/nearest_location/between_siblings/main_between_multiapp.i)