www.mooseframework.org
Public Member Functions | Private Attributes | List of all members
ReconPhaseVarIC Class Reference

ReconPhaseVarIC initializes a single order parameter to represent a phase obtained form an EBSDReader object. More...

#include <ReconPhaseVarIC.h>

Inheritance diagram for ReconPhaseVarIC:
[legend]

Public Member Functions

 ReconPhaseVarIC (const InputParameters &parameters)
 
virtual Real value (const Point &)
 

Private Attributes

MooseMesh & _mesh
 
const EBSDReader_ebsd_reader
 
unsigned int _phase
 
const std::map< dof_id_type, std::vector< Real > > & _node_to_phase_weight_map
 

Detailed Description

ReconPhaseVarIC initializes a single order parameter to represent a phase obtained form an EBSDReader object.

The op will be set to 1 for nodes that are entirely surrounded by the given phase and 0 for nodes that touch no elements with the selected phase (and fractional values for nodes on interfaces)

Definition at line 29 of file ReconPhaseVarIC.h.

Constructor & Destructor Documentation

◆ ReconPhaseVarIC()

ReconPhaseVarIC::ReconPhaseVarIC ( const InputParameters &  parameters)

Definition at line 25 of file ReconPhaseVarIC.C.

26  : InitialCondition(parameters),
27  _mesh(_fe_problem.mesh()),
28  _ebsd_reader(getUserObject<EBSDReader>("ebsd_reader")),
29  _phase(getParam<unsigned int>("phase")),
31 {
32 }
const std::map< dof_id_type, std::vector< Real > > & _node_to_phase_weight_map
const EBSDReader & _ebsd_reader
const std::map< dof_id_type, std::vector< Real > > & getNodeToPhaseWeightMap() const
Returns a map consisting of the node index followd by a vector of all phase weights for that node...
Definition: EBSDReader.C:316
unsigned int _phase
MooseMesh & _mesh

Member Function Documentation

◆ value()

Real ReconPhaseVarIC::value ( const Point &  )
virtual

Definition at line 35 of file ReconPhaseVarIC.C.

36 {
37  // Return error if current node is NULL
38  if (_current_node == nullptr)
39  mooseError("_current_node is reporting NULL");
40 
41  // Make sure the _current_node is in the _node_to_phase_weight_map (return error if not in map)
42  std::map<dof_id_type, std::vector<Real>>::const_iterator it =
43  _node_to_phase_weight_map.find(_current_node->id());
44  if (it == _node_to_phase_weight_map.end())
45  mooseError("The following node id is not in the node map: ", _current_node->id());
46 
47  // make sure we have enough ophase weights
48  if (_phase >= it->second.size())
49  mooseError("Requested an out-of-range phase number");
50 
51  return it->second[_phase];
52 }
const std::map< dof_id_type, std::vector< Real > > & _node_to_phase_weight_map
unsigned int _phase

Member Data Documentation

◆ _ebsd_reader

const EBSDReader& ReconPhaseVarIC::_ebsd_reader
private

Definition at line 39 of file ReconPhaseVarIC.h.

◆ _mesh

MooseMesh& ReconPhaseVarIC::_mesh
private

Definition at line 37 of file ReconPhaseVarIC.h.

◆ _node_to_phase_weight_map

const std::map<dof_id_type, std::vector<Real> >& ReconPhaseVarIC::_node_to_phase_weight_map
private

Definition at line 43 of file ReconPhaseVarIC.h.

Referenced by value().

◆ _phase

unsigned int ReconPhaseVarIC::_phase
private

Definition at line 41 of file ReconPhaseVarIC.h.

Referenced by value().


The documentation for this class was generated from the following files: