PropertyReadFile

User Object to read property data from an external file and assign it to elements / nodes / subdomains etc.

This user object may load data sorted in four different ways. The read modes are toggled using the "read_type" parameter.

  • In element mode, the file read contains "nprop" values for each element in the mesh.

  • In grain/voronoi mode, a Voronoi tessellation with "nvoronoi" random centers is either created randomly or read from the first three columns of the CSV file, depending on the "use_random_voronoi" parameter. The file read should still contain "nprop" columns, even though the three first columns may be used for the Voronoi tessellation positions.

  • In block mode, the file read contains "nprop" values for each block in the mesh. "nblock" is the number of blocks in the mesh.

  • In node mode, the file read contains "nprop" values for each node in the mesh.

warningwarning:Data ordering

For the element (block and node respectively) modes, both the elements (blocks and nodes respectively) in the mesh and the data in the CSV file must be ordered consecutively. The element (block and node respectively) IDs must be contiguous and usually start from 1.

The "use_zero_based_block_indexing" parameter indicates whether the block numbers start with zero (true) or one (false).

Object use

Values can be queried from the object by passing in a property ID and an element pointer. In element mode a direct lookup from the data table based on element ID is performed. In grain mode the centroid of the passed in element is taken and the grain ID is determined as the ID of the Voronoi center closest to the element centroid.

An example of a MOOSE object using the PropertyReadFile is the PiecewiseConstantFromCSV function.

If specifying multiple files to the "prop_file_name" parameter, a new file will be read every time the object is initialized, which happens right before user objects are executed. The "execute_on" parameter should be used to control the frequency of these executions. The user object will always read the first file at construction time, and, as an exception, will not read a new file on its first execution. If all data files have been read, the last file specified is used.

commentnote

When using multiple files, please note the data from the files is not concatenated. Every time a new file is read, the old data is removed from consideration.

Example input syntax

In this example input file, the PropertyReadFile user object is used to load data from a CSV file then a PiecewiseConstantFromCSV function and a FunctionIC are used to populate a field with this data. This is done for each "read_type".

  • Data sorted by element

[UserObjects]
  [reader_element]
    type = PropertyReadFile
    prop_file_name = 'data_element.csv'
    read_type = 'element'
    nprop = 3 # number of columns in CSV
  []
[]
(moose/test/tests/functions/piecewise_constant_from_csv/piecewise_constant.i)
0,0,0.1
0,0,0.8
0,0,0.4
0,0,0.9
0,0,1
1,0,1.1
1,0,2.1
1,0,3.1
1,0,17.1
1,0,24
1,0,10
1,0,0.1
1,0,11
1,0,17
1,0,1.8
1,0,-1
(moose/test/tests/functions/piecewise_constant_from_csv/data_element.csv)
  • Data sorted by nearest-neighbor

[UserObjects]
  [reader_nearest]
    type = PropertyReadFile
    prop_file_name = 'data_nearest.csv'
    read_type = 'voronoi'
    nprop = 4 # number of columns in CSV
    nvoronoi = 3 # number of rows that are considered
  []
[]
(moose/test/tests/functions/piecewise_constant_from_csv/piecewise_constant.i)
1,0,1,0.1
0,0.8,1,4
2,3.1,1,7
(moose/test/tests/functions/piecewise_constant_from_csv/data_nearest.csv)
  • Data sorted by block

[UserObjects]
  [reader_block]
    type = PropertyReadFile
    prop_file_name = 'data_nearest.csv'
    read_type = 'block'
    nprop = 4 # number of columns in CSV
    nblock = 3 # number of rows that are considered
  []
[]
(moose/test/tests/functions/piecewise_constant_from_csv/piecewise_constant.i)
commentnote

In this example, the same CSV file as the nearest neighbor case is used. It is however processed and used differently.

  • Data sorted by node

[UserObjects]
  [reader_node]
    type = PropertyReadFile
    prop_file_name = 'data_node.csv'
    read_type = 'node'
    nprop = 3 # number of columns in CSV
  []
[]
(moose/test/tests/functions/piecewise_constant_from_csv/piecewise_constant.i)
0,0,0.1
0,0,0.8
0,0,0.4
0,0,0.9
0,0,1
1,0,1.1
1,0,2.1
1,0,3.1
1,0,17.1
1,0,24
1,0,10
1,0,0.1
1,0,11
1,0,17
1,0,1.8
1,0,-1
1,0,17.1
1,0,24
1,0,10
1,0,0.1
1,0,11
1,0,17
1,0,1.8
1,0,-1
1,0,-3
(moose/test/tests/functions/piecewise_constant_from_csv/data_node.csv)

Input Parameters

  • npropNumber of tabulated property values

    C++ Type:unsigned int

    Controllable:No

    Description:Number of tabulated property values

  • prop_file_nameName(s) of the property file name. If specifying multiple files, the next file will be read at initialization right before every execution

    C++ Type:std::vector<FileName>

    Controllable:No

    Description:Name(s) of the property file name. If specifying multiple files, the next file will be read at initialization right before every execution

  • read_typeType of property distribution: element:by element node: by node voronoi:nearest neighbor / voronoi grain structure block:by mesh block grain: deprecated, use voronoi

    C++ Type:MooseEnum

    Options:element, voronoi, block, node, grain

    Controllable:No

    Description:Type of property distribution: element:by element node: by node voronoi:nearest neighbor / voronoi grain structure block:by mesh block grain: deprecated, use voronoi

Required Parameters

  • execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include NONE, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, CUSTOM.

    Default:TIMESTEP_END

    C++ Type:ExecFlagEnum

    Options:NONE, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, CUSTOM

    Controllable:No

    Description:The list of flag(s) indicating when this object should be executed, the available options include NONE, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, CUSTOM.

  • load_first_file_on_constructionTrueWhether to read the first CSV file on construction or on the first execution

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Whether to read the first CSV file on construction or on the first execution

  • nblock0Number of blocks

    Default:0

    C++ Type:unsigned int

    Controllable:No

    Description:Number of blocks

  • nvoronoi0Number of voronoi tesselations/grains/nearest neighbor regions

    Default:0

    C++ Type:unsigned int

    Controllable:No

    Description:Number of voronoi tesselations/grains/nearest neighbor regions

  • prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

    C++ Type:MaterialPropertyName

    Controllable:No

    Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

  • rand_seed2000random seed

    Default:2000

    C++ Type:unsigned int

    Controllable:No

    Description:random seed

  • rve_typenonePeriodic or non-periodic grain distribution: Default is non-periodic

    Default:none

    C++ Type:MooseEnum

    Options:periodic, none

    Controllable:No

    Description:Periodic or non-periodic grain distribution: Default is non-periodic

  • use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

  • use_random_voronoiFalseWether to generate random positions for the Voronoi tesselation

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Wether to generate random positions for the Voronoi tesselation

  • use_zero_based_block_indexingTrueAre the blocks numbered starting at zero?

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Are the blocks numbered starting at zero?

Optional Parameters

  • allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

    Default:False

    C++ Type:bool

    Controllable:No

    Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

  • 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.

  • execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

    Default:0

    C++ Type:int

    Controllable:No

    Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

  • force_postauxFalseForces the UserObject to be executed in POSTAUX

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Forces the UserObject to be executed in POSTAUX

  • force_preauxTrueForces the UserObject to be executed in PREAUX

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Forces the UserObject to be executed in PREAUX

  • force_preicFalseForces the UserObject to be executed in PREIC during initial setup

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Forces the UserObject to be executed in PREIC during initial setup

  • 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

References

No citations exist within this document.