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 26 of file ReconPhaseVarIC.h.

Constructor & Destructor Documentation

ReconPhaseVarIC::ReconPhaseVarIC ( const InputParameters &  parameters)

Definition at line 20 of file ReconPhaseVarIC.C.

21  : InitialCondition(parameters),
22  _mesh(_fe_problem.mesh()),
23  _ebsd_reader(getUserObject<EBSDReader>("ebsd_reader")),
24  _phase(getParam<unsigned int>("phase")),
26 {
27 }
const std::map< dof_id_type, std::vector< Real > > & _node_to_phase_weight_map
const EBSDReader & _ebsd_reader
unsigned int _phase
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:312
MooseMesh & _mesh

Member Function Documentation

Real ReconPhaseVarIC::value ( const Point &  )
virtual

Definition at line 30 of file ReconPhaseVarIC.C.

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

Member Data Documentation

const EBSDReader& ReconPhaseVarIC::_ebsd_reader
private

Definition at line 36 of file ReconPhaseVarIC.h.

MooseMesh& ReconPhaseVarIC::_mesh
private

Definition at line 34 of file ReconPhaseVarIC.h.

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

Definition at line 40 of file ReconPhaseVarIC.h.

Referenced by value().

unsigned int ReconPhaseVarIC::_phase
private

Definition at line 38 of file ReconPhaseVarIC.h.

Referenced by value().


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