www.mooseframework.org
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Assembly Class Reference

Keeps track of stuff related to assembling. More...

#include <Assembly.h>

Classes

class  ElementFEShapeData
 Ok - here's the design. More...
 
class  FEShapeData
 

Public Member Functions

 Assembly (SystemBase &sys, THREAD_ID tid)
 
virtual ~Assembly ()
 
void buildFE (FEType type)
 Build FEs with a type. More...
 
void buildFaceFE (FEType type)
 Build FEs for a face with a type. More...
 
void buildNeighborFE (FEType type)
 Build FEs for a neighbor with a type. More...
 
void buildFaceNeighborFE (FEType type)
 Build FEs for a neighbor face with a type. More...
 
FEBase *& getFE (FEType type, unsigned int dim)
 Get a reference to a pointer that will contain the current volume FE. More...
 
FEBase *& getFEFace (FEType type, unsigned int dim)
 Get a reference to a pointer that will contain the current "face" FE. More...
 
FEBase *& getFENeighbor (FEType type, unsigned int dim)
 Get a reference to a pointer that will contain the current 'neighbor' FE. More...
 
FEBase *& getFEFaceNeighbor (FEType type, unsigned int dim)
 Get a reference to a pointer that will contain the current "neighbor" FE. More...
 
QBase *& qRule ()
 Returns the reference to the current quadrature being used. More...
 
const MooseArray< Point > & qPoints ()
 Returns the reference to the quadrature points. More...
 
const MooseArray< Point > & physicalPoints ()
 The current points in physical space where we have reinited through reinitAtPhysical() More...
 
const MooseArray< Real > & JxW ()
 Returns the reference to the transformed jacobian weights. More...
 
const MooseArray< Real > & coordTransformation ()
 Returns the reference to the coordinate transformation coefficients. More...
 
const Moose::CoordinateSystemTypecoordSystem ()
 Get the coordinate system type. More...
 
QBase *& qRuleFace ()
 Returns the reference to the current quadrature being used on a current face. More...
 
const MooseArray< Point > & qPointsFace ()
 Returns the reference to the current quadrature being used. More...
 
const MooseArray< Real > & JxWFace ()
 Returns the reference to the transformed jacobian weights on a current face. More...
 
const MooseArray< Point > & normals ()
 Returns the array of normals for quadrature points on a current side. More...
 
const Elem *& elem ()
 Return the current element. More...
 
const SubdomainIDcurrentSubdomainID () const
 Return the current subdomain ID. More...
 
void setCurrentSubdomainID (SubdomainID i)
 set the current subdomain ID More...
 
const Real & elemVolume ()
 Returns the reference to the current element volume. More...
 
unsigned int & side ()
 Returns the current side. More...
 
unsigned int & neighborSide ()
 Returns the current neighboring side. More...
 
const Elem *& sideElem ()
 Returns the side element. More...
 
const Real & sideElemVolume ()
 Returns the reference to the volume of current side element. More...
 
const Elem *& neighbor ()
 Return the neighbor element. More...
 
const SubdomainIDcurrentNeighborSubdomainID () const
 Return the current subdomain ID. More...
 
void setCurrentNeighborSubdomainID (SubdomainID i)
 set the current subdomain ID More...
 
const Real & neighborVolume ()
 Returns the reference to the current neighbor volume. More...
 
QBase *& qRuleNeighbor ()
 Returns the reference to the current quadrature being used on a current neighbor. More...
 
const MooseArray< Real > & JxWNeighbor ()
 Returns the reference to the transformed jacobian weights on a current face. More...
 
const Node *& node ()
 Returns the reference to the node. More...
 
const Node *& nodeNeighbor ()
 Returns the reference to the neighboring node. More...
 
void createQRules (QuadratureType type, Order order, Order volume_order, Order face_order)
 Creates the volume, face and arbitrary qrules based on the orders passed in. More...
 
void setVolumeQRule (QBase *qrule, unsigned int dim)
 Set the qrule to be used for volume integration. More...
 
void setFaceQRule (QBase *qrule, unsigned int dim)
 Set the qrule to be used for face integration. More...
 
void setNeighborQRule (QBase *qrule, unsigned int dim)
 Set the qrule to be used for neighbor integration. More...
 
void reinit (const Elem *elem)
 Reinitialize objects (JxW, q_points, ...) for an elements. More...
 
void reinitAtPhysical (const Elem *elem, const std::vector< Point > &physical_points)
 Reinitialize the assembly data at specific physical point in the given element. More...
 
void reinit (const Elem *elem, const std::vector< Point > &reference_points)
 Reinitialize the assembly data at specific points in the reference element. More...
 
void reinit (const Elem *elem, unsigned int side)
 Reinitialize the assembly data on an side of an element. More...
 
void reinitElemAndNeighbor (const Elem *elem, unsigned int side, const Elem *neighbor, unsigned int neighbor_side)
 Reinitialize an element and its neighbor along a particular side. More...
 
void reinitNeighborAtPhysical (const Elem *neighbor, unsigned int neighbor_side, const std::vector< Point > &physical_points)
 Reinitializes the neighbor at the physical coordinates on neighbor side given. More...
 
void reinitNeighborAtPhysical (const Elem *neighbor, const std::vector< Point > &physical_points)
 Reinitializes the neighbor at the physical coordinates within element given. More...
 
void reinitNeighbor (const Elem *neighbor, const std::vector< Point > &reference_points)
 
void reinit (const Node *node)
 Reinitialize assembly data for a node. More...
 
void reinitNodeNeighbor (const Node *node)
 Reinitialize assembly data for a neighbor node. More...
 
void init (const CouplingMatrix *cm)
 Initialize the Assembly object and set the CouplingMatrix for use throughout. More...
 
void init ()
 Deprecated init method. More...
 
void initNonlocalCoupling ()
 Create pair of variables requiring nonlocal jacobian contributions. More...
 
void useFECache (bool fe_cache)
 Whether or not this assembly should utilize FE shape function caching. More...
 
void prepare ()
 
void prepareNonlocal ()
 
void prepareVariable (MooseVariable *var)
 Used for preparing the dense residual and jacobian blocks for one particular variable. More...
 
void prepareVariableNonlocal (MooseVariable *var)
 
void prepareNeighbor ()
 
void prepareBlock (unsigned int ivar, unsigned jvar, const std::vector< dof_id_type > &dof_indices)
 
void prepareBlockNonlocal (unsigned int ivar, unsigned jvar, const std::vector< dof_id_type > &idof_indices, const std::vector< dof_id_type > &jdof_indices)
 
void prepareScalar ()
 
void prepareOffDiagScalar ()
 
void copyShapes (unsigned int var)
 
void copyFaceShapes (unsigned int var)
 
void copyNeighborShapes (unsigned int var)
 
void addResidual (NumericVector< Number > &residual, Moose::KernelType type=Moose::KT_NONTIME)
 
void addResidualNeighbor (NumericVector< Number > &residual, Moose::KernelType type=Moose::KT_NONTIME)
 
void addResidualScalar (NumericVector< Number > &residual, Moose::KernelType type=Moose::KT_NONTIME)
 
void cacheResidual ()
 Takes the values that are currently in _sub_Re and appends them to the cached values. More...
 
void cacheResidualContribution (dof_id_type dof, Real value, Moose::KernelType type)
 Cache individual residual contributions. More...
 
void cacheResidualNodes (DenseVector< Number > &res, std::vector< dof_id_type > &dof_index)
 Lets an external class cache residual at a set of nodes. More...
 
void cacheResidualNeighbor ()
 Takes the values that are currently in _sub_Ke and appends them to the cached values. More...
 
void addCachedResiduals ()
 
void addCachedResidual (NumericVector< Number > &residual, Moose::KernelType type)
 Adds the values that have been cached by calling cacheResidual() and or cacheResidualNeighbor() to the residual. More...
 
void setResidual (NumericVector< Number > &residual, Moose::KernelType type=Moose::KT_NONTIME)
 
void setResidualNeighbor (NumericVector< Number > &residual, Moose::KernelType type=Moose::KT_NONTIME)
 
void addJacobian (SparseMatrix< Number > &jacobian)
 
void addJacobianNonlocal (SparseMatrix< Number > &jacobian)
 
void addJacobianBlock (SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices)
 
void addJacobianBlockNonlocal (SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, const std::vector< dof_id_type > &idof_indices, const std::vector< dof_id_type > &jdof_indices)
 
void addJacobianNeighbor (SparseMatrix< Number > &jacobian)
 
void addJacobianNeighbor (SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices, std::vector< dof_id_type > &neighbor_dof_indices)
 
void addJacobianScalar (SparseMatrix< Number > &jacobian)
 
void addJacobianOffDiagScalar (SparseMatrix< Number > &jacobian, unsigned int ivar)
 
void cacheJacobian ()
 Takes the values that are currently in _sub_Kee and appends them to the cached values. More...
 
void cacheJacobianNonlocal ()
 Takes the values that are currently in _sub_Keg and appends them to the cached values. More...
 
void cacheJacobianNeighbor ()
 Takes the values that are currently in the neighbor Dense Matrices and appends them to the cached values. More...
 
void addCachedJacobian (SparseMatrix< Number > &jacobian)
 Adds the values that have been cached by calling cacheJacobian() and or cacheJacobianNeighbor() to the jacobian matrix. More...
 
DenseVector< Number > & residualBlock (unsigned int var_num, Moose::KernelType type=Moose::KT_NONTIME)
 
DenseVector< Number > & residualBlockNeighbor (unsigned int var_num, Moose::KernelType type=Moose::KT_NONTIME)
 
DenseMatrix< Number > & jacobianBlock (unsigned int ivar, unsigned int jvar)
 
DenseMatrix< Number > & jacobianBlockNonlocal (unsigned int ivar, unsigned int jvar)
 
DenseMatrix< Number > & jacobianBlockNeighbor (Moose::DGJacobianType type, unsigned int ivar, unsigned int jvar)
 
void cacheJacobianBlock (DenseMatrix< Number > &jac_block, std::vector< dof_id_type > &idof_indices, std::vector< dof_id_type > &jdof_indices, Real scaling_factor)
 
void cacheJacobianBlockNonlocal (DenseMatrix< Number > &jac_block, const std::vector< dof_id_type > &idof_indices, const std::vector< dof_id_type > &jdof_indices, Real scaling_factor)
 
std::vector< std::pair< MooseVariable *, MooseVariable * > > & couplingEntries ()
 
std::vector< std::pair< MooseVariable *, MooseVariable * > > & nonlocalCouplingEntries ()
 
const VariablePhiValuephi ()
 
const VariablePhiGradientgradPhi ()
 
const VariablePhiSecondsecondPhi ()
 
const VariablePhiValuephiFace ()
 
const VariablePhiGradientgradPhiFace ()
 
const VariablePhiSecondsecondPhiFace ()
 
const VariablePhiValuephiNeighbor ()
 
const VariablePhiGradientgradPhiNeighbor ()
 
const VariablePhiSecondsecondPhiNeighbor ()
 
const VariablePhiValuephiFaceNeighbor ()
 
const VariablePhiGradientgradPhiFaceNeighbor ()
 
const VariablePhiSecondsecondPhiFaceNeighbor ()
 
const VariablePhiValuefePhi (FEType type)
 
const VariablePhiGradientfeGradPhi (FEType type)
 
const VariablePhiSecondfeSecondPhi (FEType type)
 
const VariablePhiValuefePhiFace (FEType type)
 
const VariablePhiGradientfeGradPhiFace (FEType type)
 
const VariablePhiSecondfeSecondPhiFace (FEType type)
 
const VariablePhiValuefePhiNeighbor (FEType type)
 
const VariablePhiGradientfeGradPhiNeighbor (FEType type)
 
const VariablePhiSecondfeSecondPhiNeighbor (FEType type)
 
const VariablePhiValuefePhiFaceNeighbor (FEType type)
 
const VariablePhiGradientfeGradPhiFaceNeighbor (FEType type)
 
const VariablePhiSecondfeSecondPhiFaceNeighbor (FEType type)
 
void invalidateCache ()
 Invalidate any currently cached data. More...
 
void cacheJacobianContribution (numeric_index_type i, numeric_index_type j, Real value)
 Caches the Jacobian entry 'value', to eventually be added/set in the (i,j) location of the matrix. More...
 
void setCachedJacobianContributions (SparseMatrix< Number > &jacobian)
 Sets previously-cached Jacobian values via SparseMatrix::set() calls. More...
 
void zeroCachedJacobianContributions (SparseMatrix< Number > &jacobian)
 Zero out previously-cached Jacobian rows. More...
 
void addCachedJacobianContributions (SparseMatrix< Number > &jacobian)
 Adds previously-cached Jacobian values via SparseMatrix::add() calls. More...
 
void setXFEM (std::shared_ptr< XFEMInterface > xfem)
 Set the pointer to the XFEM controller object. More...
 

Public Attributes

std::map< FEType, bool > _need_second_derivative
 

Protected Member Functions

void reinitFE (const Elem *elem)
 Just an internal helper function to reinit the volume FE objects. More...
 
void reinitFEFace (const Elem *elem, unsigned int side)
 Just an internal helper function to reinit the face FE objects. More...
 
void reinitFEFaceNeighbor (const Elem *neighbor, const std::vector< Point > &reference_points)
 
void reinitFENeighbor (const Elem *neighbor, const std::vector< Point > &reference_points)
 
void setCoordinateTransformation (const QBase *qrule, const MooseArray< Point > &q_points)
 
void computeCurrentElemVolume ()
 
void computeCurrentFaceVolume ()
 
void computeCurrentNeighborVolume ()
 
void addResidualBlock (NumericVector< Number > &residual, DenseVector< Number > &res_block, const std::vector< dof_id_type > &dof_indices, Real scaling_factor)
 
void cacheResidualBlock (std::vector< Real > &cached_residual_values, std::vector< dof_id_type > &cached_residual_rows, DenseVector< Number > &res_block, std::vector< dof_id_type > &dof_indices, Real scaling_factor)
 
void setResidualBlock (NumericVector< Number > &residual, DenseVector< Number > &res_block, std::vector< dof_id_type > &dof_indices, Real scaling_factor)
 
void addJacobianBlock (SparseMatrix< Number > &jacobian, DenseMatrix< Number > &jac_block, const std::vector< dof_id_type > &idof_indices, const std::vector< dof_id_type > &jdof_indices, Real scaling_factor)
 
void clearCachedJacobianContributions ()
 Clear any currently cached jacobian contributions. More...
 
void modifyWeightsDueToXFEM (const Elem *elem)
 Update the integration weights for XFEM partial elements. More...
 

Protected Attributes

SystemBase_sys
 
const CouplingMatrix * _cm
 Coupling matrices. More...
 
const CouplingMatrix & _nonlocal_cm
 
std::vector< std::pair< MooseVariable *, MooseVariable * > > _cm_entry
 Entries in the coupling matrix (only for field variables) More...
 
std::vector< std::pair< MooseVariable *, MooseVariable * > > _cm_nonlocal_entry
 
std::vector< std::vector< unsigned char > > _jacobian_block_used
 Flag that indicates if the jacobian block was used. More...
 
std::vector< std::vector< unsigned char > > _jacobian_block_nonlocal_used
 
std::vector< std::vector< unsigned char > > _jacobian_block_neighbor_used
 Flag that indicates if the jacobian block for neighbor was used. More...
 
const DofMap & _dof_map
 DOF map. More...
 
THREAD_ID _tid
 Thread number (id) More...
 
MooseMesh_mesh
 
unsigned int _mesh_dimension
 
std::shared_ptr< XFEMInterface_xfem
 The XFEM controller. More...
 
std::map< FEType, FEBase * > _current_fe
 The "volume" fe object that matches the current elem. More...
 
std::map< FEType, FEBase * > _current_fe_face
 The "face" fe object that matches the current elem. More...
 
std::map< FEType, FEBase * > _current_fe_neighbor
 The "neighbor" fe object that matches the current elem. More...
 
std::map< FEType, FEBase * > _current_fe_face_neighbor
 The "neighbor face" fe object that matches the current elem. More...
 
std::map< unsigned int, std::map< FEType, FEBase * > > _fe
 Each dimension's actual fe objects indexed on type. More...
 
std::map< unsigned int, FEBase ** > _holder_fe_helper
 Each dimension's helper objects. More...
 
FEBase * _current_fe_helper
 The current helper object for transforming coordinates. More...
 
QBase * _current_qrule
 The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac kernels) More...
 
QBase * _current_qrule_volume
 The current volumetric quadrature for the element. More...
 
ArbitraryQuadrature_current_qrule_arbitrary
 The current arbitrary quadrature rule used within the element interior. More...
 
MooseArray< Point > _current_q_points
 The current list of quadrature points. More...
 
MooseArray< Real > _current_JxW
 The current list of transformed jacobian weights. More...
 
Moose::CoordinateSystemType _coord_type
 The coordinate system. More...
 
MooseArray< Real > _coord
 The current coordinate transformation coefficients. More...
 
std::map< unsigned int, QBase * > _holder_qrule_volume
 Holds volume qrules for each dimension. More...
 
std::map< unsigned int, ArbitraryQuadrature * > _holder_qrule_arbitrary
 Holds arbitrary qrules for each dimension. More...
 
std::map< unsigned int, const std::vector< Point > * > _holder_q_points
 Holds pointers to the dimension's q_points. More...
 
std::map< unsigned int, const std::vector< Real > * > _holder_JxW
 Holds pointers to the dimension's transformed jacobian weights. More...
 
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face
 types of finite elements More...
 
std::map< unsigned int, FEBase ** > _holder_fe_face_helper
 Each dimension's helper objects. More...
 
FEBase * _current_fe_face_helper
 helper object for transforming coordinates More...
 
QBase * _current_qrule_face
 quadrature rule used on faces More...
 
ArbitraryQuadrature_current_qface_arbitrary
 The current arbitrary quadrature rule used on element faces. More...
 
MooseArray< Point > _current_q_points_face
 The current quadrature points on a face. More...
 
MooseArray< Real > _current_JxW_face
 The current transformed jacobian weights on a face. More...
 
MooseArray< Point > _current_normals
 The current Normal vectors at the quadrature points. More...
 
std::map< unsigned int, QBase * > _holder_qrule_face
 Holds face qrules for each dimension. More...
 
std::map< unsigned int, ArbitraryQuadrature * > _holder_qface_arbitrary
 Holds arbitrary face qrules for each dimension. More...
 
std::map< unsigned int, const std::vector< Point > * > _holder_q_points_face
 Holds pointers to the dimension's q_points on a face. More...
 
std::map< unsigned int, const std::vector< Real > * > _holder_JxW_face
 Holds pointers to the dimension's transformed jacobian weights on a face. More...
 
std::map< unsigned int, const std::vector< Point > * > _holder_normals
 Holds pointers to the dimension's normal vectors. More...
 
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_neighbor
 types of finite elements More...
 
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face_neighbor
 
std::map< unsigned int, FEBase ** > _holder_fe_neighbor_helper
 Each dimension's helper objects. More...
 
std::map< unsigned int, FEBase ** > _holder_fe_face_neighbor_helper
 
QBase * _current_qrule_neighbor
 quadrature rule used on neighbors More...
 
std::map< unsigned int, ArbitraryQuadrature * > _holder_qrule_neighbor
 Holds arbitrary qrules for each dimension. More...
 
MooseArray< Real > _current_JxW_neighbor
 The current transformed jacobian weights on a neighbor's face. More...
 
MooseArray< Real > _coord_neighbor
 The current coordinate transformation coefficients. More...
 
const Elem * _current_elem
 The current "element" we are currently on. More...
 
SubdomainID _current_subdomain_id
 The current subdomain ID. More...
 
Real _current_elem_volume
 Volume of the current element. More...
 
unsigned int _current_side
 The current side of the selected element (valid only when working with sides) More...
 
const Elem * _current_side_elem
 The current "element" making up the side we are currently on. More...
 
Real _current_side_volume
 Volume of the current side element. More...
 
const Elem * _current_neighbor_elem
 The current neighbor "element". More...
 
SubdomainID _current_neighbor_subdomain_id
 The current neighbor subdomain ID. More...
 
unsigned int _current_neighbor_side
 The current side of the selected neighboring element (valid only when working with sides) More...
 
const Elem * _current_neighbor_side_elem
 The current side element of the ncurrent neighbor element. More...
 
bool _need_neighbor_elem_volume
 true is apps need to compute neighbor element volume More...
 
Real _current_neighbor_volume
 Volume of the current neighbor. More...
 
const Node * _current_node
 The current node we are working with. More...
 
const Node * _current_neighbor_node
 The current neighboring node we are working with. More...
 
bool _current_elem_volume_computed
 Boolean to indicate whether current element volumes has been computed. More...
 
bool _current_side_volume_computed
 Boolean to indicate whether current element side volumes has been computed. More...
 
MooseArray< Point > _current_physical_points
 This will be filled up with the physical points passed into reinitAtPhysical() if it is called. Invalid at all other times. More...
 
std::vector< std::vector< DenseVector< Number > > > _sub_Re
 residual contributions for each variable from the element More...
 
std::vector< std::vector< DenseVector< Number > > > _sub_Rn
 residual contributions for each variable from the neighbor More...
 
DenseVector< Number > _tmp_Re
 auxiliary vector for scaling residuals (optimization to avoid expensive construction/destruction) More...
 
std::vector< std::vector< DenseMatrix< Number > > > _sub_Kee
 jacobian contributions More...
 
std::vector< std::vector< DenseMatrix< Number > > > _sub_Keg
 
std::vector< std::vector< DenseMatrix< Number > > > _sub_Ken
 jacobian contributions from the element and neighbor More...
 
std::vector< std::vector< DenseMatrix< Number > > > _sub_Kne
 jacobian contributions from the neighbor and element More...
 
std::vector< std::vector< DenseMatrix< Number > > > _sub_Knn
 jacobian contributions from the neighbor More...
 
DenseMatrix< Number > _tmp_Ke
 auxiliary matrix for scaling jacobians (optimization to avoid expensive construction/destruction) More...
 
VariablePhiValue _phi
 
VariablePhiGradient _grad_phi
 
VariablePhiSecond _second_phi
 
VariablePhiValue _phi_face
 
VariablePhiGradient _grad_phi_face
 
VariablePhiSecond _second_phi_face
 
VariablePhiValue _phi_neighbor
 
VariablePhiGradient _grad_phi_neighbor
 
VariablePhiSecond _second_phi_neighbor
 
VariablePhiValue _phi_face_neighbor
 
VariablePhiGradient _grad_phi_face_neighbor
 
VariablePhiSecond _second_phi_face_neighbor
 
std::map< dof_id_type, ElementFEShapeData * > _element_fe_shape_data_cache
 Cached shape function values stored by element. More...
 
bool _should_use_fe_cache
 Whether or not fe cache should be built at all. More...
 
bool _currently_fe_caching
 Whether or not fe should currently be cached - This will be false if something funky is going on with the quadrature rules. More...
 
std::map< FEType, FEShapeData * > _fe_shape_data
 
std::map< FEType, FEShapeData * > _fe_shape_data_face
 
std::map< FEType, FEShapeData * > _fe_shape_data_neighbor
 
std::map< FEType, FEShapeData * > _fe_shape_data_face_neighbor
 
std::vector< std::vector< Real > > _cached_residual_values
 Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME) More...
 
std::vector< std::vector< dof_id_type > > _cached_residual_rows
 Where the cached values should go (the first vector is for TIME vs NONTIME) More...
 
unsigned int _max_cached_residuals
 
std::vector< Real > _cached_jacobian_values
 Values cached by calling cacheJacobian() More...
 
std::vector< dof_id_type > _cached_jacobian_rows
 Row where the corresponding cached value should go. More...
 
std::vector< dof_id_type > _cached_jacobian_cols
 Column where the corresponding cached value should go. More...
 
unsigned int _max_cached_jacobians
 
unsigned int _block_diagonal_matrix
 Will be true if our preconditioning matrix is a block-diagonal matrix. Which means that we can take some shortcuts. More...
 
std::vector< dof_id_type > _temp_dof_indices
 Temporary work vector to keep from reallocating it. More...
 
std::vector< Point > _temp_reference_points
 Temporary work data for reinitAtPhysical() More...
 
std::vector< Real > _cached_jacobian_contribution_vals
 Storage for cached Jacobian entries. More...
 
std::vector< numeric_index_type > _cached_jacobian_contribution_rows
 
std::vector< numeric_index_type > _cached_jacobian_contribution_cols
 

Detailed Description

Keeps track of stuff related to assembling.

Definition at line 63 of file Assembly.h.

Constructor & Destructor Documentation

Assembly::Assembly ( SystemBase sys,
THREAD_ID  tid 
)

Definition at line 39 of file Assembly.C.

40  : _sys(sys),
42  _dof_map(_sys.dofMap()),
43  _tid(tid),
44  _mesh(sys.mesh()),
46  _current_qrule(NULL),
50  _current_qrule_face(NULL),
53 
54  _current_elem(NULL),
56  _current_side(0),
57  _current_side_elem(NULL),
64  _current_node(NULL),
68 
69  _should_use_fe_cache(false),
71 
72  _cached_residual_values(2), // The 2 is for TIME and NONTIME
73  _cached_residual_rows(2), // The 2 is for TIME and NONTIME
74 
78 {
79  // Build fe's for the helpers
80  buildFE(FEType(FIRST, LAGRANGE));
81  buildFaceFE(FEType(FIRST, LAGRANGE));
82  buildNeighborFE(FEType(FIRST, LAGRANGE));
83  buildFaceNeighborFE(FEType(FIRST, LAGRANGE));
84 
85  // Build an FE helper object for this type for each dimension up to the dimension of the current
86  // mesh
87  for (unsigned int dim = 0; dim <= _mesh_dimension; dim++)
88  {
89  _holder_fe_helper[dim] = &_fe[dim][FEType(FIRST, LAGRANGE)];
90  (*_holder_fe_helper[dim])->get_phi();
91  (*_holder_fe_helper[dim])->get_dphi();
92  (*_holder_fe_helper[dim])->get_xyz();
93  (*_holder_fe_helper[dim])->get_JxW();
94 
95  _holder_fe_face_helper[dim] = &_fe_face[dim][FEType(FIRST, LAGRANGE)];
96  (*_holder_fe_face_helper[dim])->get_phi();
97  (*_holder_fe_face_helper[dim])->get_dphi();
98  (*_holder_fe_face_helper[dim])->get_xyz();
99  (*_holder_fe_face_helper[dim])->get_JxW();
100  (*_holder_fe_face_helper[dim])->get_normals();
101 
102  _holder_fe_face_neighbor_helper[dim] = &_fe_face_neighbor[dim][FEType(FIRST, LAGRANGE)];
103  (*_holder_fe_face_neighbor_helper[dim])->get_xyz();
104  (*_holder_fe_face_neighbor_helper[dim])->get_JxW();
105  (*_holder_fe_face_neighbor_helper[dim])->get_normals();
106 
107  _holder_fe_neighbor_helper[dim] = &_fe_neighbor[dim][FEType(FIRST, LAGRANGE)];
108  (*_holder_fe_neighbor_helper[dim])->get_xyz();
109  (*_holder_fe_neighbor_helper[dim])->get_JxW();
110  }
111 }
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face
types of finite elements
Definition: Assembly.h:735
bool _need_neighbor_elem_volume
true is apps need to compute neighbor element volume
Definition: Assembly.h:800
ArbitraryQuadrature * _current_qrule_arbitrary
The current arbitrary quadrature rule used within the element interior.
Definition: Assembly.h:714
void buildNeighborFE(FEType type)
Build FEs for a neighbor with a type.
Definition: Assembly.C:208
std::map< unsigned int, FEBase ** > _holder_fe_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:706
SystemBase & _sys
Definition: Assembly.h:667
std::vector< std::vector< dof_id_type > > _cached_residual_rows
Where the cached values should go (the first vector is for TIME vs NONTIME)
Definition: Assembly.h:905
unsigned int _max_cached_residuals
Definition: Assembly.h:907
QBase * _current_qrule
The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac k...
Definition: Assembly.h:710
std::map< unsigned int, FEBase ** > _holder_fe_face_neighbor_helper
Definition: Assembly.h:768
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh m...
Definition: MooseMesh.C:1945
const CouplingMatrix & nonlocalCouplingMatrix() const
Definition: SubProblem.h:414
bool _current_elem_volume_computed
Boolean to indicate whether current element volumes has been computed.
Definition: Assembly.h:808
bool _currently_fe_caching
Whether or not fe should currently be cached - This will be false if something funky is going on with...
Definition: Assembly.h:893
Real _current_neighbor_volume
Volume of the current neighbor.
Definition: Assembly.h:802
const Elem * _current_neighbor_elem
The current neighbor "element".
Definition: Assembly.h:792
MooseMesh & _mesh
Definition: Assembly.h:685
const Elem * _current_elem
The current "element" we are currently on.
Definition: Assembly.h:780
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
Real _current_elem_volume
Volume of the current element.
Definition: Assembly.h:784
unsigned int _block_diagonal_matrix
Will be true if our preconditioning matrix is a block-diagonal matrix. Which means that we can take s...
Definition: Assembly.h:919
void buildFaceFE(FEType type)
Build FEs for a face with a type.
Definition: Assembly.C:190
unsigned int _mesh_dimension
Definition: Assembly.h:687
QBase * _current_qrule_volume
The current volumetric quadrature for the element.
Definition: Assembly.h:712
const DofMap & _dof_map
DOF map.
Definition: Assembly.h:681
unsigned int _max_cached_jacobians
Definition: Assembly.h:916
const CouplingMatrix & _nonlocal_cm
Definition: Assembly.h:671
unsigned int _current_neighbor_side
The current side of the selected neighboring element (valid only when working with sides) ...
Definition: Assembly.h:796
virtual DofMap & dofMap()
Gets the dof map.
Definition: SystemBase.C:610
QBase * _current_qrule_neighbor
quadrature rule used on neighbors
Definition: Assembly.h:771
std::map< unsigned int, FEBase ** > _holder_fe_neighbor_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:767
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_neighbor
types of finite elements
Definition: Assembly.h:764
void buildFaceNeighborFE(FEType type)
Build FEs for a neighbor face with a type.
Definition: Assembly.C:226
void buildFE(FEType type)
Build FEs with a type.
Definition: Assembly.C:168
virtual SubProblem & subproblem()
Definition: SystemBase.h:103
ArbitraryQuadrature * _current_qface_arbitrary
The current arbitrary quadrature rule used on element faces.
Definition: Assembly.h:743
std::map< unsigned int, FEBase ** > _holder_fe_face_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:737
std::map< unsigned int, std::map< FEType, FEBase * > > _fe
Each dimension&#39;s actual fe objects indexed on type.
Definition: Assembly.h:704
Real _current_side_volume
Volume of the current side element.
Definition: Assembly.h:790
std::vector< std::vector< Real > > _cached_residual_values
Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME) ...
Definition: Assembly.h:902
const Node * _current_node
The current node we are working with.
Definition: Assembly.h:804
virtual MooseMesh & mesh()
Definition: SystemBase.h:102
bool _should_use_fe_cache
Whether or not fe cache should be built at all.
Definition: Assembly.h:890
unsigned int _current_side
The current side of the selected element (valid only when working with sides)
Definition: Assembly.h:786
const Elem * _current_neighbor_side_elem
The current side element of the ncurrent neighbor element.
Definition: Assembly.h:798
bool _current_side_volume_computed
Boolean to indicate whether current element side volumes has been computed.
Definition: Assembly.h:810
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face_neighbor
Definition: Assembly.h:765
Moose::CoordinateSystemType _coord_type
The coordinate system.
Definition: Assembly.h:720
const Elem * _current_side_elem
The current "element" making up the side we are currently on.
Definition: Assembly.h:788
QBase * _current_qrule_face
quadrature rule used on faces
Definition: Assembly.h:741
const Node * _current_neighbor_node
The current neighboring node we are working with.
Definition: Assembly.h:806
Assembly::~Assembly ( )
virtual

Definition at line 113 of file Assembly.C.

114 {
115  for (unsigned int dim = 0; dim <= _mesh_dimension; dim++)
116  for (auto & it : _fe[dim])
117  delete it.second;
118 
119  for (unsigned int dim = 0; dim <= _mesh_dimension; dim++)
120  for (auto & it : _fe_face[dim])
121  delete it.second;
122 
123  for (unsigned int dim = 0; dim <= _mesh_dimension; dim++)
124  for (auto & it : _fe_neighbor[dim])
125  delete it.second;
126 
127  for (unsigned int dim = 0; dim <= _mesh_dimension; dim++)
128  for (auto & it : _fe_face_neighbor[dim])
129  delete it.second;
130 
131  for (auto & it : _holder_qrule_volume)
132  delete it.second;
133 
134  for (auto & it : _holder_qrule_arbitrary)
135  delete it.second;
136 
137  for (auto & it : _holder_qface_arbitrary)
138  delete it.second;
139 
140  for (auto & it : _holder_qrule_face)
141  delete it.second;
142 
143  for (auto & it : _holder_qrule_neighbor)
144  delete it.second;
145 
146  for (auto & it : _fe_shape_data)
147  delete it.second;
148 
149  for (auto & it : _fe_shape_data_face)
150  delete it.second;
151 
152  for (auto & it : _fe_shape_data_neighbor)
153  delete it.second;
154 
155  for (auto & it : _fe_shape_data_face_neighbor)
156  delete it.second;
157 
158  delete _current_side_elem;
160 
162 
163  _coord.release();
165 }
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face
types of finite elements
Definition: Assembly.h:735
MooseArray< Point > _current_physical_points
This will be filled up with the physical points passed into reinitAtPhysical() if it is called...
Definition: Assembly.h:813
MooseArray< Real > _coord_neighbor
The current coordinate transformation coefficients.
Definition: Assembly.h:777
MooseArray< Real > _coord
The current coordinate transformation coefficients.
Definition: Assembly.h:722
std::map< unsigned int, ArbitraryQuadrature * > _holder_qrule_neighbor
Holds arbitrary qrules for each dimension.
Definition: Assembly.h:773
std::map< FEType, FEShapeData * > _fe_shape_data_face_neighbor
Definition: Assembly.h:899
unsigned int _mesh_dimension
Definition: Assembly.h:687
std::map< unsigned int, QBase * > _holder_qrule_face
Holds face qrules for each dimension.
Definition: Assembly.h:751
std::map< FEType, FEShapeData * > _fe_shape_data_neighbor
Definition: Assembly.h:898
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_neighbor
types of finite elements
Definition: Assembly.h:764
std::map< unsigned int, ArbitraryQuadrature * > _holder_qrule_arbitrary
Holds arbitrary qrules for each dimension.
Definition: Assembly.h:726
std::map< unsigned int, std::map< FEType, FEBase * > > _fe
Each dimension&#39;s actual fe objects indexed on type.
Definition: Assembly.h:704
std::map< unsigned int, ArbitraryQuadrature * > _holder_qface_arbitrary
Holds arbitrary face qrules for each dimension.
Definition: Assembly.h:753
void release()
Manually deallocates the data pointer.
Definition: MooseArray.h:56
const Elem * _current_neighbor_side_elem
The current side element of the ncurrent neighbor element.
Definition: Assembly.h:798
std::map< unsigned int, QBase * > _holder_qrule_volume
Holds volume qrules for each dimension.
Definition: Assembly.h:724
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face_neighbor
Definition: Assembly.h:765
std::map< FEType, FEShapeData * > _fe_shape_data
Definition: Assembly.h:896
std::map< FEType, FEShapeData * > _fe_shape_data_face
Definition: Assembly.h:897
const Elem * _current_side_elem
The current "element" making up the side we are currently on.
Definition: Assembly.h:788

Member Function Documentation

void Assembly::addCachedJacobian ( SparseMatrix< Number > &  jacobian)

Adds the values that have been cached by calling cacheJacobian() and or cacheJacobianNeighbor() to the jacobian matrix.

Note that this will also clear the cache.

Definition at line 1576 of file Assembly.C.

1577 {
1579  mooseAssert(_cached_jacobian_rows.size() == _cached_jacobian_cols.size(),
1580  "Error: Cached data sizes MUST be the same!");
1581 
1582  for (unsigned int i = 0; i < _cached_jacobian_rows.size(); i++)
1584 
1587 
1588  // Try to be more efficient from now on
1589  // The 2 is just a fudge factor to keep us from having to grow the vector during assembly
1590  _cached_jacobian_values.clear();
1592 
1593  _cached_jacobian_rows.clear();
1595 
1596  _cached_jacobian_cols.clear();
1598 }
SystemBase & _sys
Definition: Assembly.h:667
unsigned int _max_cached_jacobians
Definition: Assembly.h:916
std::vector< dof_id_type > _cached_jacobian_cols
Column where the corresponding cached value should go.
Definition: Assembly.h:914
virtual bool checkNonlocalCouplingRequirement()
Definition: SubProblem.h:62
virtual SubProblem & subproblem()
Definition: SystemBase.h:103
std::vector< Real > _cached_jacobian_values
Values cached by calling cacheJacobian()
Definition: Assembly.h:910
std::vector< dof_id_type > _cached_jacobian_rows
Row where the corresponding cached value should go.
Definition: Assembly.h:912
void Assembly::addCachedJacobianContributions ( SparseMatrix< Number > &  jacobian)

Adds previously-cached Jacobian values via SparseMatrix::add() calls.

Definition at line 1937 of file Assembly.C.

Referenced by NonlinearSystemBase::computeJacobianInternal(), ComputeNodalKernelBCJacobiansThread::onNode(), and ComputeNodalKernelJacobiansThread::onNode().

1938 {
1939  // TODO: Use SparseMatrix::add_values() for efficiency
1940  for (unsigned int i = 0; i < _cached_jacobian_contribution_vals.size(); ++i)
1941  jacobian.add(_cached_jacobian_contribution_rows[i],
1944 
1946 }
std::vector< numeric_index_type > _cached_jacobian_contribution_cols
Definition: Assembly.h:932
std::vector< numeric_index_type > _cached_jacobian_contribution_rows
Definition: Assembly.h:931
std::vector< Real > _cached_jacobian_contribution_vals
Storage for cached Jacobian entries.
Definition: Assembly.h:930
void clearCachedJacobianContributions()
Clear any currently cached jacobian contributions.
Definition: Assembly.C:1949
void Assembly::addCachedResidual ( NumericVector< Number > &  residual,
Moose::KernelType  type 
)

Adds the values that have been cached by calling cacheResidual() and or cacheResidualNeighbor() to the residual.

Note that this will also clear the cache.

Definition at line 1426 of file Assembly.C.

Referenced by addCachedResiduals().

1427 {
1428  if (!_sys.hasResidualVector(type))
1429  {
1430  _cached_residual_values[type].clear();
1431  _cached_residual_rows[type].clear();
1432  return;
1433  }
1434 
1435  std::vector<Real> & cached_residual_values = _cached_residual_values[type];
1436  std::vector<dof_id_type> & cached_residual_rows = _cached_residual_rows[type];
1437 
1438  mooseAssert(cached_residual_values.size() == cached_residual_rows.size(),
1439  "Number of cached residuals and number of rows must match!");
1440 
1441  residual.add_vector(cached_residual_values, cached_residual_rows);
1442 
1443  if (_max_cached_residuals < cached_residual_values.size())
1444  _max_cached_residuals = cached_residual_values.size();
1445 
1446  // Try to be more efficient from now on
1447  // The 2 is just a fudge factor to keep us from having to grow the vector during assembly
1448  cached_residual_values.clear();
1449  cached_residual_values.reserve(_max_cached_residuals * 2);
1450 
1451  cached_residual_rows.clear();
1452  cached_residual_rows.reserve(_max_cached_residuals * 2);
1453 }
SystemBase & _sys
Definition: Assembly.h:667
std::vector< std::vector< dof_id_type > > _cached_residual_rows
Where the cached values should go (the first vector is for TIME vs NONTIME)
Definition: Assembly.h:905
unsigned int _max_cached_residuals
Definition: Assembly.h:907
std::vector< std::vector< Real > > _cached_residual_values
Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME) ...
Definition: Assembly.h:902
MatType type
virtual bool hasResidualVector(Moose::KernelType) const
Definition: SystemBase.h:159
void Assembly::addCachedResiduals ( )

Definition at line 1410 of file Assembly.C.

1411 {
1412  for (unsigned int i = 0; i < _sub_Re.size(); i++)
1413  {
1415  if (!_sys.hasResidualVector(type))
1416  {
1417  _cached_residual_values[i].clear();
1418  _cached_residual_rows[i].clear();
1419  continue;
1420  }
1422  }
1423 }
void addCachedResidual(NumericVector< Number > &residual, Moose::KernelType type)
Adds the values that have been cached by calling cacheResidual() and or cacheResidualNeighbor() to th...
Definition: Assembly.C:1426
SystemBase & _sys
Definition: Assembly.h:667
std::vector< std::vector< dof_id_type > > _cached_residual_rows
Where the cached values should go (the first vector is for TIME vs NONTIME)
Definition: Assembly.h:905
std::vector< std::vector< DenseVector< Number > > > _sub_Re
residual contributions for each variable from the element
Definition: Assembly.h:816
KernelType
Definition: MooseTypes.h:162
std::vector< std::vector< Real > > _cached_residual_values
Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME) ...
Definition: Assembly.h:902
MatType type
virtual NumericVector< Number > & residualVector(Moose::KernelType)
Definition: SystemBase.h:158
virtual bool hasResidualVector(Moose::KernelType) const
Definition: SystemBase.h:159
void Assembly::addJacobian ( SparseMatrix< Number > &  jacobian)

Definition at line 1601 of file Assembly.C.

1602 {
1603  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1604  for (const auto & ivar : vars)
1605  for (const auto & jvar : vars)
1606  if ((*_cm)(ivar->number(), jvar->number()) != 0 &&
1607  _jacobian_block_used[ivar->number()][jvar->number()])
1608  addJacobianBlock(jacobian,
1609  jacobianBlock(ivar->number(), jvar->number()),
1610  ivar->dofIndices(),
1611  jvar->dofIndices(),
1612  ivar->scalingFactor());
1613 
1614  // Possibly add jacobian contributions from off-diagonal blocks coming from the scalar variables
1615  if (_sys.getScalarVariables(_tid).size() > 0)
1616  {
1617  const std::vector<MooseVariableScalar *> & scalar_vars = _sys.getScalarVariables(_tid);
1618  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1619  for (const auto & ivar : scalar_vars)
1620  {
1621  for (const auto & jvar : vars)
1622  {
1623  // We only add jacobian blocks for d(nl-var)/d(scalar-var) now (these we generated by
1624  // kernels and BCs)
1625  // jacobian blocks d(scalar-var)/d(nl-var) are added later with addJacobianScalar
1626  if ((*_cm)(jvar->number(), ivar->number()) != 0 &&
1627  _jacobian_block_used[jvar->number()][ivar->number()])
1628  addJacobianBlock(jacobian,
1629  jacobianBlock(jvar->number(), ivar->number()),
1630  jvar->dofIndices(),
1631  ivar->dofIndices(),
1632  jvar->scalingFactor());
1633  if ((*_cm)(ivar->number(), jvar->number()) != 0 &&
1634  _jacobian_block_used[ivar->number()][jvar->number()])
1635  addJacobianBlock(jacobian,
1636  jacobianBlock(ivar->number(), jvar->number()),
1637  ivar->dofIndices(),
1638  jvar->dofIndices(),
1639  ivar->scalingFactor());
1640  }
1641  }
1642  }
1643 }
SystemBase & _sys
Definition: Assembly.h:667
void addJacobianBlock(SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices)
Definition: Assembly.C:1780
const std::vector< MooseVariableScalar * > & getScalarVariables(THREAD_ID tid)
Definition: SystemBase.h:422
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
const CouplingMatrix * _cm
Coupling matrices.
Definition: Assembly.h:670
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
std::vector< std::vector< unsigned char > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition: Assembly.h:676
DenseMatrix< Number > & jacobianBlock(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:887
void Assembly::addJacobianBlock ( SparseMatrix< Number > &  jacobian,
unsigned int  ivar,
unsigned int  jvar,
const DofMap &  dof_map,
std::vector< dof_id_type > &  dof_indices 
)

Definition at line 1780 of file Assembly.C.

Referenced by addJacobian(), addJacobianNeighbor(), addJacobianNonlocal(), addJacobianOffDiagScalar(), and addJacobianScalar().

1785 {
1786  DenseMatrix<Number> & ke = jacobianBlock(ivar, jvar);
1787 
1788  // stick it into the matrix
1789  std::vector<dof_id_type> di(dof_indices);
1790  dof_map.constrain_element_matrix(ke, di, false);
1791 
1792  Real scaling_factor = _sys.getVariable(_tid, ivar).scalingFactor();
1793  if (scaling_factor != 1.0)
1794  {
1795  _tmp_Ke = ke;
1796  _tmp_Ke *= scaling_factor;
1797  jacobian.add_matrix(_tmp_Ke, di);
1798  }
1799  else
1800  jacobian.add_matrix(ke, di);
1801 }
SystemBase & _sys
Definition: Assembly.h:667
DenseMatrix< Number > _tmp_Ke
auxiliary matrix for scaling jacobians (optimization to avoid expensive construction/destruction) ...
Definition: Assembly.h:834
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
virtual MooseVariable & getVariable(THREAD_ID tid, const std::string &var_name)
Gets a reference to a variable of with specified name.
Definition: SystemBase.C:103
DofMap & dof_map
DenseMatrix< Number > & jacobianBlock(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:887
void scalingFactor(Real factor)
Set the scaling factor for this variable.
void Assembly::addJacobianBlock ( SparseMatrix< Number > &  jacobian,
DenseMatrix< Number > &  jac_block,
const std::vector< dof_id_type > &  idof_indices,
const std::vector< dof_id_type > &  jdof_indices,
Real  scaling_factor 
)
protected

Definition at line 1498 of file Assembly.C.

1503 {
1504  if ((idof_indices.size() > 0) && (jdof_indices.size() > 0) && jac_block.n() && jac_block.m())
1505  {
1506  std::vector<dof_id_type> di(idof_indices);
1507  std::vector<dof_id_type> dj(jdof_indices);
1508  _dof_map.constrain_element_matrix(jac_block, di, dj, false);
1509 
1510  if (scaling_factor != 1.0)
1511  {
1512  _tmp_Ke = jac_block;
1513  _tmp_Ke *= scaling_factor;
1514  jacobian.add_matrix(_tmp_Ke, di, dj);
1515  }
1516  else
1517  jacobian.add_matrix(jac_block, di, dj);
1518  }
1519 }
DenseMatrix< Number > _tmp_Ke
auxiliary matrix for scaling jacobians (optimization to avoid expensive construction/destruction) ...
Definition: Assembly.h:834
const DofMap & _dof_map
DOF map.
Definition: Assembly.h:681
void Assembly::addJacobianBlockNonlocal ( SparseMatrix< Number > &  jacobian,
unsigned int  ivar,
unsigned int  jvar,
const DofMap &  dof_map,
const std::vector< dof_id_type > &  idof_indices,
const std::vector< dof_id_type > &  jdof_indices 
)

Definition at line 1804 of file Assembly.C.

1810 {
1811  DenseMatrix<Number> & keg = jacobianBlockNonlocal(ivar, jvar);
1812 
1813  std::vector<dof_id_type> di(idof_indices);
1814  std::vector<dof_id_type> dg(jdof_indices);
1815  dof_map.constrain_element_matrix(keg, di, dg, false);
1816 
1817  Real scaling_factor = _sys.getVariable(_tid, ivar).scalingFactor();
1818  if (scaling_factor != 1.0)
1819  {
1820  _tmp_Ke = keg;
1821  _tmp_Ke *= scaling_factor;
1822  jacobian.add_matrix(_tmp_Ke, di, dg);
1823  }
1824  else
1825  jacobian.add_matrix(keg, di, dg);
1826 }
SystemBase & _sys
Definition: Assembly.h:667
DenseMatrix< Number > _tmp_Ke
auxiliary matrix for scaling jacobians (optimization to avoid expensive construction/destruction) ...
Definition: Assembly.h:834
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
virtual MooseVariable & getVariable(THREAD_ID tid, const std::string &var_name)
Gets a reference to a variable of with specified name.
Definition: SystemBase.C:103
DofMap & dof_map
DenseMatrix< Number > & jacobianBlockNonlocal(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:894
void scalingFactor(Real factor)
Set the scaling factor for this variable.
void Assembly::addJacobianNeighbor ( SparseMatrix< Number > &  jacobian)

Definition at line 1661 of file Assembly.C.

1662 {
1663  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1664  for (const auto & ivar : vars)
1665  for (const auto & jvar : vars)
1666  if ((*_cm)(ivar->number(), jvar->number()) != 0 &&
1667  _jacobian_block_neighbor_used[ivar->number()][jvar->number()])
1668  {
1670  jacobian,
1671  jacobianBlockNeighbor(Moose::ElementNeighbor, ivar->number(), jvar->number()),
1672  ivar->dofIndices(),
1673  jvar->dofIndicesNeighbor(),
1674  ivar->scalingFactor());
1675 
1677  jacobian,
1678  jacobianBlockNeighbor(Moose::NeighborElement, ivar->number(), jvar->number()),
1679  ivar->dofIndicesNeighbor(),
1680  jvar->dofIndices(),
1681  ivar->scalingFactor());
1682 
1684  jacobian,
1685  jacobianBlockNeighbor(Moose::NeighborNeighbor, ivar->number(), jvar->number()),
1686  ivar->dofIndicesNeighbor(),
1687  jvar->dofIndicesNeighbor(),
1688  ivar->scalingFactor());
1689  }
1690 }
SystemBase & _sys
Definition: Assembly.h:667
void addJacobianBlock(SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices)
Definition: Assembly.C:1780
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
const CouplingMatrix * _cm
Coupling matrices.
Definition: Assembly.h:670
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
std::vector< std::vector< unsigned char > > _jacobian_block_neighbor_used
Flag that indicates if the jacobian block for neighbor was used.
Definition: Assembly.h:679
DenseMatrix< Number > & jacobianBlockNeighbor(Moose::DGJacobianType type, unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:901
void Assembly::addJacobianNeighbor ( SparseMatrix< Number > &  jacobian,
unsigned int  ivar,
unsigned int  jvar,
const DofMap &  dof_map,
std::vector< dof_id_type > &  dof_indices,
std::vector< dof_id_type > &  neighbor_dof_indices 
)

Definition at line 1829 of file Assembly.C.

1835 {
1836  DenseMatrix<Number> & kee = jacobianBlock(ivar, jvar);
1837  DenseMatrix<Number> & ken = jacobianBlockNeighbor(Moose::ElementNeighbor, ivar, jvar);
1838  DenseMatrix<Number> & kne = jacobianBlockNeighbor(Moose::NeighborElement, ivar, jvar);
1839  DenseMatrix<Number> & knn = jacobianBlockNeighbor(Moose::NeighborNeighbor, ivar, jvar);
1840 
1841  std::vector<dof_id_type> di(dof_indices);
1842  std::vector<dof_id_type> dn(neighbor_dof_indices);
1843  // stick it into the matrix
1844  dof_map.constrain_element_matrix(kee, di, false);
1845  dof_map.constrain_element_matrix(ken, di, dn, false);
1846  dof_map.constrain_element_matrix(kne, dn, di, false);
1847  dof_map.constrain_element_matrix(knn, dn, false);
1848 
1849  Real scaling_factor = _sys.getVariable(_tid, ivar).scalingFactor();
1850  if (scaling_factor != 1.0)
1851  {
1852  _tmp_Ke = ken;
1853  _tmp_Ke *= scaling_factor;
1854  jacobian.add_matrix(_tmp_Ke, di, dn);
1855 
1856  _tmp_Ke = kne;
1857  _tmp_Ke *= scaling_factor;
1858  jacobian.add_matrix(_tmp_Ke, dn, di);
1859 
1860  _tmp_Ke = knn;
1861  _tmp_Ke *= scaling_factor;
1862  jacobian.add_matrix(_tmp_Ke, dn);
1863  }
1864  else
1865  {
1866  jacobian.add_matrix(ken, di, dn);
1867  jacobian.add_matrix(kne, dn, di);
1868  jacobian.add_matrix(knn, dn);
1869  }
1870 }
SystemBase & _sys
Definition: Assembly.h:667
DenseMatrix< Number > _tmp_Ke
auxiliary matrix for scaling jacobians (optimization to avoid expensive construction/destruction) ...
Definition: Assembly.h:834
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
virtual MooseVariable & getVariable(THREAD_ID tid, const std::string &var_name)
Gets a reference to a variable of with specified name.
Definition: SystemBase.C:103
DofMap & dof_map
DenseMatrix< Number > & jacobianBlock(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:887
DenseMatrix< Number > & jacobianBlockNeighbor(Moose::DGJacobianType type, unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:901
void scalingFactor(Real factor)
Set the scaling factor for this variable.
void Assembly::addJacobianNonlocal ( SparseMatrix< Number > &  jacobian)

Definition at line 1646 of file Assembly.C.

1647 {
1648  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1649  for (const auto & ivar : vars)
1650  for (const auto & jvar : vars)
1651  if (_nonlocal_cm(ivar->number(), jvar->number()) != 0 &&
1652  _jacobian_block_nonlocal_used[ivar->number()][jvar->number()])
1653  addJacobianBlock(jacobian,
1654  jacobianBlockNonlocal(ivar->number(), jvar->number()),
1655  ivar->dofIndices(),
1656  jvar->allDofIndices(),
1657  ivar->scalingFactor());
1658 }
SystemBase & _sys
Definition: Assembly.h:667
void addJacobianBlock(SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices)
Definition: Assembly.C:1780
std::vector< std::vector< unsigned char > > _jacobian_block_nonlocal_used
Definition: Assembly.h:677
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
const CouplingMatrix & _nonlocal_cm
Definition: Assembly.h:671
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
DenseMatrix< Number > & jacobianBlockNonlocal(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:894
void Assembly::addJacobianOffDiagScalar ( SparseMatrix< Number > &  jacobian,
unsigned int  ivar 
)

Definition at line 1888 of file Assembly.C.

1889 {
1890  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1892  for (const auto & var_j : vars)
1893  if ((*_cm)(var_i.number(), var_j->number()) != 0 &&
1894  _jacobian_block_used[var_i.number()][var_j->number()])
1895  addJacobianBlock(jacobian,
1896  jacobianBlock(var_i.number(), var_j->number()),
1897  var_i.dofIndices(),
1898  var_j->dofIndices(),
1899  var_i.scalingFactor());
1900 }
SystemBase & _sys
Definition: Assembly.h:667
void addJacobianBlock(SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices)
Definition: Assembly.C:1780
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
const CouplingMatrix * _cm
Coupling matrices.
Definition: Assembly.h:670
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
unsigned int number() const
Get variable number coming from libMesh.
std::vector< dof_id_type > & dofIndices()
Class for scalar variables (they are different).
std::vector< std::vector< unsigned char > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition: Assembly.h:676
DenseMatrix< Number > & jacobianBlock(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:887
virtual MooseVariableScalar & getScalarVariable(THREAD_ID tid, const std::string &var_name)
Gets a reference to a scalar variable with specified number.
Definition: SystemBase.C:121
void scalingFactor(Real factor)
Set the scaling factor for this variable.
void Assembly::addJacobianScalar ( SparseMatrix< Number > &  jacobian)

Definition at line 1873 of file Assembly.C.

1874 {
1875  const std::vector<MooseVariableScalar *> & scalar_vars = _sys.getScalarVariables(_tid);
1876  for (const auto & ivar : scalar_vars)
1877  for (const auto & jvar : scalar_vars)
1878  if ((*_cm)(ivar->number(), jvar->number()) != 0 &&
1879  _jacobian_block_used[ivar->number()][jvar->number()])
1880  addJacobianBlock(jacobian,
1881  jacobianBlock(ivar->number(), jvar->number()),
1882  ivar->dofIndices(),
1883  jvar->dofIndices(),
1884  ivar->scalingFactor());
1885 }
SystemBase & _sys
Definition: Assembly.h:667
void addJacobianBlock(SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices)
Definition: Assembly.C:1780
const std::vector< MooseVariableScalar * > & getScalarVariables(THREAD_ID tid)
Definition: SystemBase.h:422
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
const CouplingMatrix * _cm
Coupling matrices.
Definition: Assembly.h:670
std::vector< std::vector< unsigned char > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition: Assembly.h:676
DenseMatrix< Number > & jacobianBlock(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:887
void Assembly::addResidual ( NumericVector< Number > &  residual,
Moose::KernelType  type = Moose::KT_NONTIME 
)

Definition at line 1330 of file Assembly.C.

1332 {
1333  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1334  for (const auto & var : vars)
1336  residual, _sub_Re[type][var->number()], var->dofIndices(), var->scalingFactor());
1337 }
SystemBase & _sys
Definition: Assembly.h:667
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
std::vector< std::vector< DenseVector< Number > > > _sub_Re
residual contributions for each variable from the element
Definition: Assembly.h:816
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
MatType type
void addResidualBlock(NumericVector< Number > &residual, DenseVector< Number > &res_block, const std::vector< dof_id_type > &dof_indices, Real scaling_factor)
Definition: Assembly.C:1270
void Assembly::addResidualBlock ( NumericVector< Number > &  residual,
DenseVector< Number > &  res_block,
const std::vector< dof_id_type > &  dof_indices,
Real  scaling_factor 
)
protected

Definition at line 1270 of file Assembly.C.

Referenced by addResidual(), addResidualNeighbor(), and addResidualScalar().

1274 {
1275  if (dof_indices.size() > 0 && res_block.size())
1276  {
1277  _temp_dof_indices = dof_indices;
1278  _dof_map.constrain_element_vector(res_block, _temp_dof_indices, false);
1279 
1280  if (scaling_factor != 1.0)
1281  {
1282  _tmp_Re = res_block;
1283  _tmp_Re *= scaling_factor;
1284  residual.add_vector(_tmp_Re, _temp_dof_indices);
1285  }
1286  else
1287  {
1288  residual.add_vector(res_block, _temp_dof_indices);
1289  }
1290  }
1291 }
DenseVector< Number > _tmp_Re
auxiliary vector for scaling residuals (optimization to avoid expensive construction/destruction) ...
Definition: Assembly.h:820
const DofMap & _dof_map
DOF map.
Definition: Assembly.h:681
std::vector< dof_id_type > _temp_dof_indices
Temporary work vector to keep from reallocating it.
Definition: Assembly.h:922
void Assembly::addResidualNeighbor ( NumericVector< Number > &  residual,
Moose::KernelType  type = Moose::KT_NONTIME 
)

Definition at line 1340 of file Assembly.C.

1342 {
1343  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1344  for (const auto & var : vars)
1346  residual, _sub_Rn[type][var->number()], var->dofIndicesNeighbor(), var->scalingFactor());
1347 }
SystemBase & _sys
Definition: Assembly.h:667
std::vector< std::vector< DenseVector< Number > > > _sub_Rn
residual contributions for each variable from the neighbor
Definition: Assembly.h:818
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
MatType type
void addResidualBlock(NumericVector< Number > &residual, DenseVector< Number > &res_block, const std::vector< dof_id_type > &dof_indices, Real scaling_factor)
Definition: Assembly.C:1270
void Assembly::addResidualScalar ( NumericVector< Number > &  residual,
Moose::KernelType  type = Moose::KT_NONTIME 
)

Definition at line 1350 of file Assembly.C.

1352 {
1353  // add the scalar variables residuals
1354  const std::vector<MooseVariableScalar *> & vars = _sys.getScalarVariables(_tid);
1355  for (const auto & var : vars)
1357  residual, _sub_Re[type][var->number()], var->dofIndices(), var->scalingFactor());
1358 }
SystemBase & _sys
Definition: Assembly.h:667
const std::vector< MooseVariableScalar * > & getScalarVariables(THREAD_ID tid)
Definition: SystemBase.h:422
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
std::vector< std::vector< DenseVector< Number > > > _sub_Re
residual contributions for each variable from the element
Definition: Assembly.h:816
MatType type
void addResidualBlock(NumericVector< Number > &residual, DenseVector< Number > &res_block, const std::vector< dof_id_type > &dof_indices, Real scaling_factor)
Definition: Assembly.C:1270
void Assembly::buildFaceFE ( FEType  type)

Build FEs for a face with a type.

Parameters
typeThe type of FE

Definition at line 190 of file Assembly.C.

Referenced by Assembly(), feGradPhiFace(), fePhiFace(), feSecondPhiFace(), and getFEFace().

191 {
193  _fe_shape_data_face[type] = new FEShapeData;
194 
195  // Build an FE object for this type for each dimension up to the dimension of the current mesh
196  for (unsigned int dim = 0; dim <= _mesh_dimension; dim++)
197  {
198  if (!_fe_face[dim][type])
199  _fe_face[dim][type] = FEBase::build(dim, type).release();
200  _fe_face[dim][type]->get_phi();
201  _fe_face[dim][type]->get_dphi();
202  if (_need_second_derivative.find(type) != _need_second_derivative.end())
203  _fe_face[dim][type]->get_d2phi();
204  }
205 }
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face
types of finite elements
Definition: Assembly.h:735
std::map< FEType, bool > _need_second_derivative
Definition: Assembly.h:571
unsigned int _mesh_dimension
Definition: Assembly.h:687
MatType type
std::map< FEType, FEShapeData * > _fe_shape_data_face
Definition: Assembly.h:897
void Assembly::buildFaceNeighborFE ( FEType  type)

Build FEs for a neighbor face with a type.

Parameters
typeThe type of FE

Definition at line 226 of file Assembly.C.

Referenced by Assembly(), feGradPhiFaceNeighbor(), fePhiFaceNeighbor(), feSecondPhiFaceNeighbor(), and getFEFaceNeighbor().

227 {
229  _fe_shape_data_face_neighbor[type] = new FEShapeData;
230 
231  // Build an FE object for this type for each dimension up to the dimension of the current mesh
232  for (unsigned int dim = 0; dim <= _mesh_dimension; dim++)
233  {
234  if (!_fe_face_neighbor[dim][type])
235  _fe_face_neighbor[dim][type] = FEBase::build(dim, type).release();
236  _fe_face_neighbor[dim][type]->get_phi();
237  _fe_face_neighbor[dim][type]->get_dphi();
238  if (_need_second_derivative.find(type) != _need_second_derivative.end())
239  _fe_face_neighbor[dim][type]->get_d2phi();
240  }
241 }
std::map< FEType, bool > _need_second_derivative
Definition: Assembly.h:571
std::map< FEType, FEShapeData * > _fe_shape_data_face_neighbor
Definition: Assembly.h:899
unsigned int _mesh_dimension
Definition: Assembly.h:687
MatType type
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face_neighbor
Definition: Assembly.h:765
void Assembly::buildFE ( FEType  type)

Build FEs with a type.

Parameters
typeThe type of FE

Definition at line 168 of file Assembly.C.

Referenced by Assembly(), feGradPhi(), fePhi(), feSecondPhi(), getFE(), and MooseVariable::MooseVariable().

169 {
170  if (!_fe_shape_data[type])
171  _fe_shape_data[type] = new FEShapeData;
172 
173  // Build an FE object for this type for each dimension up to the dimension of the current mesh
174  for (unsigned int dim = 0; dim <= _mesh_dimension; dim++)
175  {
176  if (!_fe[dim][type])
177  _fe[dim][type] = FEBase::build(dim, type).release();
178  _fe[dim][type]->get_phi();
179  _fe[dim][type]->get_dphi();
180  // Pre-request xyz. We have always computed xyz, but due to
181  // recent optimizations in libmesh, we now need to explicity
182  // request it, since apps (Yak) may rely on it being computed.
183  _fe[dim][type]->get_xyz();
184  if (_need_second_derivative.find(type) != _need_second_derivative.end())
185  _fe[dim][type]->get_d2phi();
186  }
187 }
std::map< FEType, bool > _need_second_derivative
Definition: Assembly.h:571
unsigned int _mesh_dimension
Definition: Assembly.h:687
std::map< unsigned int, std::map< FEType, FEBase * > > _fe
Each dimension&#39;s actual fe objects indexed on type.
Definition: Assembly.h:704
MatType type
std::map< FEType, FEShapeData * > _fe_shape_data
Definition: Assembly.h:896
void Assembly::buildNeighborFE ( FEType  type)

Build FEs for a neighbor with a type.

Parameters
typeThe type of FE

Definition at line 208 of file Assembly.C.

Referenced by Assembly(), feGradPhiNeighbor(), fePhiNeighbor(), and feSecondPhiNeighbor().

209 {
211  _fe_shape_data_neighbor[type] = new FEShapeData;
212 
213  // Build an FE object for this type for each dimension up to the dimension of the current mesh
214  for (unsigned int dim = 0; dim <= _mesh_dimension; dim++)
215  {
216  if (!_fe_neighbor[dim][type])
217  _fe_neighbor[dim][type] = FEBase::build(dim, type).release();
218  _fe_neighbor[dim][type]->get_phi();
219  _fe_neighbor[dim][type]->get_dphi();
220  if (_need_second_derivative.find(type) != _need_second_derivative.end())
221  _fe_neighbor[dim][type]->get_d2phi();
222  }
223 }
std::map< FEType, bool > _need_second_derivative
Definition: Assembly.h:571
unsigned int _mesh_dimension
Definition: Assembly.h:687
std::map< FEType, FEShapeData * > _fe_shape_data_neighbor
Definition: Assembly.h:898
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_neighbor
types of finite elements
Definition: Assembly.h:764
MatType type
void Assembly::cacheJacobian ( )

Takes the values that are currently in _sub_Kee and appends them to the cached values.

Definition at line 1693 of file Assembly.C.

1694 {
1695  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1696  for (const auto & ivar : vars)
1697  for (const auto & jvar : vars)
1698  if ((*_cm)(ivar->number(), jvar->number()) != 0 &&
1699  _jacobian_block_used[ivar->number()][jvar->number()])
1700  cacheJacobianBlock(jacobianBlock(ivar->number(), jvar->number()),
1701  ivar->dofIndices(),
1702  jvar->dofIndices(),
1703  ivar->scalingFactor());
1704 
1705  // Possibly add jacobian contributions from off-diagonal blocks coming from the scalar variables
1706  if (_sys.getScalarVariables(_tid).size() > 0)
1707  {
1708  const std::vector<MooseVariableScalar *> & scalar_vars = _sys.getScalarVariables(_tid);
1709  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1710  for (std::vector<MooseVariableScalar *>::const_iterator it = scalar_vars.begin();
1711  it != scalar_vars.end();
1712  ++it)
1713  {
1714  MooseVariableScalar & ivar = *(*it);
1715  for (std::vector<MooseVariable *>::const_iterator jt = vars.begin(); jt != vars.end(); ++jt)
1716  {
1717  MooseVariable & jvar = *(*jt);
1718  // We only add jacobian blocks for d(nl-var)/d(scalar-var) now (these we generated by
1719  // kernels and BCs)
1720  // jacobian blocks d(scalar-var)/d(nl-var) are added later with addJacobianScalar
1721  if ((*_cm)(jvar.number(), ivar.number()) != 0 &&
1722  _jacobian_block_used[jvar.number()][ivar.number()])
1724  jvar.dofIndices(),
1725  ivar.dofIndices(),
1726  jvar.scalingFactor());
1727  if ((*_cm)(ivar.number(), jvar.number()) != 0 &&
1728  _jacobian_block_used[ivar.number()][jvar.number()])
1730  ivar.dofIndices(),
1731  jvar.dofIndices(),
1732  ivar.scalingFactor());
1733  }
1734  }
1735  }
1736 }
SystemBase & _sys
Definition: Assembly.h:667
void cacheJacobianBlock(DenseMatrix< Number > &jac_block, std::vector< dof_id_type > &idof_indices, std::vector< dof_id_type > &jdof_indices, Real scaling_factor)
Definition: Assembly.C:1522
const std::vector< MooseVariableScalar * > & getScalarVariables(THREAD_ID tid)
Definition: SystemBase.h:422
Class for stuff related to variables.
Definition: MooseVariable.h:43
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
const CouplingMatrix * _cm
Coupling matrices.
Definition: Assembly.h:670
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
unsigned int number() const
Get variable number coming from libMesh.
std::vector< dof_id_type > & dofIndices()
Class for scalar variables (they are different).
std::vector< std::vector< unsigned char > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition: Assembly.h:676
DenseMatrix< Number > & jacobianBlock(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:887
void scalingFactor(Real factor)
Set the scaling factor for this variable.
void Assembly::cacheJacobianBlock ( DenseMatrix< Number > &  jac_block,
std::vector< dof_id_type > &  idof_indices,
std::vector< dof_id_type > &  jdof_indices,
Real  scaling_factor 
)

Definition at line 1522 of file Assembly.C.

Referenced by cacheJacobian(), cacheJacobianNeighbor(), NodalConstraint::computeJacobian(), and NonlinearSystemBase::constraintJacobians().

1526 {
1527  if ((idof_indices.size() > 0) && (jdof_indices.size() > 0) && jac_block.n() && jac_block.m())
1528  {
1529  std::vector<dof_id_type> di(idof_indices);
1530  std::vector<dof_id_type> dj(jdof_indices);
1531  _dof_map.constrain_element_matrix(jac_block, di, dj, false);
1532 
1533  if (scaling_factor != 1.0)
1534  jac_block *= scaling_factor;
1535 
1536  for (unsigned int i = 0; i < di.size(); i++)
1537  for (unsigned int j = 0; j < dj.size(); j++)
1538  {
1539  _cached_jacobian_values.push_back(jac_block(i, j));
1540  _cached_jacobian_rows.push_back(di[i]);
1541  _cached_jacobian_cols.push_back(dj[j]);
1542  }
1543  }
1544  jac_block.zero();
1545 }
const DofMap & _dof_map
DOF map.
Definition: Assembly.h:681
std::vector< dof_id_type > _cached_jacobian_cols
Column where the corresponding cached value should go.
Definition: Assembly.h:914
std::vector< Real > _cached_jacobian_values
Values cached by calling cacheJacobian()
Definition: Assembly.h:910
std::vector< dof_id_type > _cached_jacobian_rows
Row where the corresponding cached value should go.
Definition: Assembly.h:912
void Assembly::cacheJacobianBlockNonlocal ( DenseMatrix< Number > &  jac_block,
const std::vector< dof_id_type > &  idof_indices,
const std::vector< dof_id_type > &  jdof_indices,
Real  scaling_factor 
)

Definition at line 1548 of file Assembly.C.

Referenced by cacheJacobianNonlocal().

1552 {
1553  if ((idof_indices.size() > 0) && (jdof_indices.size() > 0) && jac_block.n() && jac_block.m())
1554  {
1555  std::vector<dof_id_type> di(idof_indices);
1556  std::vector<dof_id_type> dj(jdof_indices);
1557  _dof_map.constrain_element_matrix(jac_block, di, dj, false);
1558 
1559  if (scaling_factor != 1.0)
1560  jac_block *= scaling_factor;
1561 
1562  for (unsigned int i = 0; i < di.size(); i++)
1563  for (unsigned int j = 0; j < dj.size(); j++)
1564  if (jac_block(i, j) != 0.0) // no storage allocated for unimplemented jacobian terms,
1565  // maintaining maximum sparsity possible
1566  {
1567  _cached_jacobian_values.push_back(jac_block(i, j));
1568  _cached_jacobian_rows.push_back(di[i]);
1569  _cached_jacobian_cols.push_back(dj[j]);
1570  }
1571  }
1572  jac_block.zero();
1573 }
const DofMap & _dof_map
DOF map.
Definition: Assembly.h:681
std::vector< dof_id_type > _cached_jacobian_cols
Column where the corresponding cached value should go.
Definition: Assembly.h:914
std::vector< Real > _cached_jacobian_values
Values cached by calling cacheJacobian()
Definition: Assembly.h:910
std::vector< dof_id_type > _cached_jacobian_rows
Row where the corresponding cached value should go.
Definition: Assembly.h:912
void Assembly::cacheJacobianContribution ( numeric_index_type  i,
numeric_index_type  j,
Real  value 
)

Caches the Jacobian entry 'value', to eventually be added/set in the (i,j) location of the matrix.

We use numeric_index_type for the index arrays (rather than dof_id_type) since that is what the SparseMatrix interface uses, but at the time of this writing, those two types are equivalent.

Definition at line 1903 of file Assembly.C.

Referenced by NodalBC::computeJacobian(), NodalKernel::computeJacobian(), NodalBC::computeOffDiagJacobian(), and NodalKernel::computeOffDiagJacobian().

1904 {
1907  _cached_jacobian_contribution_vals.push_back(value);
1908 }
std::vector< numeric_index_type > _cached_jacobian_contribution_cols
Definition: Assembly.h:932
std::vector< numeric_index_type > _cached_jacobian_contribution_rows
Definition: Assembly.h:931
std::vector< Real > _cached_jacobian_contribution_vals
Storage for cached Jacobian entries.
Definition: Assembly.h:930
void Assembly::cacheJacobianNeighbor ( )

Takes the values that are currently in the neighbor Dense Matrices and appends them to the cached values.

Definition at line 1753 of file Assembly.C.

1754 {
1755  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1756  for (const auto & ivar : vars)
1757  for (const auto & jvar : vars)
1758  if ((*_cm)(ivar->number(), jvar->number()) != 0 &&
1759  _jacobian_block_neighbor_used[ivar->number()][jvar->number()])
1760  {
1762  jacobianBlockNeighbor(Moose::ElementNeighbor, ivar->number(), jvar->number()),
1763  ivar->dofIndices(),
1764  jvar->dofIndicesNeighbor(),
1765  ivar->scalingFactor());
1767  jacobianBlockNeighbor(Moose::NeighborElement, ivar->number(), jvar->number()),
1768  ivar->dofIndicesNeighbor(),
1769  jvar->dofIndices(),
1770  ivar->scalingFactor());
1772  jacobianBlockNeighbor(Moose::NeighborNeighbor, ivar->number(), jvar->number()),
1773  ivar->dofIndicesNeighbor(),
1774  jvar->dofIndicesNeighbor(),
1775  ivar->scalingFactor());
1776  }
1777 }
SystemBase & _sys
Definition: Assembly.h:667
void cacheJacobianBlock(DenseMatrix< Number > &jac_block, std::vector< dof_id_type > &idof_indices, std::vector< dof_id_type > &jdof_indices, Real scaling_factor)
Definition: Assembly.C:1522
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
const CouplingMatrix * _cm
Coupling matrices.
Definition: Assembly.h:670
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
std::vector< std::vector< unsigned char > > _jacobian_block_neighbor_used
Flag that indicates if the jacobian block for neighbor was used.
Definition: Assembly.h:679
DenseMatrix< Number > & jacobianBlockNeighbor(Moose::DGJacobianType type, unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:901
void Assembly::cacheJacobianNonlocal ( )

Takes the values that are currently in _sub_Keg and appends them to the cached values.

Definition at line 1739 of file Assembly.C.

1740 {
1741  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1742  for (const auto & ivar : vars)
1743  for (const auto & jvar : vars)
1744  if (_nonlocal_cm(ivar->number(), jvar->number()) != 0 &&
1745  _jacobian_block_nonlocal_used[ivar->number()][jvar->number()])
1746  cacheJacobianBlockNonlocal(jacobianBlockNonlocal(ivar->number(), jvar->number()),
1747  ivar->dofIndices(),
1748  jvar->allDofIndices(),
1749  ivar->scalingFactor());
1750 }
SystemBase & _sys
Definition: Assembly.h:667
std::vector< std::vector< unsigned char > > _jacobian_block_nonlocal_used
Definition: Assembly.h:677
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
const CouplingMatrix & _nonlocal_cm
Definition: Assembly.h:671
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
void cacheJacobianBlockNonlocal(DenseMatrix< Number > &jac_block, const std::vector< dof_id_type > &idof_indices, const std::vector< dof_id_type > &jdof_indices, Real scaling_factor)
Definition: Assembly.C:1548
DenseMatrix< Number > & jacobianBlockNonlocal(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:894
void Assembly::cacheResidual ( )

Takes the values that are currently in _sub_Re and appends them to the cached values.

Definition at line 1361 of file Assembly.C.

1362 {
1363  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1364  for (const auto & var : vars)
1365  for (unsigned int i = 0; i < _sub_Re.size(); i++)
1369  _sub_Re[i][var->number()],
1370  var->dofIndices(),
1371  var->scalingFactor());
1372 }
SystemBase & _sys
Definition: Assembly.h:667
std::vector< std::vector< dof_id_type > > _cached_residual_rows
Where the cached values should go (the first vector is for TIME vs NONTIME)
Definition: Assembly.h:905
void cacheResidualBlock(std::vector< Real > &cached_residual_values, std::vector< dof_id_type > &cached_residual_rows, DenseVector< Number > &res_block, std::vector< dof_id_type > &dof_indices, Real scaling_factor)
Definition: Assembly.C:1294
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
std::vector< std::vector< DenseVector< Number > > > _sub_Re
residual contributions for each variable from the element
Definition: Assembly.h:816
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
KernelType
Definition: MooseTypes.h:162
std::vector< std::vector< Real > > _cached_residual_values
Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME) ...
Definition: Assembly.h:902
virtual bool hasResidualVector(Moose::KernelType) const
Definition: SystemBase.h:159
void Assembly::cacheResidualBlock ( std::vector< Real > &  cached_residual_values,
std::vector< dof_id_type > &  cached_residual_rows,
DenseVector< Number > &  res_block,
std::vector< dof_id_type > &  dof_indices,
Real  scaling_factor 
)
protected

Definition at line 1294 of file Assembly.C.

Referenced by cacheResidual(), and cacheResidualNeighbor().

1299 {
1300  if (dof_indices.size() > 0 && res_block.size())
1301  {
1302  _temp_dof_indices = dof_indices;
1303  _dof_map.constrain_element_vector(res_block, _temp_dof_indices, false);
1304 
1305  if (scaling_factor != 1.0)
1306  {
1307  _tmp_Re = res_block;
1308  _tmp_Re *= scaling_factor;
1309 
1310  for (unsigned int i = 0; i < _tmp_Re.size(); i++)
1311  {
1312  cached_residual_values.push_back(_tmp_Re(i));
1313  cached_residual_rows.push_back(_temp_dof_indices[i]);
1314  }
1315  }
1316  else
1317  {
1318  for (unsigned int i = 0; i < res_block.size(); i++)
1319  {
1320  cached_residual_values.push_back(res_block(i));
1321  cached_residual_rows.push_back(_temp_dof_indices[i]);
1322  }
1323  }
1324  }
1325 
1326  res_block.zero();
1327 }
DenseVector< Number > _tmp_Re
auxiliary vector for scaling residuals (optimization to avoid expensive construction/destruction) ...
Definition: Assembly.h:820
const DofMap & _dof_map
DOF map.
Definition: Assembly.h:681
std::vector< dof_id_type > _temp_dof_indices
Temporary work vector to keep from reallocating it.
Definition: Assembly.h:922
void Assembly::cacheResidualContribution ( dof_id_type  dof,
Real  value,
Moose::KernelType  type 
)

Cache individual residual contributions.

These will ultimately get added to the residual when addCachedResidual() is called.

Parameters
dofThe degree of freedom to add the residual contribution to
valueThe value of the residual contribution.
typeWhether the contribution should go to the Time or Non-Time residual

Definition at line 1375 of file Assembly.C.

Referenced by TimeNodalKernel::computeResidual(), and NodalKernel::computeResidual().

1376 {
1377  _cached_residual_values[type].push_back(value);
1378  _cached_residual_rows[type].push_back(dof);
1379 }
std::vector< std::vector< dof_id_type > > _cached_residual_rows
Where the cached values should go (the first vector is for TIME vs NONTIME)
Definition: Assembly.h:905
std::vector< std::vector< Real > > _cached_residual_values
Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME) ...
Definition: Assembly.h:902
MatType type
void Assembly::cacheResidualNeighbor ( )

Takes the values that are currently in _sub_Ke and appends them to the cached values.

Definition at line 1382 of file Assembly.C.

1383 {
1384  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1385  for (const auto & var : vars)
1386  for (unsigned int i = 0; i < _sub_Re.size(); i++)
1390  _sub_Rn[i][var->number()],
1391  var->dofIndicesNeighbor(),
1392  var->scalingFactor());
1393 }
SystemBase & _sys
Definition: Assembly.h:667
std::vector< std::vector< dof_id_type > > _cached_residual_rows
Where the cached values should go (the first vector is for TIME vs NONTIME)
Definition: Assembly.h:905
void cacheResidualBlock(std::vector< Real > &cached_residual_values, std::vector< dof_id_type > &cached_residual_rows, DenseVector< Number > &res_block, std::vector< dof_id_type > &dof_indices, Real scaling_factor)
Definition: Assembly.C:1294
std::vector< std::vector< DenseVector< Number > > > _sub_Rn
residual contributions for each variable from the neighbor
Definition: Assembly.h:818
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
std::vector< std::vector< DenseVector< Number > > > _sub_Re
residual contributions for each variable from the element
Definition: Assembly.h:816
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
KernelType
Definition: MooseTypes.h:162
std::vector< std::vector< Real > > _cached_residual_values
Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME) ...
Definition: Assembly.h:902
virtual bool hasResidualVector(Moose::KernelType) const
Definition: SystemBase.h:159
void Assembly::cacheResidualNodes ( DenseVector< Number > &  res,
std::vector< dof_id_type > &  dof_index 
)

Lets an external class cache residual at a set of nodes.

Definition at line 1396 of file Assembly.C.

Referenced by NodalConstraint::computeResidual().

1397 {
1398  // Add the residual value and dof_index to cached_residual_values and cached_residual_rows
1399  // respectively.
1400  // This is used by NodalConstraint.C to cache the residual calculated for master and slave node.
1402  for (unsigned int i = 0; i < dof_index.size(); ++i)
1403  {
1404  _cached_residual_values[type].push_back(res(i));
1405  _cached_residual_rows[type].push_back(dof_index[i]);
1406  }
1407 }
std::vector< std::vector< dof_id_type > > _cached_residual_rows
Where the cached values should go (the first vector is for TIME vs NONTIME)
Definition: Assembly.h:905
KernelType
Definition: MooseTypes.h:162
std::vector< std::vector< Real > > _cached_residual_values
Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME) ...
Definition: Assembly.h:902
MatType type
void Assembly::clearCachedJacobianContributions ( )
protected

Clear any currently cached jacobian contributions.

This is automatically called by setCachedJacobianContributions and addCachedJacobianContributions

Definition at line 1949 of file Assembly.C.

Referenced by addCachedJacobianContributions(), setCachedJacobianContributions(), and zeroCachedJacobianContributions().

1950 {
1951  unsigned int orig_size = _cached_jacobian_contribution_rows.size();
1952 
1956 
1957  // It's possible (though massively unlikely) that clear() will
1958  // change the capacity of the vectors, so let's be paranoid and
1959  // explicitly reserve() the same amount of memory to avoid multiple
1960  // push_back() induced allocations. We reserve 20% more than the
1961  // original size that was cached to account for variations in the
1962  // number of BCs assigned to each thread (for when the Jacobian
1963  // contributions are computed threaded).
1964  _cached_jacobian_contribution_rows.reserve(1.2 * orig_size);
1965  _cached_jacobian_contribution_cols.reserve(1.2 * orig_size);
1966  _cached_jacobian_contribution_vals.reserve(1.2 * orig_size);
1967 }
std::vector< numeric_index_type > _cached_jacobian_contribution_cols
Definition: Assembly.h:932
std::vector< numeric_index_type > _cached_jacobian_contribution_rows
Definition: Assembly.h:931
std::vector< Real > _cached_jacobian_contribution_vals
Storage for cached Jacobian entries.
Definition: Assembly.h:930
void Assembly::computeCurrentElemVolume ( )
protected

Definition at line 704 of file Assembly.C.

Referenced by reinit().

705 {
707  return;
708 
710 
712  for (unsigned int qp = 0; qp < _current_qrule->n_points(); qp++)
714 
716 }
QBase * _current_qrule
The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac k...
Definition: Assembly.h:710
MooseArray< Real > _coord
The current coordinate transformation coefficients.
Definition: Assembly.h:722
bool _current_elem_volume_computed
Boolean to indicate whether current element volumes has been computed.
Definition: Assembly.h:808
Real _current_elem_volume
Volume of the current element.
Definition: Assembly.h:784
MooseArray< Real > _current_JxW
The current list of transformed jacobian weights.
Definition: Assembly.h:718
void setCoordinateTransformation(const QBase *qrule, const MooseArray< Point > &q_points)
Definition: Assembly.C:674
MooseArray< Point > _current_q_points
The current list of quadrature points.
Definition: Assembly.h:716
void Assembly::computeCurrentFaceVolume ( )
protected

Definition at line 719 of file Assembly.C.

Referenced by reinit().

720 {
722  return;
723 
725 
727  for (unsigned int qp = 0; qp < _current_qrule_face->n_points(); qp++)
729 
731 }
MooseArray< Real > _coord
The current coordinate transformation coefficients.
Definition: Assembly.h:722
MooseArray< Real > _current_JxW_face
The current transformed jacobian weights on a face.
Definition: Assembly.h:747
Real _current_side_volume
Volume of the current side element.
Definition: Assembly.h:790
void setCoordinateTransformation(const QBase *qrule, const MooseArray< Point > &q_points)
Definition: Assembly.C:674
bool _current_side_volume_computed
Boolean to indicate whether current element side volumes has been computed.
Definition: Assembly.h:810
MooseArray< Point > _current_q_points_face
The current quadrature points on a face.
Definition: Assembly.h:745
QBase * _current_qrule_face
quadrature rule used on faces
Definition: Assembly.h:741
void Assembly::computeCurrentNeighborVolume ( )
protected
const Moose::CoordinateSystemType& Assembly::coordSystem ( )
inline

Get the coordinate system type.

Returns
A reference to the coordinate system type

Definition at line 159 of file Assembly.h.

159 { return _coord_type; }
Moose::CoordinateSystemType _coord_type
The coordinate system.
Definition: Assembly.h:720
const MooseArray<Real>& Assembly::coordTransformation ( )
inline

Returns the reference to the coordinate transformation coefficients.

Returns
A reference. Make sure to store this as a reference!

Definition at line 153 of file Assembly.h.

153 { return _coord; }
MooseArray< Real > _coord
The current coordinate transformation coefficients.
Definition: Assembly.h:722
void Assembly::copyFaceShapes ( unsigned int  var)

Definition at line 1238 of file Assembly.C.

1239 {
1240  MooseVariable & v = _sys.getVariable(_tid, var);
1241 
1244 
1245  if (v.computingSecond())
1247 }
VariablePhiSecond _second_phi_face
Definition: Assembly.h:843
const VariablePhiValue & phiFace()
SystemBase & _sys
Definition: Assembly.h:667
const VariablePhiSecond & secondPhiFace()
Class for stuff related to variables.
Definition: MooseVariable.h:43
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
void shallowCopy(const MooseArray &rhs)
Doesn&#39;t actually make a copy of the data.
Definition: MooseArray.h:284
virtual MooseVariable & getVariable(THREAD_ID tid, const std::string &var_name)
Gets a reference to a variable of with specified name.
Definition: SystemBase.C:103
VariablePhiValue _phi_face
Definition: Assembly.h:841
bool computingSecond()
Whether or not this variable is computing any second derivatives.
const VariablePhiGradient & gradPhiFace()
VariablePhiGradient _grad_phi_face
Definition: Assembly.h:842
void Assembly::copyNeighborShapes ( unsigned int  var)

Definition at line 1250 of file Assembly.C.

1251 {
1252  MooseVariable & v = _sys.getVariable(_tid, var);
1253 
1254  if (v.usesPhi())
1256  if (v.usesGradPhi())
1258  if (v.usesSecondPhi())
1260 
1261  if (v.usesPhi())
1263  if (v.usesGradPhi())
1265  if (v.usesSecondPhi())
1267 }
VariablePhiSecond _second_phi_face_neighbor
Definition: Assembly.h:851
bool usesPhi()
Whether or not this variable is actually using the shape function value.
SystemBase & _sys
Definition: Assembly.h:667
Class for stuff related to variables.
Definition: MooseVariable.h:43
const VariablePhiValue & phiNeighbor()
VariablePhiSecond _second_phi_neighbor
Definition: Assembly.h:847
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
void shallowCopy(const MooseArray &rhs)
Doesn&#39;t actually make a copy of the data.
Definition: MooseArray.h:284
bool usesSecondPhi()
Whether or not this variable is actually using the shape function second derivative.
const VariablePhiSecond & secondPhiFaceNeighbor()
virtual MooseVariable & getVariable(THREAD_ID tid, const std::string &var_name)
Gets a reference to a variable of with specified name.
Definition: SystemBase.C:103
VariablePhiGradient _grad_phi_face_neighbor
Definition: Assembly.h:850
VariablePhiGradient _grad_phi_neighbor
Definition: Assembly.h:846
VariablePhiValue _phi_face_neighbor
Definition: Assembly.h:849
VariablePhiValue _phi_neighbor
Definition: Assembly.h:845
const VariablePhiGradient & gradPhiFaceNeighbor()
const VariablePhiSecond & secondPhiNeighbor()
bool usesGradPhi()
Whether or not this variable is actually using the shape function gradient.
const VariablePhiValue & phiFaceNeighbor()
const VariablePhiGradient & gradPhiNeighbor()
void Assembly::copyShapes ( unsigned int  var)

Definition at line 1226 of file Assembly.C.

1227 {
1228  MooseVariable & v = _sys.getVariable(_tid, var);
1229 
1230  _phi.shallowCopy(v.phi());
1232 
1233  if (v.computingSecond())
1235 }
SystemBase & _sys
Definition: Assembly.h:667
Class for stuff related to variables.
Definition: MooseVariable.h:43
VariablePhiGradient _grad_phi
Definition: Assembly.h:838
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
void shallowCopy(const MooseArray &rhs)
Doesn&#39;t actually make a copy of the data.
Definition: MooseArray.h:284
VariablePhiValue _phi
Definition: Assembly.h:837
virtual MooseVariable & getVariable(THREAD_ID tid, const std::string &var_name)
Gets a reference to a variable of with specified name.
Definition: SystemBase.C:103
const VariablePhiSecond & secondPhi()
const VariablePhiValue & phi()
const VariablePhiGradient & gradPhi()
bool computingSecond()
Whether or not this variable is computing any second derivatives.
VariablePhiSecond _second_phi
Definition: Assembly.h:839
std::vector<std::pair<MooseVariable *, MooseVariable *> >& Assembly::couplingEntries ( )
inline

Definition at line 528 of file Assembly.h.

528 { return _cm_entry; }
std::vector< std::pair< MooseVariable *, MooseVariable * > > _cm_entry
Entries in the coupling matrix (only for field variables)
Definition: Assembly.h:673
void Assembly::createQRules ( QuadratureType  type,
Order  order,
Order  volume_order,
Order  face_order 
)

Creates the volume, face and arbitrary qrules based on the orders passed in.

Definition at line 360 of file Assembly.C.

361 {
362  _holder_qrule_volume.clear();
363  for (unsigned int dim = 0; dim <= _mesh_dimension; dim++)
364  _holder_qrule_volume[dim] = QBase::build(type, dim, volume_order).release();
365 
366  _holder_qrule_face.clear();
367  for (unsigned int dim = 0; dim <= _mesh_dimension; dim++)
368  _holder_qrule_face[dim] = QBase::build(type, dim - 1, face_order).release();
369 
370  _holder_qrule_neighbor.clear();
371  for (unsigned int dim = 0; dim <= _mesh_dimension; dim++)
372  _holder_qrule_neighbor[dim] = new ArbitraryQuadrature(dim, face_order);
373 
374  _holder_qrule_arbitrary.clear();
375  for (unsigned int dim = 0; dim <= _mesh_dimension; dim++)
376  _holder_qrule_arbitrary[dim] = new ArbitraryQuadrature(dim, order);
377 }
std::map< unsigned int, ArbitraryQuadrature * > _holder_qrule_neighbor
Holds arbitrary qrules for each dimension.
Definition: Assembly.h:773
unsigned int _mesh_dimension
Definition: Assembly.h:687
std::map< unsigned int, QBase * > _holder_qrule_face
Holds face qrules for each dimension.
Definition: Assembly.h:751
Implements a fake quadrature rule where you can specify the locations (in the reference domain) of th...
std::map< unsigned int, ArbitraryQuadrature * > _holder_qrule_arbitrary
Holds arbitrary qrules for each dimension.
Definition: Assembly.h:726
MatType type
std::map< unsigned int, QBase * > _holder_qrule_volume
Holds volume qrules for each dimension.
Definition: Assembly.h:724
const SubdomainID& Assembly::currentNeighborSubdomainID ( ) const
inline

Return the current subdomain ID.

Definition at line 240 of file Assembly.h.

SubdomainID _current_neighbor_subdomain_id
The current neighbor subdomain ID.
Definition: Assembly.h:794
const SubdomainID& Assembly::currentSubdomainID ( ) const
inline

Return the current subdomain ID.

Definition at line 194 of file Assembly.h.

194 { return _current_subdomain_id; }
SubdomainID _current_subdomain_id
The current subdomain ID.
Definition: Assembly.h:782
const Elem*& Assembly::elem ( )
inline

Return the current element.

Returns
A reference. Make sure to store this as a reference!

Definition at line 189 of file Assembly.h.

Referenced by reinit(), and reinitAtPhysical().

189 { return _current_elem; }
const Elem * _current_elem
The current "element" we are currently on.
Definition: Assembly.h:780
const Real& Assembly::elemVolume ( )
inline

Returns the reference to the current element volume.

Returns
A reference. Make sure to store this as a reference!

Definition at line 205 of file Assembly.h.

205 { return _current_elem_volume; }
Real _current_elem_volume
Volume of the current element.
Definition: Assembly.h:784
const VariablePhiGradient & Assembly::feGradPhi ( FEType  type)

Definition at line 272 of file Assembly.C.

273 {
274  buildFE(type);
275  return _fe_shape_data[type]->_grad_phi;
276 }
void buildFE(FEType type)
Build FEs with a type.
Definition: Assembly.C:168
MatType type
std::map< FEType, FEShapeData * > _fe_shape_data
Definition: Assembly.h:896
const VariablePhiGradient & Assembly::feGradPhiFace ( FEType  type)

Definition at line 294 of file Assembly.C.

295 {
296  buildFaceFE(type);
297  return _fe_shape_data_face[type]->_grad_phi;
298 }
void buildFaceFE(FEType type)
Build FEs for a face with a type.
Definition: Assembly.C:190
MatType type
std::map< FEType, FEShapeData * > _fe_shape_data_face
Definition: Assembly.h:897
const VariablePhiGradient & Assembly::feGradPhiFaceNeighbor ( FEType  type)

Definition at line 338 of file Assembly.C.

339 {
341  return _fe_shape_data_face_neighbor[type]->_grad_phi;
342 }
std::map< FEType, FEShapeData * > _fe_shape_data_face_neighbor
Definition: Assembly.h:899
void buildFaceNeighborFE(FEType type)
Build FEs for a neighbor face with a type.
Definition: Assembly.C:226
MatType type
const VariablePhiGradient & Assembly::feGradPhiNeighbor ( FEType  type)

Definition at line 316 of file Assembly.C.

317 {
319  return _fe_shape_data_neighbor[type]->_grad_phi;
320 }
void buildNeighborFE(FEType type)
Build FEs for a neighbor with a type.
Definition: Assembly.C:208
std::map< FEType, FEShapeData * > _fe_shape_data_neighbor
Definition: Assembly.h:898
MatType type
const VariablePhiValue & Assembly::fePhi ( FEType  type)

Definition at line 265 of file Assembly.C.

266 {
267  buildFE(type);
268  return _fe_shape_data[type]->_phi;
269 }
void buildFE(FEType type)
Build FEs with a type.
Definition: Assembly.C:168
MatType type
std::map< FEType, FEShapeData * > _fe_shape_data
Definition: Assembly.h:896
const VariablePhiValue & Assembly::fePhiFace ( FEType  type)

Definition at line 287 of file Assembly.C.

288 {
289  buildFaceFE(type);
290  return _fe_shape_data_face[type]->_phi;
291 }
void buildFaceFE(FEType type)
Build FEs for a face with a type.
Definition: Assembly.C:190
MatType type
std::map< FEType, FEShapeData * > _fe_shape_data_face
Definition: Assembly.h:897
const VariablePhiValue & Assembly::fePhiFaceNeighbor ( FEType  type)

Definition at line 331 of file Assembly.C.

332 {
334  return _fe_shape_data_face_neighbor[type]->_phi;
335 }
std::map< FEType, FEShapeData * > _fe_shape_data_face_neighbor
Definition: Assembly.h:899
void buildFaceNeighborFE(FEType type)
Build FEs for a neighbor face with a type.
Definition: Assembly.C:226
MatType type
const VariablePhiValue & Assembly::fePhiNeighbor ( FEType  type)

Definition at line 309 of file Assembly.C.

310 {
312  return _fe_shape_data_neighbor[type]->_phi;
313 }
void buildNeighborFE(FEType type)
Build FEs for a neighbor with a type.
Definition: Assembly.C:208
std::map< FEType, FEShapeData * > _fe_shape_data_neighbor
Definition: Assembly.h:898
MatType type
const VariablePhiSecond & Assembly::feSecondPhi ( FEType  type)

Definition at line 279 of file Assembly.C.

Referenced by MooseVariable::secondPhi().

280 {
282  buildFE(type);
283  return _fe_shape_data[type]->_second_phi;
284 }
std::map< FEType, bool > _need_second_derivative
Definition: Assembly.h:571
void buildFE(FEType type)
Build FEs with a type.
Definition: Assembly.C:168
MatType type
std::map< FEType, FEShapeData * > _fe_shape_data
Definition: Assembly.h:896
const VariablePhiSecond & Assembly::feSecondPhiFace ( FEType  type)

Definition at line 301 of file Assembly.C.

Referenced by MooseVariable::secondPhiFace().

302 {
304  buildFaceFE(type);
305  return _fe_shape_data_face[type]->_second_phi;
306 }
std::map< FEType, bool > _need_second_derivative
Definition: Assembly.h:571
void buildFaceFE(FEType type)
Build FEs for a face with a type.
Definition: Assembly.C:190
MatType type
std::map< FEType, FEShapeData * > _fe_shape_data_face
Definition: Assembly.h:897
const VariablePhiSecond & Assembly::feSecondPhiFaceNeighbor ( FEType  type)

Definition at line 345 of file Assembly.C.

Referenced by MooseVariable::secondPhiFaceNeighbor().

346 {
349  return _fe_shape_data_face_neighbor[type]->_second_phi;
350 }
std::map< FEType, bool > _need_second_derivative
Definition: Assembly.h:571
std::map< FEType, FEShapeData * > _fe_shape_data_face_neighbor
Definition: Assembly.h:899
void buildFaceNeighborFE(FEType type)
Build FEs for a neighbor face with a type.
Definition: Assembly.C:226
MatType type
const VariablePhiSecond & Assembly::feSecondPhiNeighbor ( FEType  type)

Definition at line 323 of file Assembly.C.

Referenced by MooseVariable::secondPhiNeighbor().

324 {
327  return _fe_shape_data_neighbor[type]->_second_phi;
328 }
void buildNeighborFE(FEType type)
Build FEs for a neighbor with a type.
Definition: Assembly.C:208
std::map< FEType, bool > _need_second_derivative
Definition: Assembly.h:571
std::map< FEType, FEShapeData * > _fe_shape_data_neighbor
Definition: Assembly.h:898
MatType type
FEBase *& Assembly::getFE ( FEType  type,
unsigned int  dim 
)

Get a reference to a pointer that will contain the current volume FE.

Parameters
typeThe type of FE
dimThe dimension of the current volume
Returns
A reference to the pointer. Make sure to store this as a reference!

Definition at line 244 of file Assembly.C.

Referenced by FaceFaceConstraint::computeJacobian(), MooseVariable::MooseVariable(), and FaceFaceConstraint::reinit().

245 {
246  buildFE(type);
247  return _fe[dim][type];
248 }
void buildFE(FEType type)
Build FEs with a type.
Definition: Assembly.C:168
std::map< unsigned int, std::map< FEType, FEBase * > > _fe
Each dimension&#39;s actual fe objects indexed on type.
Definition: Assembly.h:704
MatType type
FEBase *& Assembly::getFEFace ( FEType  type,
unsigned int  dim 
)

Get a reference to a pointer that will contain the current "face" FE.

Parameters
typeThe type of FE
dimThe dimension of the current face
Returns
A reference to the pointer. Make sure to store this as a reference!

Definition at line 251 of file Assembly.C.

252 {
253  buildFaceFE(type);
254  return _fe_face[dim][type];
255 }
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face
types of finite elements
Definition: Assembly.h:735
void buildFaceFE(FEType type)
Build FEs for a face with a type.
Definition: Assembly.C:190
MatType type
FEBase *& Assembly::getFEFaceNeighbor ( FEType  type,
unsigned int  dim 
)

Get a reference to a pointer that will contain the current "neighbor" FE.

Parameters
typeThe type of FE
dimThe dimension of the neighbor face
Returns
A reference to the pointer. Make sure to store this as a reference!

Definition at line 258 of file Assembly.C.

259 {
261  return _fe_neighbor[dim][type];
262 }
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_neighbor
types of finite elements
Definition: Assembly.h:764
void buildFaceNeighborFE(FEType type)
Build FEs for a neighbor face with a type.
Definition: Assembly.C:226
MatType type
FEBase*& Assembly::getFENeighbor ( FEType  type,
unsigned int  dim 
)

Get a reference to a pointer that will contain the current 'neighbor' FE.

Parameters
typeThe type of FE
dimThe dimension of the current volume
Returns
A reference to the pointer. Make sure to store this as a reference!
const VariablePhiGradient& Assembly::gradPhi ( )
inline

Definition at line 535 of file Assembly.h.

535 { return _grad_phi; }
VariablePhiGradient _grad_phi
Definition: Assembly.h:838
const VariablePhiGradient& Assembly::gradPhiFace ( )
inline

Definition at line 539 of file Assembly.h.

539 { return _grad_phi_face; }
VariablePhiGradient _grad_phi_face
Definition: Assembly.h:842
const VariablePhiGradient& Assembly::gradPhiFaceNeighbor ( )
inline

Definition at line 547 of file Assembly.h.

547 { return _grad_phi_face_neighbor; }
VariablePhiGradient _grad_phi_face_neighbor
Definition: Assembly.h:850
const VariablePhiGradient& Assembly::gradPhiNeighbor ( )
inline

Definition at line 543 of file Assembly.h.

543 { return _grad_phi_neighbor; }
VariablePhiGradient _grad_phi_neighbor
Definition: Assembly.h:846
void Assembly::init ( const CouplingMatrix *  cm)

Initialize the Assembly object and set the CouplingMatrix for use throughout.

Definition at line 937 of file Assembly.C.

938 {
939  _cm = cm;
940 
941  unsigned int n_vars = _sys.nVariables();
942 
943  // I want the blocks to go by columns first to reduce copying of shape function in assembling
944  // "full" Jacobian
945  _cm_entry.clear();
946  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
947  for (const auto & jvar : vars)
948  {
949  unsigned int j = jvar->number();
950  for (const auto & ivar : vars)
951  {
952  unsigned int i = ivar->number();
953  if ((*_cm)(i, j) != 0)
954  _cm_entry.push_back(std::make_pair(ivar, jvar));
955  }
956  }
957 
958  unsigned int max_rows_per_column = 0; // If this is 1 then we are using a block-diagonal
959  // preconditioner and we can save a bunch of memory.
960  for (unsigned int i = 0; i < n_vars; i++)
961  {
962  unsigned int max_rows_per_this_column = 0;
963  for (unsigned int j = 0; j < n_vars; j++)
964  {
965  if ((*_cm)(i, j) != 0)
966  max_rows_per_this_column++;
967  }
968  max_rows_per_column = std::max(max_rows_per_column, max_rows_per_this_column);
969  }
970 
971  if (max_rows_per_column == 1 && _sys.getScalarVariables(_tid).size() == 0)
972  _block_diagonal_matrix = true;
973 
974  // two vectors: one for time residual contributions and one for non-time residual contributions
975  _sub_Re.resize(2);
976  _sub_Rn.resize(2);
977  for (unsigned int i = 0; i < _sub_Re.size(); i++)
978  {
979  _sub_Re[i].resize(n_vars);
980  _sub_Rn[i].resize(n_vars);
981  }
982 
983  _sub_Kee.resize(n_vars);
984  _sub_Keg.resize(n_vars);
985  _sub_Ken.resize(n_vars);
986  _sub_Kne.resize(n_vars);
987  _sub_Knn.resize(n_vars);
988  _jacobian_block_used.resize(n_vars);
989  _jacobian_block_nonlocal_used.resize(n_vars);
990  _jacobian_block_neighbor_used.resize(n_vars);
991 
992  for (unsigned int i = 0; i < n_vars; ++i)
993  {
995  {
996  _sub_Kee[i].resize(n_vars);
997  _sub_Keg[i].resize(n_vars);
998  _sub_Ken[i].resize(n_vars);
999  _sub_Kne[i].resize(n_vars);
1000  _sub_Knn[i].resize(n_vars);
1001  }
1002  else
1003  {
1004  _sub_Kee[i].resize(1);
1005  _sub_Keg[i].resize(1);
1006  _sub_Ken[i].resize(1);
1007  _sub_Kne[i].resize(1);
1008  _sub_Knn[i].resize(1);
1009  }
1010  _jacobian_block_used[i].resize(n_vars);
1011  _jacobian_block_nonlocal_used[i].resize(n_vars);
1012  _jacobian_block_neighbor_used[i].resize(n_vars);
1013  }
1014 }
SystemBase & _sys
Definition: Assembly.h:667
std::vector< std::vector< unsigned char > > _jacobian_block_nonlocal_used
Definition: Assembly.h:677
const std::vector< MooseVariableScalar * > & getScalarVariables(THREAD_ID tid)
Definition: SystemBase.h:422
std::vector< std::pair< MooseVariable *, MooseVariable * > > _cm_entry
Entries in the coupling matrix (only for field variables)
Definition: Assembly.h:673
std::vector< std::vector< DenseVector< Number > > > _sub_Rn
residual contributions for each variable from the neighbor
Definition: Assembly.h:818
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
unsigned int _block_diagonal_matrix
Will be true if our preconditioning matrix is a block-diagonal matrix. Which means that we can take s...
Definition: Assembly.h:919
const CouplingMatrix * _cm
Coupling matrices.
Definition: Assembly.h:670
std::vector< std::vector< DenseMatrix< Number > > > _sub_Kee
jacobian contributions
Definition: Assembly.h:823
std::vector< std::vector< DenseMatrix< Number > > > _sub_Kne
jacobian contributions from the neighbor and element
Definition: Assembly.h:829
std::vector< std::vector< DenseVector< Number > > > _sub_Re
residual contributions for each variable from the element
Definition: Assembly.h:816
std::vector< std::vector< DenseMatrix< Number > > > _sub_Knn
jacobian contributions from the neighbor
Definition: Assembly.h:831
std::vector< std::vector< DenseMatrix< Number > > > _sub_Ken
jacobian contributions from the element and neighbor
Definition: Assembly.h:827
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
std::vector< std::vector< DenseMatrix< Number > > > _sub_Keg
Definition: Assembly.h:824
std::vector< std::vector< unsigned char > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition: Assembly.h:676
std::vector< std::vector< unsigned char > > _jacobian_block_neighbor_used
Flag that indicates if the jacobian block for neighbor was used.
Definition: Assembly.h:679
virtual unsigned int nVariables()
Get the number of variables in this system.
Definition: SystemBase.C:580
void Assembly::init ( )

Deprecated init method.

void Assembly::initNonlocalCoupling ( )

Create pair of variables requiring nonlocal jacobian contributions.

Definition at line 1017 of file Assembly.C.

1018 {
1019  _cm_nonlocal_entry.clear();
1020  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1021  for (const auto & jvar : vars)
1022  {
1023  unsigned int j = jvar->number();
1024  for (const auto & ivar : vars)
1025  {
1026  unsigned int i = ivar->number();
1027  if (_nonlocal_cm(i, j) != 0)
1028  _cm_nonlocal_entry.push_back(std::make_pair(ivar, jvar));
1029  }
1030  }
1031 }
SystemBase & _sys
Definition: Assembly.h:667
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
const CouplingMatrix & _nonlocal_cm
Definition: Assembly.h:671
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
std::vector< std::pair< MooseVariable *, MooseVariable * > > _cm_nonlocal_entry
Definition: Assembly.h:674
void Assembly::invalidateCache ( )

Invalidate any currently cached data.

In particular this will cause FE data to get recached.

Definition at line 410 of file Assembly.C.

411 {
412  for (auto & it : _element_fe_shape_data_cache)
413  it.second->_invalidated = true;
414 }
std::map< dof_id_type, ElementFEShapeData * > _element_fe_shape_data_cache
Cached shape function values stored by element.
Definition: Assembly.h:887
DenseMatrix< Number > & Assembly::jacobianBlock ( unsigned int  ivar,
unsigned int  jvar 
)

Definition at line 887 of file Assembly.C.

Referenced by addJacobian(), addJacobianBlock(), addJacobianNeighbor(), addJacobianOffDiagScalar(), addJacobianScalar(), cacheJacobian(), ElemElemConstraint::computeElemNeighJacobian(), InterfaceKernel::computeElemNeighJacobian(), DGKernel::computeElemNeighJacobian(), MassLumpedTimeDerivative::computeJacobian(), TimeDerivative::computeJacobian(), Kernel::computeJacobian(), ODEKernel::computeJacobian(), EigenKernel::computeJacobian(), NodalEqualValueConstraint::computeJacobian(), IntegratedBC::computeJacobian(), NonlocalKernel::computeJacobian(), NonlocalIntegratedBC::computeJacobian(), KernelGrad::computeJacobian(), KernelValue::computeJacobian(), FaceFaceConstraint::computeJacobian(), DiracKernel::computeJacobian(), NonlocalIntegratedBC::computeJacobianBlock(), IntegratedBC::computeJacobianBlock(), IntegratedBC::computeJacobianBlockScalar(), FaceFaceConstraint::computeJacobianSide(), InterfaceKernel::computeOffDiagElemNeighJacobian(), DGKernel::computeOffDiagElemNeighJacobian(), Kernel::computeOffDiagJacobian(), FDKernel::computeOffDiagJacobian(), ODEKernel::computeOffDiagJacobian(), EigenKernel::computeOffDiagJacobian(), NonlocalKernel::computeOffDiagJacobian(), KernelValue::computeOffDiagJacobian(), KernelGrad::computeOffDiagJacobian(), DiracKernel::computeOffDiagJacobian(), Kernel::computeOffDiagJacobianScalar(), prepare(), prepareBlock(), prepareOffDiagScalar(), prepareScalar(), and prepareVariable().

888 {
889  _jacobian_block_used[ivar][jvar] = 1;
890  return _sub_Kee[ivar][_block_diagonal_matrix ? 0 : jvar];
891 }
unsigned int _block_diagonal_matrix
Will be true if our preconditioning matrix is a block-diagonal matrix. Which means that we can take s...
Definition: Assembly.h:919
std::vector< std::vector< DenseMatrix< Number > > > _sub_Kee
jacobian contributions
Definition: Assembly.h:823
std::vector< std::vector< unsigned char > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition: Assembly.h:676
DenseMatrix< Number > & Assembly::jacobianBlockNeighbor ( Moose::DGJacobianType  type,
unsigned int  ivar,
unsigned int  jvar 
)

Definition at line 901 of file Assembly.C.

Referenced by addJacobianNeighbor(), cacheJacobianNeighbor(), ElemElemConstraint::computeElemNeighJacobian(), InterfaceKernel::computeElemNeighJacobian(), DGKernel::computeElemNeighJacobian(), NodeFaceConstraint::computeJacobian(), InterfaceKernel::computeOffDiagElemNeighJacobian(), DGKernel::computeOffDiagElemNeighJacobian(), NodeFaceConstraint::computeOffDiagJacobian(), and prepareNeighbor().

902 {
903  _jacobian_block_neighbor_used[ivar][jvar] = 1;
905  {
906  switch (type)
907  {
908  default:
910  return _sub_Kee[ivar][0];
912  return _sub_Ken[ivar][0];
914  return _sub_Kne[ivar][0];
916  return _sub_Knn[ivar][0];
917  }
918  }
919  else
920  {
921  switch (type)
922  {
923  default:
925  return _sub_Kee[ivar][jvar];
927  return _sub_Ken[ivar][jvar];
929  return _sub_Kne[ivar][jvar];
931  return _sub_Knn[ivar][jvar];
932  }
933  }
934 }
unsigned int _block_diagonal_matrix
Will be true if our preconditioning matrix is a block-diagonal matrix. Which means that we can take s...
Definition: Assembly.h:919
std::vector< std::vector< DenseMatrix< Number > > > _sub_Kee
jacobian contributions
Definition: Assembly.h:823
std::vector< std::vector< DenseMatrix< Number > > > _sub_Kne
jacobian contributions from the neighbor and element
Definition: Assembly.h:829
std::vector< std::vector< DenseMatrix< Number > > > _sub_Knn
jacobian contributions from the neighbor
Definition: Assembly.h:831
std::vector< std::vector< DenseMatrix< Number > > > _sub_Ken
jacobian contributions from the element and neighbor
Definition: Assembly.h:827
MatType type
std::vector< std::vector< unsigned char > > _jacobian_block_neighbor_used
Flag that indicates if the jacobian block for neighbor was used.
Definition: Assembly.h:679
DenseMatrix< Number > & Assembly::jacobianBlockNonlocal ( unsigned int  ivar,
unsigned int  jvar 
)

Definition at line 894 of file Assembly.C.

Referenced by addJacobianBlockNonlocal(), addJacobianNonlocal(), cacheJacobianNonlocal(), NonlocalKernel::computeNonlocalJacobian(), NonlocalIntegratedBC::computeNonlocalJacobian(), NonlocalIntegratedBC::computeNonlocalOffDiagJacobian(), NonlocalKernel::computeNonlocalOffDiagJacobian(), prepareBlockNonlocal(), prepareNonlocal(), and prepareVariableNonlocal().

895 {
896  _jacobian_block_nonlocal_used[ivar][jvar] = 1;
897  return _sub_Keg[ivar][_block_diagonal_matrix ? 0 : jvar];
898 }
std::vector< std::vector< unsigned char > > _jacobian_block_nonlocal_used
Definition: Assembly.h:677
unsigned int _block_diagonal_matrix
Will be true if our preconditioning matrix is a block-diagonal matrix. Which means that we can take s...
Definition: Assembly.h:919
std::vector< std::vector< DenseMatrix< Number > > > _sub_Keg
Definition: Assembly.h:824
const MooseArray<Real>& Assembly::JxW ( )
inline

Returns the reference to the transformed jacobian weights.

Returns
A reference. Make sure to store this as a reference!

Definition at line 147 of file Assembly.h.

Referenced by reinitNeighbor().

147 { return _current_JxW; }
MooseArray< Real > _current_JxW
The current list of transformed jacobian weights.
Definition: Assembly.h:718
const MooseArray<Real>& Assembly::JxWFace ( )
inline

Returns the reference to the transformed jacobian weights on a current face.

Returns
A reference. Make sure to store this as a reference!

Definition at line 177 of file Assembly.h.

177 { return _current_JxW_face; }
MooseArray< Real > _current_JxW_face
The current transformed jacobian weights on a face.
Definition: Assembly.h:747
const MooseArray<Real>& Assembly::JxWNeighbor ( )
inline

Returns the reference to the transformed jacobian weights on a current face.

Returns
A reference. Make sure to store this as a reference!

Definition at line 263 of file Assembly.h.

263 { return _current_JxW_neighbor; }
MooseArray< Real > _current_JxW_neighbor
The current transformed jacobian weights on a neighbor&#39;s face.
Definition: Assembly.h:775
void Assembly::modifyWeightsDueToXFEM ( const Elem *  elem)
protected

Update the integration weights for XFEM partial elements.

This only affects the weights if XFEM is used and if the element is cut.

Parameters
elemThe element for which the weights are adjusted

Definition at line 1970 of file Assembly.C.

Referenced by reinitFE().

1971 {
1972  mooseAssert(_xfem != NULL, "This function should not be called if xfem is inactive");
1973 
1975  return;
1976 
1977  MooseArray<Real> xfem_weight_multipliers;
1978  if (_xfem->getXFEMWeights(xfem_weight_multipliers, elem, _current_qrule, _current_q_points))
1979  {
1980  mooseAssert(xfem_weight_multipliers.size() == _current_JxW.size(),
1981  "Size of weight multipliers in xfem doesn't match number of quadrature points");
1982  for (unsigned i = 0; i < xfem_weight_multipliers.size(); i++)
1983  {
1984  _current_JxW[i] = _current_JxW[i] * xfem_weight_multipliers[i];
1985  }
1986  xfem_weight_multipliers.release();
1987  }
1988 }
ArbitraryQuadrature * _current_qrule_arbitrary
The current arbitrary quadrature rule used within the element interior.
Definition: Assembly.h:714
QBase * _current_qrule
The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac k...
Definition: Assembly.h:710
std::shared_ptr< XFEMInterface > _xfem
The XFEM controller.
Definition: Assembly.h:690
MooseArray< Real > _current_JxW
The current list of transformed jacobian weights.
Definition: Assembly.h:718
const Elem *& elem()
Return the current element.
Definition: Assembly.h:189
unsigned int size() const
The number of elements that can currently be stored in the array.
Definition: MooseArray.h:250
void release()
Manually deallocates the data pointer.
Definition: MooseArray.h:56
MooseArray< Point > _current_q_points
The current list of quadrature points.
Definition: Assembly.h:716
const Elem*& Assembly::neighbor ( )
inline

Return the neighbor element.

Returns
A reference. Make sure to store this as a reference!

Definition at line 235 of file Assembly.h.

Referenced by reinitNeighbor().

235 { return _current_neighbor_elem; }
const Elem * _current_neighbor_elem
The current neighbor "element".
Definition: Assembly.h:792
unsigned int& Assembly::neighborSide ( )
inline

Returns the current neighboring side.

Returns
A reference. Make sure to store this as a reference!

Definition at line 217 of file Assembly.h.

217 { return _current_neighbor_side; }
unsigned int _current_neighbor_side
The current side of the selected neighboring element (valid only when working with sides) ...
Definition: Assembly.h:796
const Real & Assembly::neighborVolume ( )

Returns the reference to the current neighbor volume.

Returns
A reference. Make sure to store this as a reference!

Definition at line 353 of file Assembly.C.

Referenced by InternalSideUserObject::getNeighborElemVolume(), InterfaceKernel::getNeighborElemVolume(), and DGKernel::getNeighborElemVolume().

354 {
357 }
bool _need_neighbor_elem_volume
true is apps need to compute neighbor element volume
Definition: Assembly.h:800
Real _current_neighbor_volume
Volume of the current neighbor.
Definition: Assembly.h:802
const Node*& Assembly::node ( )
inline

Returns the reference to the node.

Returns
A reference. Make sure to store this as a reference!

Definition at line 269 of file Assembly.h.

Referenced by reinit(), and reinitNodeNeighbor().

269 { return _current_node; }
const Node * _current_node
The current node we are working with.
Definition: Assembly.h:804
const Node*& Assembly::nodeNeighbor ( )
inline

Returns the reference to the neighboring node.

Returns
A reference. Make sure to store this as a reference!

Definition at line 275 of file Assembly.h.

275 { return _current_neighbor_node; }
const Node * _current_neighbor_node
The current neighboring node we are working with.
Definition: Assembly.h:806
std::vector<std::pair<MooseVariable *, MooseVariable *> >& Assembly::nonlocalCouplingEntries ( )
inline

Definition at line 529 of file Assembly.h.

530  {
531  return _cm_nonlocal_entry;
532  }
std::vector< std::pair< MooseVariable *, MooseVariable * > > _cm_nonlocal_entry
Definition: Assembly.h:674
const MooseArray<Point>& Assembly::normals ( )
inline

Returns the array of normals for quadrature points on a current side.

Returns
A reference. Make sure to store this as a reference!

Definition at line 183 of file Assembly.h.

183 { return _current_normals; }
MooseArray< Point > _current_normals
The current Normal vectors at the quadrature points.
Definition: Assembly.h:749
const VariablePhiValue& Assembly::phi ( )
inline

Definition at line 534 of file Assembly.h.

534 { return _phi; }
VariablePhiValue _phi
Definition: Assembly.h:837
const VariablePhiValue& Assembly::phiFace ( )
inline

Definition at line 538 of file Assembly.h.

538 { return _phi_face; }
VariablePhiValue _phi_face
Definition: Assembly.h:841
const VariablePhiValue& Assembly::phiFaceNeighbor ( )
inline

Definition at line 546 of file Assembly.h.

546 { return _phi_face_neighbor; }
VariablePhiValue _phi_face_neighbor
Definition: Assembly.h:849
const VariablePhiValue& Assembly::phiNeighbor ( )
inline

Definition at line 542 of file Assembly.h.

542 { return _phi_neighbor; }
VariablePhiValue _phi_neighbor
Definition: Assembly.h:845
const MooseArray<Point>& Assembly::physicalPoints ( )
inline

The current points in physical space where we have reinited through reinitAtPhysical()

Returns
A reference. Make sure to store this as a reference!

Definition at line 141 of file Assembly.h.

141 { return _current_physical_points; }
MooseArray< Point > _current_physical_points
This will be filled up with the physical points passed into reinitAtPhysical() if it is called...
Definition: Assembly.h:813
void Assembly::prepare ( )

Definition at line 1034 of file Assembly.C.

Referenced by FaceFaceConstraint::reinitSide().

1035 {
1036  for (const auto & it : _cm_entry)
1037  {
1038  MooseVariable & ivar = *(it.first);
1039  MooseVariable & jvar = *(it.second);
1040 
1041  unsigned int vi = ivar.number();
1042  unsigned int vj = jvar.number();
1043 
1044  jacobianBlock(vi, vj).resize(ivar.dofIndices().size(), jvar.dofIndices().size());
1045  jacobianBlock(vi, vj).zero();
1046  _jacobian_block_used[vi][vj] = 0;
1047  }
1048 
1049  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1050  for (const auto & var : vars)
1051  for (unsigned int i = 0; i < _sub_Re.size(); i++)
1052  {
1053  _sub_Re[i][var->number()].resize(var->dofIndices().size());
1054  _sub_Re[i][var->number()].zero();
1055  }
1056 }
SystemBase & _sys
Definition: Assembly.h:667
Class for stuff related to variables.
Definition: MooseVariable.h:43
std::vector< std::pair< MooseVariable *, MooseVariable * > > _cm_entry
Entries in the coupling matrix (only for field variables)
Definition: Assembly.h:673
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
std::vector< std::vector< DenseVector< Number > > > _sub_Re
residual contributions for each variable from the element
Definition: Assembly.h:816
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
unsigned int number() const
Get variable number coming from libMesh.
std::vector< dof_id_type > & dofIndices()
std::vector< std::vector< unsigned char > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition: Assembly.h:676
DenseMatrix< Number > & jacobianBlock(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:887
void Assembly::prepareBlock ( unsigned int  ivar,
unsigned  jvar,
const std::vector< dof_id_type > &  dof_indices 
)

Definition at line 1149 of file Assembly.C.

1152 {
1153  jacobianBlock(ivar, jvar).resize(dof_indices.size(), dof_indices.size());
1154  jacobianBlock(ivar, jvar).zero();
1155  _jacobian_block_used[ivar][jvar] = 0;
1156 
1157  for (unsigned int i = 0; i < _sub_Re.size(); i++)
1158  {
1159  _sub_Re[i][ivar].resize(dof_indices.size());
1160  _sub_Re[i][ivar].zero();
1161  }
1162 }
std::vector< std::vector< DenseVector< Number > > > _sub_Re
residual contributions for each variable from the element
Definition: Assembly.h:816
std::vector< std::vector< unsigned char > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition: Assembly.h:676
DenseMatrix< Number > & jacobianBlock(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:887
void Assembly::prepareBlockNonlocal ( unsigned int  ivar,
unsigned  jvar,
const std::vector< dof_id_type > &  idof_indices,
const std::vector< dof_id_type > &  jdof_indices 
)

Definition at line 1165 of file Assembly.C.

1169 {
1170  jacobianBlockNonlocal(ivar, jvar).resize(idof_indices.size(), jdof_indices.size());
1171  jacobianBlockNonlocal(ivar, jvar).zero();
1172  _jacobian_block_nonlocal_used[ivar][jvar] = 0;
1173 }
std::vector< std::vector< unsigned char > > _jacobian_block_nonlocal_used
Definition: Assembly.h:677
DenseMatrix< Number > & jacobianBlockNonlocal(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:894
void Assembly::prepareNeighbor ( )

Definition at line 1114 of file Assembly.C.

1115 {
1116  for (const auto & it : _cm_entry)
1117  {
1118  MooseVariable & ivar = *(it.first);
1119  MooseVariable & jvar = *(it.second);
1120 
1121  unsigned int vi = ivar.number();
1122  unsigned int vj = jvar.number();
1123 
1125  .resize(ivar.dofIndices().size(), jvar.dofIndicesNeighbor().size());
1127 
1129  .resize(ivar.dofIndicesNeighbor().size(), jvar.dofIndices().size());
1131 
1133  .resize(ivar.dofIndicesNeighbor().size(), jvar.dofIndicesNeighbor().size());
1135 
1136  _jacobian_block_neighbor_used[vi][vj] = 0;
1137  }
1138 
1139  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1140  for (const auto & var : vars)
1141  for (unsigned int i = 0; i < _sub_Rn.size(); i++)
1142  {
1143  _sub_Rn[i][var->number()].resize(var->dofIndicesNeighbor().size());
1144  _sub_Rn[i][var->number()].zero();
1145  }
1146 }
SystemBase & _sys
Definition: Assembly.h:667
Class for stuff related to variables.
Definition: MooseVariable.h:43
std::vector< std::pair< MooseVariable *, MooseVariable * > > _cm_entry
Entries in the coupling matrix (only for field variables)
Definition: Assembly.h:673
std::vector< std::vector< DenseVector< Number > > > _sub_Rn
residual contributions for each variable from the neighbor
Definition: Assembly.h:818
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
std::vector< dof_id_type > & dofIndicesNeighbor()
Get DOF indices for currently selected element.
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
unsigned int number() const
Get variable number coming from libMesh.
std::vector< dof_id_type > & dofIndices()
std::vector< std::vector< unsigned char > > _jacobian_block_neighbor_used
Flag that indicates if the jacobian block for neighbor was used.
Definition: Assembly.h:679
DenseMatrix< Number > & jacobianBlockNeighbor(Moose::DGJacobianType type, unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:901
void Assembly::prepareNonlocal ( )

Definition at line 1059 of file Assembly.C.

1060 {
1061  for (const auto & it : _cm_nonlocal_entry)
1062  {
1063  MooseVariable & ivar = *(it.first);
1064  MooseVariable & jvar = *(it.second);
1065 
1066  unsigned int vi = ivar.number();
1067  unsigned int vj = jvar.number();
1068 
1069  jacobianBlockNonlocal(vi, vj).resize(ivar.dofIndices().size(), jvar.allDofIndices().size());
1070  jacobianBlockNonlocal(vi, vj).zero();
1071  _jacobian_block_nonlocal_used[vi][vj] = 0;
1072  }
1073 }
const std::vector< dof_id_type > & allDofIndices() const
Get all global dofindices for the variable.
std::vector< std::vector< unsigned char > > _jacobian_block_nonlocal_used
Definition: Assembly.h:677
Class for stuff related to variables.
Definition: MooseVariable.h:43
unsigned int number() const
Get variable number coming from libMesh.
std::vector< std::pair< MooseVariable *, MooseVariable * > > _cm_nonlocal_entry
Definition: Assembly.h:674
std::vector< dof_id_type > & dofIndices()
DenseMatrix< Number > & jacobianBlockNonlocal(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:894
void Assembly::prepareOffDiagScalar ( )

Definition at line 1201 of file Assembly.C.

Referenced by NodalScalarKernel::reinit().

1202 {
1203  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1204  const std::vector<MooseVariableScalar *> & scalar_vars = _sys.getScalarVariables(_tid);
1205 
1206  for (const auto & ivar : scalar_vars)
1207  {
1208  unsigned int idofs = ivar->dofIndices().size();
1209 
1210  for (const auto & jvar : vars)
1211  {
1212  unsigned int jdofs = jvar->dofIndices().size();
1213 
1214  jacobianBlock(ivar->number(), jvar->number()).resize(idofs, jdofs);
1215  jacobianBlock(ivar->number(), jvar->number()).zero();
1216  _jacobian_block_used[ivar->number()][jvar->number()] = 0;
1217 
1218  jacobianBlock(jvar->number(), ivar->number()).resize(jdofs, idofs);
1219  jacobianBlock(jvar->number(), ivar->number()).zero();
1220  _jacobian_block_used[jvar->number()][ivar->number()] = 0;
1221  }
1222  }
1223 }
SystemBase & _sys
Definition: Assembly.h:667
const std::vector< MooseVariableScalar * > & getScalarVariables(THREAD_ID tid)
Definition: SystemBase.h:422
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
std::vector< std::vector< unsigned char > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition: Assembly.h:676
DenseMatrix< Number > & jacobianBlock(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:887
void Assembly::prepareScalar ( )

Definition at line 1176 of file Assembly.C.

1177 {
1178  const std::vector<MooseVariableScalar *> & vars = _sys.getScalarVariables(_tid);
1179  for (const auto & ivar : vars)
1180  {
1181  unsigned int idofs = ivar->dofIndices().size();
1182 
1183  for (unsigned int i = 0; i < _sub_Re.size(); i++)
1184  {
1185  _sub_Re[i][ivar->number()].resize(idofs);
1186  _sub_Re[i][ivar->number()].zero();
1187  }
1188 
1189  for (const auto & jvar : vars)
1190  {
1191  unsigned int jdofs = jvar->dofIndices().size();
1192 
1193  jacobianBlock(ivar->number(), jvar->number()).resize(idofs, jdofs);
1194  jacobianBlock(ivar->number(), jvar->number()).zero();
1195  _jacobian_block_used[ivar->number()][jvar->number()] = 0;
1196  }
1197  }
1198 }
SystemBase & _sys
Definition: Assembly.h:667
const std::vector< MooseVariableScalar * > & getScalarVariables(THREAD_ID tid)
Definition: SystemBase.h:422
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
std::vector< std::vector< DenseVector< Number > > > _sub_Re
residual contributions for each variable from the element
Definition: Assembly.h:816
std::vector< std::vector< unsigned char > > _jacobian_block_used
Flag that indicates if the jacobian block was used.
Definition: Assembly.h:676
DenseMatrix< Number > & jacobianBlock(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:887
void Assembly::prepareVariable ( MooseVariable var)

Used for preparing the dense residual and jacobian blocks for one particular variable.

Parameters
varThe variable that needs to have its datastructures prepared

Definition at line 1076 of file Assembly.C.

Referenced by SystemBase::prepareFace().

1077 {
1078  for (const auto & it : _cm_entry)
1079  {
1080  MooseVariable & ivar = *(it.first);
1081  MooseVariable & jvar = *(it.second);
1082 
1083  unsigned int vi = ivar.number();
1084  unsigned int vj = jvar.number();
1085 
1086  if (vi == var->number() || vj == var->number())
1087  jacobianBlock(vi, vj).resize(ivar.dofIndices().size(), jvar.dofIndices().size());
1088  }
1089 
1090  for (unsigned int i = 0; i < _sub_Re.size(); i++)
1091  {
1092  _sub_Re[i][var->number()].resize(var->dofIndices().size());
1093  _sub_Re[i][var->number()].zero();
1094  }
1095 }
Class for stuff related to variables.
Definition: MooseVariable.h:43
std::vector< std::pair< MooseVariable *, MooseVariable * > > _cm_entry
Entries in the coupling matrix (only for field variables)
Definition: Assembly.h:673
std::vector< std::vector< DenseVector< Number > > > _sub_Re
residual contributions for each variable from the element
Definition: Assembly.h:816
unsigned int number() const
Get variable number coming from libMesh.
std::vector< dof_id_type > & dofIndices()
DenseMatrix< Number > & jacobianBlock(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:887
void Assembly::prepareVariableNonlocal ( MooseVariable var)

Definition at line 1098 of file Assembly.C.

Referenced by SystemBase::prepareFace().

1099 {
1100  for (const auto & it : _cm_nonlocal_entry)
1101  {
1102  MooseVariable & ivar = *(it.first);
1103  MooseVariable & jvar = *(it.second);
1104 
1105  unsigned int vi = ivar.number();
1106  unsigned int vj = jvar.number();
1107 
1108  if (vi == var->number() || vj == var->number())
1109  jacobianBlockNonlocal(vi, vj).resize(ivar.dofIndices().size(), jvar.allDofIndices().size());
1110  }
1111 }
const std::vector< dof_id_type > & allDofIndices() const
Get all global dofindices for the variable.
Class for stuff related to variables.
Definition: MooseVariable.h:43
unsigned int number() const
Get variable number coming from libMesh.
std::vector< std::pair< MooseVariable *, MooseVariable * > > _cm_nonlocal_entry
Definition: Assembly.h:674
std::vector< dof_id_type > & dofIndices()
DenseMatrix< Number > & jacobianBlockNonlocal(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:894
const MooseArray<Point>& Assembly::qPoints ( )
inline

Returns the reference to the quadrature points.

Returns
A reference. Make sure to store this as a reference!

Definition at line 135 of file Assembly.h.

Referenced by GeometricSearchData::generateMortarNodes(), and GeometricSearchData::updateMortarNodes().

135 { return _current_q_points; }
MooseArray< Point > _current_q_points
The current list of quadrature points.
Definition: Assembly.h:716
const MooseArray<Point>& Assembly::qPointsFace ( )
inline

Returns the reference to the current quadrature being used.

Returns
A reference. Make sure to store this as a reference!

Definition at line 171 of file Assembly.h.

Referenced by GeometricSearchData::generateQuadratureNodes(), and GeometricSearchData::updateQuadratureNodes().

171 { return _current_q_points_face; }
MooseArray< Point > _current_q_points_face
The current quadrature points on a face.
Definition: Assembly.h:745
QBase*& Assembly::qRule ( )
inline

Returns the reference to the current quadrature being used.

Returns
A reference to the pointer. Make sure to store this as a reference!

Definition at line 129 of file Assembly.h.

Referenced by MooseMesh::buildRefinementAndCoarseningMaps().

129 { return _current_qrule; }
QBase * _current_qrule
The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac k...
Definition: Assembly.h:710
QBase*& Assembly::qRuleFace ( )
inline

Returns the reference to the current quadrature being used on a current face.

Returns
A reference. Make sure to store this as a reference!

Definition at line 165 of file Assembly.h.

Referenced by MooseMesh::buildRefinementAndCoarseningMaps().

165 { return _current_qrule_face; }
QBase * _current_qrule_face
quadrature rule used on faces
Definition: Assembly.h:741
QBase*& Assembly::qRuleNeighbor ( )
inline

Returns the reference to the current quadrature being used on a current neighbor.

Returns
A reference. Make sure to store this as a reference!

Definition at line 257 of file Assembly.h.

257 { return _current_qrule_neighbor; }
QBase * _current_qrule_neighbor
quadrature rule used on neighbors
Definition: Assembly.h:771
void Assembly::reinit ( const Elem *  elem)

Reinitialize objects (JxW, q_points, ...) for an elements.

Parameters
elemThe element we want to reinitialize on

Definition at line 650 of file Assembly.C.

Referenced by MooseMesh::buildRefinementAndCoarseningMaps(), GeometricSearchData::generateMortarNodes(), ComputeBoundaryInitialConditionThread::onNode(), reinitAtPhysical(), reinitElemAndNeighbor(), FaceFaceConstraint::reinitSide(), and GeometricSearchData::updateMortarNodes().

651 {
653  _current_neighbor_elem = nullptr;
654  mooseAssert(_current_subdomain_id == _current_elem->subdomain_id(),
655  "current subdomain has been set incorrectly");
657 
658  unsigned int elem_dimension = elem->dim();
659 
661 
662  // Make sure the qrule is the right one
664  setVolumeQRule(_current_qrule_volume, elem_dimension);
665 
666  _currently_fe_caching = true;
667 
668  reinitFE(elem);
669 
671 }
QBase * _current_qrule
The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac k...
Definition: Assembly.h:710
void reinitFE(const Elem *elem)
Just an internal helper function to reinit the volume FE objects.
Definition: Assembly.C:417
bool _current_elem_volume_computed
Boolean to indicate whether current element volumes has been computed.
Definition: Assembly.h:808
bool _currently_fe_caching
Whether or not fe should currently be cached - This will be false if something funky is going on with...
Definition: Assembly.h:893
const Elem * _current_neighbor_elem
The current neighbor "element".
Definition: Assembly.h:792
const Elem * _current_elem
The current "element" we are currently on.
Definition: Assembly.h:780
void setVolumeQRule(QBase *qrule, unsigned int dim)
Set the qrule to be used for volume integration.
Definition: Assembly.C:380
QBase * _current_qrule_volume
The current volumetric quadrature for the element.
Definition: Assembly.h:712
const Elem *& elem()
Return the current element.
Definition: Assembly.h:189
std::map< unsigned int, QBase * > _holder_qrule_volume
Holds volume qrules for each dimension.
Definition: Assembly.h:724
void computeCurrentElemVolume()
Definition: Assembly.C:704
SubdomainID _current_subdomain_id
The current subdomain ID.
Definition: Assembly.h:782
void Assembly::reinit ( const Elem *  elem,
const std::vector< Point > &  reference_points 
)

Reinitialize the assembly data at specific points in the reference element.

Definition at line 757 of file Assembly.C.

758 {
760  _current_neighbor_elem = nullptr;
761  mooseAssert(_current_subdomain_id == _current_elem->subdomain_id(),
762  "current subdomain has been set incorrectly");
764 
765  unsigned int elem_dimension = _current_elem->dim();
766 
768 
769  // Make sure the qrule is the right one
771  setVolumeQRule(_current_qrule_arbitrary, elem_dimension);
772 
773  _current_qrule_arbitrary->setPoints(reference_points);
774 
775  _currently_fe_caching = false;
776 
777  reinitFE(elem);
778 
780 }
ArbitraryQuadrature * _current_qrule_arbitrary
The current arbitrary quadrature rule used within the element interior.
Definition: Assembly.h:714
QBase * _current_qrule
The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac k...
Definition: Assembly.h:710
void reinitFE(const Elem *elem)
Just an internal helper function to reinit the volume FE objects.
Definition: Assembly.C:417
bool _current_elem_volume_computed
Boolean to indicate whether current element volumes has been computed.
Definition: Assembly.h:808
bool _currently_fe_caching
Whether or not fe should currently be cached - This will be false if something funky is going on with...
Definition: Assembly.h:893
const Elem * _current_neighbor_elem
The current neighbor "element".
Definition: Assembly.h:792
void setPoints(const std::vector< Point > &points)
const Elem * _current_elem
The current "element" we are currently on.
Definition: Assembly.h:780
void setVolumeQRule(QBase *qrule, unsigned int dim)
Set the qrule to be used for volume integration.
Definition: Assembly.C:380
std::map< unsigned int, ArbitraryQuadrature * > _holder_qrule_arbitrary
Holds arbitrary qrules for each dimension.
Definition: Assembly.h:726
const Elem *& elem()
Return the current element.
Definition: Assembly.h:189
void computeCurrentElemVolume()
Definition: Assembly.C:704
SubdomainID _current_subdomain_id
The current subdomain ID.
Definition: Assembly.h:782
void Assembly::reinit ( const Elem *  elem,
unsigned int  side 
)

Reinitialize the assembly data on an side of an element.

Definition at line 783 of file Assembly.C.

784 {
786  _current_neighbor_elem = nullptr;
787  mooseAssert(_current_subdomain_id == _current_elem->subdomain_id(),
788  "current subdomain has been set incorrectly");
792 
793  unsigned int elem_dimension = _current_elem->dim();
794 
795  if (_current_qrule_face != _holder_qrule_face[elem_dimension])
796  {
797  _current_qrule_face = _holder_qrule_face[elem_dimension];
798  setFaceQRule(_current_qrule_face, elem_dimension);
799  }
800 
801  if (_current_side_elem)
802  delete _current_side_elem;
803  _current_side_elem = elem->build_side_ptr(side).release();
804 
806 
808 }
bool _current_elem_volume_computed
Boolean to indicate whether current element volumes has been computed.
Definition: Assembly.h:808
const Elem * _current_neighbor_elem
The current neighbor "element".
Definition: Assembly.h:792
const Elem * _current_elem
The current "element" we are currently on.
Definition: Assembly.h:780
unsigned int & side()
Returns the current side.
Definition: Assembly.h:211
void computeCurrentFaceVolume()
Definition: Assembly.C:719
std::map< unsigned int, QBase * > _holder_qrule_face
Holds face qrules for each dimension.
Definition: Assembly.h:751
void setFaceQRule(QBase *qrule, unsigned int dim)
Set the qrule to be used for face integration.
Definition: Assembly.C:392
const Elem *& elem()
Return the current element.
Definition: Assembly.h:189
unsigned int _current_side
The current side of the selected element (valid only when working with sides)
Definition: Assembly.h:786
bool _current_side_volume_computed
Boolean to indicate whether current element side volumes has been computed.
Definition: Assembly.h:810
const Elem * _current_side_elem
The current "element" making up the side we are currently on.
Definition: Assembly.h:788
SubdomainID _current_subdomain_id
The current subdomain ID.
Definition: Assembly.h:782
QBase * _current_qrule_face
quadrature rule used on faces
Definition: Assembly.h:741
void reinitFEFace(const Elem *elem, unsigned int side)
Just an internal helper function to reinit the face FE objects.
Definition: Assembly.C:509
void Assembly::reinit ( const Node *  node)

Reinitialize assembly data for a node.

Definition at line 811 of file Assembly.C.

812 {
814  _current_neighbor_node = NULL;
815 }
const Node *& node()
Returns the reference to the node.
Definition: Assembly.h:269
const Node * _current_node
The current node we are working with.
Definition: Assembly.h:804
const Node * _current_neighbor_node
The current neighboring node we are working with.
Definition: Assembly.h:806
void Assembly::reinitAtPhysical ( const Elem *  elem,
const std::vector< Point > &  physical_points 
)

Reinitialize the assembly data at specific physical point in the given element.

Definition at line 734 of file Assembly.C.

Referenced by FaceFaceConstraint::reinitSide().

735 {
737  _current_neighbor_elem = nullptr;
738  mooseAssert(_current_subdomain_id == _current_elem->subdomain_id(),
739  "current subdomain has been set incorrectly");
741 
742  FEInterface::inverse_map(elem->dim(),
743  (*_holder_fe_helper[elem->dim()])->get_fe_type(),
744  elem,
745  physical_points,
747 
748  _currently_fe_caching = false;
749 
751 
752  // Save off the physical points
753  _current_physical_points = physical_points;
754 }
std::map< unsigned int, FEBase ** > _holder_fe_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:706
MooseArray< Point > _current_physical_points
This will be filled up with the physical points passed into reinitAtPhysical() if it is called...
Definition: Assembly.h:813
bool _current_elem_volume_computed
Boolean to indicate whether current element volumes has been computed.
Definition: Assembly.h:808
bool _currently_fe_caching
Whether or not fe should currently be cached - This will be false if something funky is going on with...
Definition: Assembly.h:893
const Elem * _current_neighbor_elem
The current neighbor "element".
Definition: Assembly.h:792
const Elem * _current_elem
The current "element" we are currently on.
Definition: Assembly.h:780
void reinit(const Elem *elem)
Reinitialize objects (JxW, q_points, ...) for an elements.
Definition: Assembly.C:650
std::vector< Point > _temp_reference_points
Temporary work data for reinitAtPhysical()
Definition: Assembly.h:925
const Elem *& elem()
Return the current element.
Definition: Assembly.h:189
SubdomainID _current_subdomain_id
The current subdomain ID.
Definition: Assembly.h:782
void Assembly::reinitElemAndNeighbor ( const Elem *  elem,
unsigned int  side,
const Elem *  neighbor,
unsigned int  neighbor_side 
)

Reinitialize an element and its neighbor along a particular side.

Parameters
elemElement being reinitialized
sideSide of the element
neighborNeighbor facing the element on the side 'side'
neighbor_sideThe side id on the neighboring element.

Definition at line 824 of file Assembly.C.

828 {
829  _current_neighbor_side = neighbor_side;
830 
831  reinit(elem, side);
832 
833  unsigned int neighbor_dim = neighbor->dim();
834 
835  std::vector<Point> reference_points;
836  FEInterface::inverse_map(
837  neighbor_dim, FEType(), neighbor, _current_q_points_face.stdVector(), reference_points);
838 
839  reinitFEFaceNeighbor(neighbor, reference_points);
840  reinitNeighbor(neighbor, reference_points);
841 }
const Elem *& neighbor()
Return the neighbor element.
Definition: Assembly.h:235
void reinitFEFaceNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition: Assembly.C:540
void reinit(const Elem *elem)
Reinitialize objects (JxW, q_points, ...) for an elements.
Definition: Assembly.C:650
unsigned int _current_neighbor_side
The current side of the selected neighboring element (valid only when working with sides) ...
Definition: Assembly.h:796
unsigned int & side()
Returns the current side.
Definition: Assembly.h:211
void reinitNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition: Assembly.C:591
std::vector< T > stdVector()
Extremely inefficient way to produce a std::vector from a MooseArray!
Definition: MooseArray.h:330
const Elem *& elem()
Return the current element.
Definition: Assembly.h:189
MooseArray< Point > _current_q_points_face
The current quadrature points on a face.
Definition: Assembly.h:745
void Assembly::reinitFE ( const Elem *  elem)
protected

Just an internal helper function to reinit the volume FE objects.

Parameters
elemThe element we are using to reinit

Definition at line 417 of file Assembly.C.

Referenced by reinit().

418 {
419  unsigned int dim = elem->dim();
420  ElementFEShapeData * efesd = NULL;
421 
422  // Whether or not we're going to do FE caching this time through
423  bool do_caching = _should_use_fe_cache && _currently_fe_caching;
424 
425  if (do_caching)
426  {
427  efesd = _element_fe_shape_data_cache[elem->id()];
428 
429  if (!efesd)
430  {
431  efesd = new ElementFEShapeData;
432  _element_fe_shape_data_cache[elem->id()] = efesd;
433  efesd->_invalidated = true;
434  }
435  }
436 
437  for (const auto & it : _fe[dim])
438  {
439  FEBase * fe = it.second;
440  const FEType & fe_type = it.first;
441 
442  _current_fe[fe_type] = fe;
443 
444  FEShapeData * fesd = _fe_shape_data[fe_type];
445 
446  FEShapeData * cached_fesd = NULL;
447  if (do_caching)
448  cached_fesd = efesd->_shape_data[fe_type];
449 
450  if (!cached_fesd || efesd->_invalidated)
451  {
452  fe->reinit(elem);
453 
454  fesd->_phi.shallowCopy(const_cast<std::vector<std::vector<Real>> &>(fe->get_phi()));
455  fesd->_grad_phi.shallowCopy(
456  const_cast<std::vector<std::vector<RealGradient>> &>(fe->get_dphi()));
457  if (_need_second_derivative.find(fe_type) != _need_second_derivative.end())
458  fesd->_second_phi.shallowCopy(
459  const_cast<std::vector<std::vector<RealTensor>> &>(fe->get_d2phi()));
460 
461  if (do_caching)
462  {
463  if (!cached_fesd)
464  {
465  cached_fesd = new FEShapeData;
466  efesd->_shape_data[fe_type] = cached_fesd;
467  }
468 
469  *cached_fesd = *fesd;
470  }
471  }
472  else // This means we have valid cached shape function values for this element / fe_type combo
473  {
474  fesd->_phi.shallowCopy(cached_fesd->_phi);
475  fesd->_grad_phi.shallowCopy(cached_fesd->_grad_phi);
476  if (_need_second_derivative.find(fe_type) != _need_second_derivative.end())
477  fesd->_second_phi.shallowCopy(cached_fesd->_second_phi);
478  }
479  }
480 
481  // During that last loop the helper objects will have been reinitialized as well
482  // We need to dig out the q_points and JxW from it.
483  if (!do_caching || efesd->_invalidated)
484  {
486  const_cast<std::vector<Point> &>((*_holder_fe_helper[dim])->get_xyz()));
487  _current_JxW.shallowCopy(const_cast<std::vector<Real> &>((*_holder_fe_helper[dim])->get_JxW()));
488 
489  if (do_caching)
490  {
491  efesd->_q_points = _current_q_points;
492  efesd->_JxW = _current_JxW;
493  }
494  }
495  else // Use cached values
496  {
497  _current_q_points.shallowCopy(efesd->_q_points);
498  _current_JxW.shallowCopy(efesd->_JxW);
499  }
500 
501  if (do_caching)
502  efesd->_invalidated = false;
503 
504  if (_xfem != NULL)
506 }
std::map< FEType, FEBase * > _current_fe
The "volume" fe object that matches the current elem.
Definition: Assembly.h:693
std::map< unsigned int, FEBase ** > _holder_fe_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:706
FEGenericBase< Real > FEBase
Definition: Assembly.h:34
std::shared_ptr< XFEMInterface > _xfem
The XFEM controller.
Definition: Assembly.h:690
bool _currently_fe_caching
Whether or not fe should currently be cached - This will be false if something funky is going on with...
Definition: Assembly.h:893
void modifyWeightsDueToXFEM(const Elem *elem)
Update the integration weights for XFEM partial elements.
Definition: Assembly.C:1970
std::map< FEType, bool > _need_second_derivative
Definition: Assembly.h:571
void shallowCopy(const MooseArray &rhs)
Doesn&#39;t actually make a copy of the data.
Definition: MooseArray.h:284
std::map< dof_id_type, ElementFEShapeData * > _element_fe_shape_data_cache
Cached shape function values stored by element.
Definition: Assembly.h:887
MooseArray< Real > _current_JxW
The current list of transformed jacobian weights.
Definition: Assembly.h:718
std::map< unsigned int, std::map< FEType, FEBase * > > _fe
Each dimension&#39;s actual fe objects indexed on type.
Definition: Assembly.h:704
const Elem *& elem()
Return the current element.
Definition: Assembly.h:189
bool _should_use_fe_cache
Whether or not fe cache should be built at all.
Definition: Assembly.h:890
std::map< FEType, FEShapeData * > _fe_shape_data
Definition: Assembly.h:896
MooseArray< Point > _current_q_points
The current list of quadrature points.
Definition: Assembly.h:716
void Assembly::reinitFEFace ( const Elem *  elem,
unsigned int  side 
)
protected

Just an internal helper function to reinit the face FE objects.

Parameters
elemThe element we are using to reinit
sideThe side of the element we are reiniting on

Definition at line 509 of file Assembly.C.

Referenced by reinit().

510 {
511  unsigned int dim = elem->dim();
512 
513  for (const auto & it : _fe_face[dim])
514  {
515  FEBase * fe_face = it.second;
516  const FEType & fe_type = it.first;
517  FEShapeData * fesd = _fe_shape_data_face[fe_type];
518  fe_face->reinit(elem, side);
519  _current_fe_face[fe_type] = fe_face;
520 
521  fesd->_phi.shallowCopy(const_cast<std::vector<std::vector<Real>> &>(fe_face->get_phi()));
522  fesd->_grad_phi.shallowCopy(
523  const_cast<std::vector<std::vector<RealGradient>> &>(fe_face->get_dphi()));
524  if (_need_second_derivative.find(fe_type) != _need_second_derivative.end())
525  fesd->_second_phi.shallowCopy(
526  const_cast<std::vector<std::vector<RealTensor>> &>(fe_face->get_d2phi()));
527  }
528 
529  // During that last loop the helper objects will have been reinitialized as well
530  // We need to dig out the q_points and JxW from it.
532  const_cast<std::vector<Point> &>((*_holder_fe_face_helper[dim])->get_xyz()));
534  const_cast<std::vector<Real> &>((*_holder_fe_face_helper[dim])->get_JxW()));
536  const_cast<std::vector<Point> &>((*_holder_fe_face_helper[dim])->get_normals()));
537 }
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face
types of finite elements
Definition: Assembly.h:735
FEGenericBase< Real > FEBase
Definition: Assembly.h:34
std::map< FEType, FEBase * > _current_fe_face
The "face" fe object that matches the current elem.
Definition: Assembly.h:695
MooseArray< Real > _current_JxW_face
The current transformed jacobian weights on a face.
Definition: Assembly.h:747
std::map< FEType, bool > _need_second_derivative
Definition: Assembly.h:571
void shallowCopy(const MooseArray &rhs)
Doesn&#39;t actually make a copy of the data.
Definition: MooseArray.h:284
unsigned int & side()
Returns the current side.
Definition: Assembly.h:211
std::map< unsigned int, FEBase ** > _holder_fe_face_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:737
MooseArray< Point > _current_normals
The current Normal vectors at the quadrature points.
Definition: Assembly.h:749
const Elem *& elem()
Return the current element.
Definition: Assembly.h:189
std::map< FEType, FEShapeData * > _fe_shape_data_face
Definition: Assembly.h:897
MooseArray< Point > _current_q_points_face
The current quadrature points on a face.
Definition: Assembly.h:745
void Assembly::reinitFEFaceNeighbor ( const Elem *  neighbor,
const std::vector< Point > &  reference_points 
)
protected

Definition at line 540 of file Assembly.C.

Referenced by reinitElemAndNeighbor(), and reinitNeighborAtPhysical().

541 {
542  unsigned int neighbor_dim = neighbor->dim();
543 
544  // reinit neighbor face
545  for (const auto & it : _fe_face_neighbor[neighbor_dim])
546  {
547  FEBase * fe_face_neighbor = it.second;
548  FEType fe_type = it.first;
549  FEShapeData * fesd = _fe_shape_data_face_neighbor[fe_type];
550 
551  fe_face_neighbor->reinit(neighbor, &reference_points);
552 
553  _current_fe_face_neighbor[fe_type] = fe_face_neighbor;
554 
555  fesd->_phi.shallowCopy(
556  const_cast<std::vector<std::vector<Real>> &>(fe_face_neighbor->get_phi()));
557  fesd->_grad_phi.shallowCopy(
558  const_cast<std::vector<std::vector<RealGradient>> &>(fe_face_neighbor->get_dphi()));
559  if (_need_second_derivative.find(fe_type) != _need_second_derivative.end())
560  fesd->_second_phi.shallowCopy(
561  const_cast<std::vector<std::vector<RealTensor>> &>(fe_face_neighbor->get_d2phi()));
562  }
563 }
FEGenericBase< Real > FEBase
Definition: Assembly.h:34
const Elem *& neighbor()
Return the neighbor element.
Definition: Assembly.h:235
std::map< FEType, bool > _need_second_derivative
Definition: Assembly.h:571
std::map< FEType, FEBase * > _current_fe_face_neighbor
The "neighbor face" fe object that matches the current elem.
Definition: Assembly.h:699
std::map< FEType, FEShapeData * > _fe_shape_data_face_neighbor
Definition: Assembly.h:899
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face_neighbor
Definition: Assembly.h:765
void Assembly::reinitFENeighbor ( const Elem *  neighbor,
const std::vector< Point > &  reference_points 
)
protected

Definition at line 566 of file Assembly.C.

Referenced by reinitNeighborAtPhysical().

567 {
568  unsigned int neighbor_dim = neighbor->dim();
569 
570  // reinit neighbor face
571  for (const auto & it : _fe_neighbor[neighbor_dim])
572  {
573  FEBase * fe_neighbor = it.second;
574  FEType fe_type = it.first;
575  FEShapeData * fesd = _fe_shape_data_neighbor[fe_type];
576 
577  fe_neighbor->reinit(neighbor, &reference_points);
578 
579  _current_fe_neighbor[fe_type] = fe_neighbor;
580 
581  fesd->_phi.shallowCopy(const_cast<std::vector<std::vector<Real>> &>(fe_neighbor->get_phi()));
582  fesd->_grad_phi.shallowCopy(
583  const_cast<std::vector<std::vector<RealGradient>> &>(fe_neighbor->get_dphi()));
584  if (_need_second_derivative.find(fe_type) != _need_second_derivative.end())
585  fesd->_second_phi.shallowCopy(
586  const_cast<std::vector<std::vector<RealTensor>> &>(fe_neighbor->get_d2phi()));
587  }
588 }
FEGenericBase< Real > FEBase
Definition: Assembly.h:34
const Elem *& neighbor()
Return the neighbor element.
Definition: Assembly.h:235
std::map< FEType, bool > _need_second_derivative
Definition: Assembly.h:571
std::map< FEType, FEShapeData * > _fe_shape_data_neighbor
Definition: Assembly.h:898
std::map< FEType, FEBase * > _current_fe_neighbor
The "neighbor" fe object that matches the current elem.
Definition: Assembly.h:697
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_neighbor
types of finite elements
Definition: Assembly.h:764
void Assembly::reinitNeighbor ( const Elem *  neighbor,
const std::vector< Point > &  reference_points 
)

Definition at line 591 of file Assembly.C.

Referenced by reinitElemAndNeighbor(), and reinitNeighborAtPhysical().

592 {
593  unsigned int neighbor_dim = neighbor->dim();
594 
595  ArbitraryQuadrature * neighbor_rule = _holder_qrule_neighbor[neighbor_dim];
596  neighbor_rule->setPoints(reference_points);
597  setNeighborQRule(neighbor_rule, neighbor_dim);
598 
600  mooseAssert(_current_neighbor_subdomain_id == _current_neighbor_elem->subdomain_id(),
601  "current neighbor subdomain has been set incorrectly");
602 
603  // Calculate the volume of the neighbor
605  {
606  unsigned int dim = neighbor->dim();
607  FEBase * fe = *_holder_fe_neighbor_helper[dim];
608  QBase * qrule = _holder_qrule_volume[dim];
609 
610  fe->attach_quadrature_rule(qrule);
611  fe->reinit(neighbor);
612 
613  // set the coord transformation
614  _coord_neighbor.resize(qrule->n_points());
615  Moose::CoordinateSystemType coord_type =
617  unsigned int rz_radial_coord = _sys.subproblem().getAxisymmetricRadialCoord();
618  const std::vector<Real> & JxW = fe->get_JxW();
619  const std::vector<Point> & q_points = fe->get_xyz();
620 
621  switch (coord_type)
622  {
623  case Moose::COORD_XYZ:
624  for (unsigned int qp = 0; qp < qrule->n_points(); qp++)
625  _coord_neighbor[qp] = 1.;
626  break;
627 
628  case Moose::COORD_RZ:
629  for (unsigned int qp = 0; qp < qrule->n_points(); qp++)
630  _coord_neighbor[qp] = 2 * M_PI * q_points[qp](rz_radial_coord);
631  break;
632 
634  for (unsigned int qp = 0; qp < qrule->n_points(); qp++)
635  _coord_neighbor[qp] = 4 * M_PI * q_points[qp](0) * q_points[qp](0);
636  break;
637 
638  default:
639  mooseError("Unknown coordinate system");
640  break;
641  }
642 
644  for (unsigned int qp = 0; qp < qrule->n_points(); qp++)
645  _current_neighbor_volume += JxW[qp] * _coord_neighbor[qp];
646  }
647 }
bool _need_neighbor_elem_volume
true is apps need to compute neighbor element volume
Definition: Assembly.h:800
SystemBase & _sys
Definition: Assembly.h:667
MooseArray< Real > _coord_neighbor
The current coordinate transformation coefficients.
Definition: Assembly.h:777
virtual Moose::CoordinateSystemType getCoordSystem(SubdomainID sid)=0
FEGenericBase< Real > FEBase
Definition: Assembly.h:34
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:205
std::map< unsigned int, ArbitraryQuadrature * > _holder_qrule_neighbor
Holds arbitrary qrules for each dimension.
Definition: Assembly.h:773
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
Real _current_neighbor_volume
Volume of the current neighbor.
Definition: Assembly.h:802
const Elem * _current_neighbor_elem
The current neighbor "element".
Definition: Assembly.h:792
void setPoints(const std::vector< Point > &points)
const Elem *& neighbor()
Return the neighbor element.
Definition: Assembly.h:235
const MooseArray< Real > & JxW()
Returns the reference to the transformed jacobian weights.
Definition: Assembly.h:147
Implements a fake quadrature rule where you can specify the locations (in the reference domain) of th...
SubdomainID _current_neighbor_subdomain_id
The current neighbor subdomain ID.
Definition: Assembly.h:794
std::map< unsigned int, FEBase ** > _holder_fe_neighbor_helper
Each dimension&#39;s helper objects.
Definition: Assembly.h:767
virtual SubProblem & subproblem()
Definition: SystemBase.h:103
CoordinateSystemType
Definition: MooseTypes.h:212
void setNeighborQRule(QBase *qrule, unsigned int dim)
Set the qrule to be used for neighbor integration.
Definition: Assembly.C:401
std::map< unsigned int, QBase * > _holder_qrule_volume
Holds volume qrules for each dimension.
Definition: Assembly.h:724
unsigned int getAxisymmetricRadialCoord()
Returns the desired radial direction for RZ coordinate transformation.
Definition: SubProblem.C:411
void Assembly::reinitNeighborAtPhysical ( const Elem *  neighbor,
unsigned int  neighbor_side,
const std::vector< Point > &  physical_points 
)

Reinitializes the neighbor at the physical coordinates on neighbor side given.

Definition at line 844 of file Assembly.C.

847 {
849  _current_neighbor_side_elem = neighbor->build_side_ptr(neighbor_side).release();
850 
851  std::vector<Point> reference_points;
852 
853  unsigned int neighbor_dim = neighbor->dim();
854  FEInterface::inverse_map(neighbor_dim, FEType(), neighbor, physical_points, reference_points);
855 
856  // first do the side element
858  reinitNeighbor(_current_neighbor_side_elem, reference_points);
859  // compute JxW on the neighbor's face
860  unsigned int neighbor_side_dim = _current_neighbor_side_elem->dim();
861  _current_JxW_neighbor.shallowCopy(const_cast<std::vector<Real> &>(
862  (*_holder_fe_face_neighbor_helper[neighbor_side_dim])->get_JxW()));
863 
864  reinitFEFaceNeighbor(neighbor, reference_points);
865  reinitNeighbor(neighbor, reference_points);
866 
867  // Save off the physical points
868  _current_physical_points = physical_points;
869 }
MooseArray< Point > _current_physical_points
This will be filled up with the physical points passed into reinitAtPhysical() if it is called...
Definition: Assembly.h:813
std::map< unsigned int, FEBase ** > _holder_fe_face_neighbor_helper
Definition: Assembly.h:768
MooseArray< Real > _current_JxW_neighbor
The current transformed jacobian weights on a neighbor&#39;s face.
Definition: Assembly.h:775
const Elem *& neighbor()
Return the neighbor element.
Definition: Assembly.h:235
void reinitFEFaceNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition: Assembly.C:540
void shallowCopy(const MooseArray &rhs)
Doesn&#39;t actually make a copy of the data.
Definition: MooseArray.h:284
void reinitNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition: Assembly.C:591
const Elem * _current_neighbor_side_elem
The current side element of the ncurrent neighbor element.
Definition: Assembly.h:798
void Assembly::reinitNeighborAtPhysical ( const Elem *  neighbor,
const std::vector< Point > &  physical_points 
)

Reinitializes the neighbor at the physical coordinates within element given.

Definition at line 872 of file Assembly.C.

874 {
875  std::vector<Point> reference_points;
876 
877  unsigned int neighbor_dim = neighbor->dim();
878  FEInterface::inverse_map(neighbor_dim, FEType(), neighbor, physical_points, reference_points);
879 
880  reinitFENeighbor(neighbor, reference_points);
881  reinitNeighbor(neighbor, reference_points);
882  // Save off the physical points
883  _current_physical_points = physical_points;
884 }
MooseArray< Point > _current_physical_points
This will be filled up with the physical points passed into reinitAtPhysical() if it is called...
Definition: Assembly.h:813
const Elem *& neighbor()
Return the neighbor element.
Definition: Assembly.h:235
void reinitNeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition: Assembly.C:591
void reinitFENeighbor(const Elem *neighbor, const std::vector< Point > &reference_points)
Definition: Assembly.C:566
void Assembly::reinitNodeNeighbor ( const Node *  node)

Reinitialize assembly data for a neighbor node.

Definition at line 818 of file Assembly.C.

819 {
821 }
const Node *& node()
Returns the reference to the node.
Definition: Assembly.h:269
const Node * _current_neighbor_node
The current neighboring node we are working with.
Definition: Assembly.h:806
DenseVector<Number>& Assembly::residualBlock ( unsigned int  var_num,
Moose::KernelType  type = Moose::KT_NONTIME 
)
inline
DenseVector<Number>& Assembly::residualBlockNeighbor ( unsigned int  var_num,
Moose::KernelType  type = Moose::KT_NONTIME 
)
inline

Definition at line 509 of file Assembly.h.

Referenced by ElemElemConstraint::computeElemNeighResidual(), InterfaceKernel::computeElemNeighResidual(), DGKernel::computeElemNeighResidual(), and NodeFaceConstraint::computeResidual().

511  {
512  return _sub_Rn[static_cast<unsigned int>(type)][var_num];
513  }
std::vector< std::vector< DenseVector< Number > > > _sub_Rn
residual contributions for each variable from the neighbor
Definition: Assembly.h:818
MatType type
const VariablePhiSecond& Assembly::secondPhi ( )
inline

Definition at line 536 of file Assembly.h.

Referenced by MooseVariableInterface::secondPhi().

536 { return _second_phi; }
VariablePhiSecond _second_phi
Definition: Assembly.h:839
const VariablePhiSecond& Assembly::secondPhiFace ( )
inline

Definition at line 540 of file Assembly.h.

Referenced by MooseVariableInterface::secondPhiFace().

540 { return _second_phi_face; }
VariablePhiSecond _second_phi_face
Definition: Assembly.h:843
const VariablePhiSecond& Assembly::secondPhiFaceNeighbor ( )
inline

Definition at line 548 of file Assembly.h.

Referenced by NeighborMooseVariableInterface::neighborSecondPhi().

548 { return _second_phi_face_neighbor; }
VariablePhiSecond _second_phi_face_neighbor
Definition: Assembly.h:851
const VariablePhiSecond& Assembly::secondPhiNeighbor ( )
inline

Definition at line 544 of file Assembly.h.

544 { return _second_phi_neighbor; }
VariablePhiSecond _second_phi_neighbor
Definition: Assembly.h:847
void Assembly::setCachedJacobianContributions ( SparseMatrix< Number > &  jacobian)

Sets previously-cached Jacobian values via SparseMatrix::set() calls.

Definition at line 1911 of file Assembly.C.

Referenced by NonlinearSystemBase::computeJacobianInternal().

1912 {
1913  // First zero the rows (including the diagonals) to prepare for
1914  // setting the cached values.
1915  jacobian.zero_rows(_cached_jacobian_contribution_rows, 0.0);
1916 
1917  // TODO: Use SparseMatrix::set_values() for efficiency
1918  for (unsigned int i = 0; i < _cached_jacobian_contribution_vals.size(); ++i)
1919  jacobian.set(_cached_jacobian_contribution_rows[i],
1922 
1924 }
std::vector< numeric_index_type > _cached_jacobian_contribution_cols
Definition: Assembly.h:932
std::vector< numeric_index_type > _cached_jacobian_contribution_rows
Definition: Assembly.h:931
std::vector< Real > _cached_jacobian_contribution_vals
Storage for cached Jacobian entries.
Definition: Assembly.h:930
void clearCachedJacobianContributions()
Clear any currently cached jacobian contributions.
Definition: Assembly.C:1949
void Assembly::setCoordinateTransformation ( const QBase *  qrule,
const MooseArray< Point > &  q_points 
)
protected

Definition at line 674 of file Assembly.C.

Referenced by computeCurrentElemVolume(), and computeCurrentFaceVolume().

675 {
676  _coord.resize(qrule->n_points());
678  unsigned int rz_radial_coord = _sys.subproblem().getAxisymmetricRadialCoord();
679 
680  switch (_coord_type)
681  {
682  case Moose::COORD_XYZ:
683  for (unsigned int qp = 0; qp < qrule->n_points(); qp++)
684  _coord[qp] = 1.;
685  break;
686 
687  case Moose::COORD_RZ:
688  for (unsigned int qp = 0; qp < qrule->n_points(); qp++)
689  _coord[qp] = 2 * M_PI * q_points[qp](rz_radial_coord);
690  break;
691 
693  for (unsigned int qp = 0; qp < qrule->n_points(); qp++)
694  _coord[qp] = 4 * M_PI * q_points[qp](0) * q_points[qp](0);
695  break;
696 
697  default:
698  mooseError("Unknown coordinate system");
699  break;
700  }
701 }
SystemBase & _sys
Definition: Assembly.h:667
virtual Moose::CoordinateSystemType getCoordSystem(SubdomainID sid)=0
MooseArray< Real > _coord
The current coordinate transformation coefficients.
Definition: Assembly.h:722
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:205
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
const Elem * _current_elem
The current "element" we are currently on.
Definition: Assembly.h:780
virtual SubProblem & subproblem()
Definition: SystemBase.h:103
Moose::CoordinateSystemType _coord_type
The coordinate system.
Definition: Assembly.h:720
unsigned int getAxisymmetricRadialCoord()
Returns the desired radial direction for RZ coordinate transformation.
Definition: SubProblem.C:411
void Assembly::setCurrentNeighborSubdomainID ( SubdomainID  i)
inline

set the current subdomain ID

Definition at line 245 of file Assembly.h.

SubdomainID _current_neighbor_subdomain_id
The current neighbor subdomain ID.
Definition: Assembly.h:794
void Assembly::setCurrentSubdomainID ( SubdomainID  i)
inline

set the current subdomain ID

Definition at line 199 of file Assembly.h.

Referenced by MooseMesh::buildRefinementAndCoarseningMaps(), and FaceFaceConstraint::reinitSide().

199 { _current_subdomain_id = i; }
SubdomainID _current_subdomain_id
The current subdomain ID.
Definition: Assembly.h:782
void Assembly::setFaceQRule ( QBase *  qrule,
unsigned int  dim 
)

Set the qrule to be used for face integration.

Note: This is normally set internally, only use if you know what you are doing!

Parameters
qruleThe qrule you want to set
dimThe spatial dimension of the qrule

Definition at line 392 of file Assembly.C.

Referenced by reinit().

393 {
394  _current_qrule_face = qrule;
395 
396  for (auto & it : _fe_face[dim])
397  it.second->attach_quadrature_rule(_current_qrule_face);
398 }
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face
types of finite elements
Definition: Assembly.h:735
QBase * _current_qrule_face
quadrature rule used on faces
Definition: Assembly.h:741
void Assembly::setNeighborQRule ( QBase *  qrule,
unsigned int  dim 
)

Set the qrule to be used for neighbor integration.

Note: This is normally set internally, only use if you know what you are doing!

Parameters
qruleThe qrule you want to set
dimThe spatial dimension of the qrule

Definition at line 401 of file Assembly.C.

Referenced by reinitNeighbor().

402 {
403  _current_qrule_neighbor = qrule;
404 
405  for (auto & it : _fe_face_neighbor[dim])
406  it.second->attach_quadrature_rule(_current_qrule_neighbor);
407 }
QBase * _current_qrule_neighbor
quadrature rule used on neighbors
Definition: Assembly.h:771
std::map< unsigned int, std::map< FEType, FEBase * > > _fe_face_neighbor
Definition: Assembly.h:765
void Assembly::setResidual ( NumericVector< Number > &  residual,
Moose::KernelType  type = Moose::KT_NONTIME 
)

Definition at line 1478 of file Assembly.C.

1480 {
1481  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1482  for (const auto & var : vars)
1484  residual, _sub_Re[type][var->number()], var->dofIndices(), var->scalingFactor());
1485 }
SystemBase & _sys
Definition: Assembly.h:667
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
std::vector< std::vector< DenseVector< Number > > > _sub_Re
residual contributions for each variable from the element
Definition: Assembly.h:816
void setResidualBlock(NumericVector< Number > &residual, DenseVector< Number > &res_block, std::vector< dof_id_type > &dof_indices, Real scaling_factor)
Definition: Assembly.C:1456
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
MatType type
void Assembly::setResidualBlock ( NumericVector< Number > &  residual,
DenseVector< Number > &  res_block,
std::vector< dof_id_type > &  dof_indices,
Real  scaling_factor 
)
protected

Definition at line 1456 of file Assembly.C.

Referenced by setResidual(), and setResidualNeighbor().

1460 {
1461  if (dof_indices.size() > 0)
1462  {
1463  std::vector<dof_id_type> di(dof_indices);
1464  _dof_map.constrain_element_vector(res_block, di, false);
1465 
1466  if (scaling_factor != 1.0)
1467  {
1468  _tmp_Re = res_block;
1469  _tmp_Re *= scaling_factor;
1470  residual.insert(_tmp_Re, di);
1471  }
1472  else
1473  residual.insert(res_block, di);
1474  }
1475 }
DenseVector< Number > _tmp_Re
auxiliary vector for scaling residuals (optimization to avoid expensive construction/destruction) ...
Definition: Assembly.h:820
const DofMap & _dof_map
DOF map.
Definition: Assembly.h:681
void Assembly::setResidualNeighbor ( NumericVector< Number > &  residual,
Moose::KernelType  type = Moose::KT_NONTIME 
)

Definition at line 1488 of file Assembly.C.

1490 {
1491  const std::vector<MooseVariable *> & vars = _sys.getVariables(_tid);
1492  for (const auto & var : vars)
1494  residual, _sub_Rn[type][var->number()], var->dofIndicesNeighbor(), var->scalingFactor());
1495 }
SystemBase & _sys
Definition: Assembly.h:667
std::vector< std::vector< DenseVector< Number > > > _sub_Rn
residual contributions for each variable from the neighbor
Definition: Assembly.h:818
THREAD_ID _tid
Thread number (id)
Definition: Assembly.h:683
void setResidualBlock(NumericVector< Number > &residual, DenseVector< Number > &res_block, std::vector< dof_id_type > &dof_indices, Real scaling_factor)
Definition: Assembly.C:1456
const std::vector< MooseVariable * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:418
MatType type
void Assembly::setVolumeQRule ( QBase *  qrule,
unsigned int  dim 
)

Set the qrule to be used for volume integration.

Note: This is normally set internally, only use if you know what you are doing!

Parameters
qruleThe qrule you want to set
dimThe spatial dimension of the qrule

Definition at line 380 of file Assembly.C.

Referenced by reinit().

381 {
382  _current_qrule = qrule;
383 
384  if (qrule) // Don't set a NULL qrule
385  {
386  for (auto & it : _fe[dim])
387  it.second->attach_quadrature_rule(_current_qrule);
388  }
389 }
QBase * _current_qrule
The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac k...
Definition: Assembly.h:710
std::map< unsigned int, std::map< FEType, FEBase * > > _fe
Each dimension&#39;s actual fe objects indexed on type.
Definition: Assembly.h:704
void Assembly::setXFEM ( std::shared_ptr< XFEMInterface xfem)
inline

Set the pointer to the XFEM controller object.

Definition at line 601 of file Assembly.h.

601 { _xfem = xfem; }
std::shared_ptr< XFEMInterface > _xfem
The XFEM controller.
Definition: Assembly.h:690
unsigned int& Assembly::side ( )
inline

Returns the current side.

Returns
A reference. Make sure to store this as a reference!

Definition at line 211 of file Assembly.h.

Referenced by reinit().

211 { return _current_side; }
unsigned int _current_side
The current side of the selected element (valid only when working with sides)
Definition: Assembly.h:786
const Elem*& Assembly::sideElem ( )
inline

Returns the side element.

Returns
A reference. Make sure to store this as a reference!

Definition at line 223 of file Assembly.h.

223 { return _current_side_elem; }
const Elem * _current_side_elem
The current "element" making up the side we are currently on.
Definition: Assembly.h:788
const Real& Assembly::sideElemVolume ( )
inline

Returns the reference to the volume of current side element.

Returns
A reference. Make sure to store this as a reference!

Definition at line 229 of file Assembly.h.

229 { return _current_side_volume; }
Real _current_side_volume
Volume of the current side element.
Definition: Assembly.h:790
void Assembly::useFECache ( bool  fe_cache)
inline

Whether or not this assembly should utilize FE shape function caching.

Parameters
fe_cacheTrue for using the cache false for not.

Definition at line 387 of file Assembly.h.

387 { _should_use_fe_cache = fe_cache; }
bool _should_use_fe_cache
Whether or not fe cache should be built at all.
Definition: Assembly.h:890
void Assembly::zeroCachedJacobianContributions ( SparseMatrix< Number > &  jacobian)

Zero out previously-cached Jacobian rows.

Definition at line 1927 of file Assembly.C.

Referenced by NonlinearSystemBase::computeJacobianInternal().

1928 {
1929  // First zero the rows (including the diagonals) to prepare for
1930  // setting the cached values.
1931  jacobian.zero_rows(_cached_jacobian_contribution_rows, 0.0);
1932 
1934 }
std::vector< numeric_index_type > _cached_jacobian_contribution_rows
Definition: Assembly.h:931
void clearCachedJacobianContributions()
Clear any currently cached jacobian contributions.
Definition: Assembly.C:1949

Member Data Documentation

unsigned int Assembly::_block_diagonal_matrix
protected

Will be true if our preconditioning matrix is a block-diagonal matrix. Which means that we can take some shortcuts.

Definition at line 919 of file Assembly.h.

Referenced by init(), jacobianBlock(), jacobianBlockNeighbor(), and jacobianBlockNonlocal().

std::vector<dof_id_type> Assembly::_cached_jacobian_cols
protected

Column where the corresponding cached value should go.

Definition at line 914 of file Assembly.h.

Referenced by addCachedJacobian(), cacheJacobianBlock(), and cacheJacobianBlockNonlocal().

std::vector<numeric_index_type> Assembly::_cached_jacobian_contribution_cols
protected
std::vector<numeric_index_type> Assembly::_cached_jacobian_contribution_rows
protected
std::vector<Real> Assembly::_cached_jacobian_contribution_vals
protected

Storage for cached Jacobian entries.

Definition at line 930 of file Assembly.h.

Referenced by addCachedJacobianContributions(), cacheJacobianContribution(), clearCachedJacobianContributions(), and setCachedJacobianContributions().

std::vector<dof_id_type> Assembly::_cached_jacobian_rows
protected

Row where the corresponding cached value should go.

Definition at line 912 of file Assembly.h.

Referenced by addCachedJacobian(), cacheJacobianBlock(), and cacheJacobianBlockNonlocal().

std::vector<Real> Assembly::_cached_jacobian_values
protected

Values cached by calling cacheJacobian()

Definition at line 910 of file Assembly.h.

Referenced by addCachedJacobian(), cacheJacobianBlock(), and cacheJacobianBlockNonlocal().

std::vector<std::vector<dof_id_type> > Assembly::_cached_residual_rows
protected

Where the cached values should go (the first vector is for TIME vs NONTIME)

Definition at line 905 of file Assembly.h.

Referenced by addCachedResidual(), addCachedResiduals(), cacheResidual(), cacheResidualContribution(), cacheResidualNeighbor(), and cacheResidualNodes().

std::vector<std::vector<Real> > Assembly::_cached_residual_values
protected

Values cached by calling cacheResidual() (the first vector is for TIME vs NONTIME)

Definition at line 902 of file Assembly.h.

Referenced by addCachedResidual(), addCachedResiduals(), cacheResidual(), cacheResidualContribution(), cacheResidualNeighbor(), and cacheResidualNodes().

const CouplingMatrix* Assembly::_cm
protected
std::vector<std::pair<MooseVariable *, MooseVariable *> > Assembly::_cm_entry
protected

Entries in the coupling matrix (only for field variables)

Definition at line 673 of file Assembly.h.

Referenced by init(), prepare(), prepareNeighbor(), and prepareVariable().

std::vector<std::pair<MooseVariable *, MooseVariable *> > Assembly::_cm_nonlocal_entry
protected

Definition at line 674 of file Assembly.h.

Referenced by initNonlocalCoupling(), prepareNonlocal(), and prepareVariableNonlocal().

MooseArray<Real> Assembly::_coord
protected

The current coordinate transformation coefficients.

Definition at line 722 of file Assembly.h.

Referenced by computeCurrentElemVolume(), computeCurrentFaceVolume(), setCoordinateTransformation(), and ~Assembly().

MooseArray<Real> Assembly::_coord_neighbor
protected

The current coordinate transformation coefficients.

Definition at line 777 of file Assembly.h.

Referenced by reinitNeighbor(), and ~Assembly().

Moose::CoordinateSystemType Assembly::_coord_type
protected

The coordinate system.

Definition at line 720 of file Assembly.h.

Referenced by setCoordinateTransformation().

const Elem* Assembly::_current_elem
protected

The current "element" we are currently on.

Definition at line 780 of file Assembly.h.

Referenced by reinit(), reinitAtPhysical(), and setCoordinateTransformation().

Real Assembly::_current_elem_volume
protected

Volume of the current element.

Definition at line 784 of file Assembly.h.

Referenced by computeCurrentElemVolume().

bool Assembly::_current_elem_volume_computed
protected

Boolean to indicate whether current element volumes has been computed.

Definition at line 808 of file Assembly.h.

Referenced by computeCurrentElemVolume(), reinit(), and reinitAtPhysical().

std::map<FEType, FEBase *> Assembly::_current_fe
protected

The "volume" fe object that matches the current elem.

Definition at line 693 of file Assembly.h.

Referenced by reinitFE().

std::map<FEType, FEBase *> Assembly::_current_fe_face
protected

The "face" fe object that matches the current elem.

Definition at line 695 of file Assembly.h.

Referenced by reinitFEFace().

FEBase* Assembly::_current_fe_face_helper
protected

helper object for transforming coordinates

Definition at line 739 of file Assembly.h.

std::map<FEType, FEBase *> Assembly::_current_fe_face_neighbor
protected

The "neighbor face" fe object that matches the current elem.

Definition at line 699 of file Assembly.h.

Referenced by reinitFEFaceNeighbor().

FEBase* Assembly::_current_fe_helper
protected

The current helper object for transforming coordinates.

Definition at line 708 of file Assembly.h.

std::map<FEType, FEBase *> Assembly::_current_fe_neighbor
protected

The "neighbor" fe object that matches the current elem.

Definition at line 697 of file Assembly.h.

Referenced by reinitFENeighbor().

MooseArray<Real> Assembly::_current_JxW
protected

The current list of transformed jacobian weights.

Definition at line 718 of file Assembly.h.

Referenced by computeCurrentElemVolume(), modifyWeightsDueToXFEM(), and reinitFE().

MooseArray<Real> Assembly::_current_JxW_face
protected

The current transformed jacobian weights on a face.

Definition at line 747 of file Assembly.h.

Referenced by computeCurrentFaceVolume(), and reinitFEFace().

MooseArray<Real> Assembly::_current_JxW_neighbor
protected

The current transformed jacobian weights on a neighbor's face.

Definition at line 775 of file Assembly.h.

Referenced by reinitNeighborAtPhysical().

const Elem* Assembly::_current_neighbor_elem
protected

The current neighbor "element".

Definition at line 792 of file Assembly.h.

Referenced by reinit(), reinitAtPhysical(), and reinitNeighbor().

const Node* Assembly::_current_neighbor_node
protected

The current neighboring node we are working with.

Definition at line 806 of file Assembly.h.

Referenced by reinit(), and reinitNodeNeighbor().

unsigned int Assembly::_current_neighbor_side
protected

The current side of the selected neighboring element (valid only when working with sides)

Definition at line 796 of file Assembly.h.

Referenced by reinitElemAndNeighbor().

const Elem* Assembly::_current_neighbor_side_elem
protected

The current side element of the ncurrent neighbor element.

Definition at line 798 of file Assembly.h.

Referenced by reinitNeighborAtPhysical(), and ~Assembly().

SubdomainID Assembly::_current_neighbor_subdomain_id
protected

The current neighbor subdomain ID.

Definition at line 794 of file Assembly.h.

Referenced by reinitNeighbor().

Real Assembly::_current_neighbor_volume
protected

Volume of the current neighbor.

Definition at line 802 of file Assembly.h.

Referenced by neighborVolume(), and reinitNeighbor().

const Node* Assembly::_current_node
protected

The current node we are working with.

Definition at line 804 of file Assembly.h.

Referenced by reinit().

MooseArray<Point> Assembly::_current_normals
protected

The current Normal vectors at the quadrature points.

Definition at line 749 of file Assembly.h.

Referenced by reinitFEFace().

MooseArray<Point> Assembly::_current_physical_points
protected

This will be filled up with the physical points passed into reinitAtPhysical() if it is called. Invalid at all other times.

Definition at line 813 of file Assembly.h.

Referenced by reinitAtPhysical(), reinitNeighborAtPhysical(), and ~Assembly().

MooseArray<Point> Assembly::_current_q_points
protected

The current list of quadrature points.

Definition at line 716 of file Assembly.h.

Referenced by computeCurrentElemVolume(), modifyWeightsDueToXFEM(), and reinitFE().

MooseArray<Point> Assembly::_current_q_points_face
protected

The current quadrature points on a face.

Definition at line 745 of file Assembly.h.

Referenced by computeCurrentFaceVolume(), reinitElemAndNeighbor(), and reinitFEFace().

ArbitraryQuadrature* Assembly::_current_qface_arbitrary
protected

The current arbitrary quadrature rule used on element faces.

Definition at line 743 of file Assembly.h.

QBase* Assembly::_current_qrule
protected

The current current quadrature rule being used (could be either volumetric or arbitrary - for dirac kernels)

Definition at line 710 of file Assembly.h.

Referenced by computeCurrentElemVolume(), modifyWeightsDueToXFEM(), reinit(), and setVolumeQRule().

ArbitraryQuadrature* Assembly::_current_qrule_arbitrary
protected

The current arbitrary quadrature rule used within the element interior.

Definition at line 714 of file Assembly.h.

Referenced by modifyWeightsDueToXFEM(), and reinit().

QBase* Assembly::_current_qrule_face
protected

quadrature rule used on faces

Definition at line 741 of file Assembly.h.

Referenced by computeCurrentFaceVolume(), reinit(), and setFaceQRule().

QBase* Assembly::_current_qrule_neighbor
protected

quadrature rule used on neighbors

Definition at line 771 of file Assembly.h.

Referenced by setNeighborQRule().

QBase* Assembly::_current_qrule_volume
protected

The current volumetric quadrature for the element.

Definition at line 712 of file Assembly.h.

Referenced by reinit().

unsigned int Assembly::_current_side
protected

The current side of the selected element (valid only when working with sides)

Definition at line 786 of file Assembly.h.

Referenced by reinit().

const Elem* Assembly::_current_side_elem
protected

The current "element" making up the side we are currently on.

Definition at line 788 of file Assembly.h.

Referenced by reinit(), and ~Assembly().

Real Assembly::_current_side_volume
protected

Volume of the current side element.

Definition at line 790 of file Assembly.h.

Referenced by computeCurrentFaceVolume().

bool Assembly::_current_side_volume_computed
protected

Boolean to indicate whether current element side volumes has been computed.

Definition at line 810 of file Assembly.h.

Referenced by computeCurrentFaceVolume(), and reinit().

SubdomainID Assembly::_current_subdomain_id
protected

The current subdomain ID.

Definition at line 782 of file Assembly.h.

Referenced by reinit(), and reinitAtPhysical().

bool Assembly::_currently_fe_caching
protected

Whether or not fe should currently be cached - This will be false if something funky is going on with the quadrature rules.

Definition at line 893 of file Assembly.h.

Referenced by reinit(), reinitAtPhysical(), and reinitFE().

const DofMap& Assembly::_dof_map
protected
std::map<dof_id_type, ElementFEShapeData *> Assembly::_element_fe_shape_data_cache
protected

Cached shape function values stored by element.

Definition at line 887 of file Assembly.h.

Referenced by invalidateCache(), and reinitFE().

std::map<unsigned int, std::map<FEType, FEBase *> > Assembly::_fe
protected

Each dimension's actual fe objects indexed on type.

Definition at line 704 of file Assembly.h.

Referenced by Assembly(), buildFE(), getFE(), reinitFE(), setVolumeQRule(), and ~Assembly().

std::map<unsigned int, std::map<FEType, FEBase *> > Assembly::_fe_face
protected

types of finite elements

Definition at line 735 of file Assembly.h.

Referenced by Assembly(), buildFaceFE(), getFEFace(), reinitFEFace(), setFaceQRule(), and ~Assembly().

std::map<unsigned int, std::map<FEType, FEBase *> > Assembly::_fe_face_neighbor
protected
std::map<unsigned int, std::map<FEType, FEBase *> > Assembly::_fe_neighbor
protected

types of finite elements

Definition at line 764 of file Assembly.h.

Referenced by Assembly(), buildNeighborFE(), getFEFaceNeighbor(), reinitFENeighbor(), and ~Assembly().

std::map<FEType, FEShapeData *> Assembly::_fe_shape_data
protected

Definition at line 896 of file Assembly.h.

Referenced by buildFE(), feGradPhi(), fePhi(), feSecondPhi(), reinitFE(), and ~Assembly().

std::map<FEType, FEShapeData *> Assembly::_fe_shape_data_face
protected
std::map<FEType, FEShapeData *> Assembly::_fe_shape_data_face_neighbor
protected
std::map<FEType, FEShapeData *> Assembly::_fe_shape_data_neighbor
protected
VariablePhiGradient Assembly::_grad_phi
protected

Definition at line 838 of file Assembly.h.

Referenced by copyShapes().

VariablePhiGradient Assembly::_grad_phi_face
protected

Definition at line 842 of file Assembly.h.

Referenced by copyFaceShapes().

VariablePhiGradient Assembly::_grad_phi_face_neighbor
protected

Definition at line 850 of file Assembly.h.

Referenced by copyNeighborShapes().

VariablePhiGradient Assembly::_grad_phi_neighbor
protected

Definition at line 846 of file Assembly.h.

Referenced by copyNeighborShapes().

std::map<unsigned int, FEBase **> Assembly::_holder_fe_face_helper
protected

Each dimension's helper objects.

Definition at line 737 of file Assembly.h.

Referenced by Assembly(), and reinitFEFace().

std::map<unsigned int, FEBase **> Assembly::_holder_fe_face_neighbor_helper
protected

Definition at line 768 of file Assembly.h.

Referenced by Assembly(), and reinitNeighborAtPhysical().

std::map<unsigned int, FEBase **> Assembly::_holder_fe_helper
protected

Each dimension's helper objects.

Definition at line 706 of file Assembly.h.

Referenced by Assembly(), reinitAtPhysical(), and reinitFE().

std::map<unsigned int, FEBase **> Assembly::_holder_fe_neighbor_helper
protected

Each dimension's helper objects.

Definition at line 767 of file Assembly.h.

Referenced by Assembly(), and reinitNeighbor().

std::map<unsigned int, const std::vector<Real> *> Assembly::_holder_JxW
protected

Holds pointers to the dimension's transformed jacobian weights.

Definition at line 730 of file Assembly.h.

std::map<unsigned int, const std::vector<Real> *> Assembly::_holder_JxW_face
protected

Holds pointers to the dimension's transformed jacobian weights on a face.

Definition at line 757 of file Assembly.h.

std::map<unsigned int, const std::vector<Point> *> Assembly::_holder_normals
protected

Holds pointers to the dimension's normal vectors.

Definition at line 759 of file Assembly.h.

std::map<unsigned int, const std::vector<Point> *> Assembly::_holder_q_points
protected

Holds pointers to the dimension's q_points.

Definition at line 728 of file Assembly.h.

std::map<unsigned int, const std::vector<Point> *> Assembly::_holder_q_points_face
protected

Holds pointers to the dimension's q_points on a face.

Definition at line 755 of file Assembly.h.

std::map<unsigned int, ArbitraryQuadrature *> Assembly::_holder_qface_arbitrary
protected

Holds arbitrary face qrules for each dimension.

Definition at line 753 of file Assembly.h.

Referenced by ~Assembly().

std::map<unsigned int, ArbitraryQuadrature *> Assembly::_holder_qrule_arbitrary
protected

Holds arbitrary qrules for each dimension.

Definition at line 726 of file Assembly.h.

Referenced by createQRules(), reinit(), and ~Assembly().

std::map<unsigned int, QBase *> Assembly::_holder_qrule_face
protected

Holds face qrules for each dimension.

Definition at line 751 of file Assembly.h.

Referenced by createQRules(), reinit(), and ~Assembly().

std::map<unsigned int, ArbitraryQuadrature *> Assembly::_holder_qrule_neighbor
protected

Holds arbitrary qrules for each dimension.

Definition at line 773 of file Assembly.h.

Referenced by createQRules(), reinitNeighbor(), and ~Assembly().

std::map<unsigned int, QBase *> Assembly::_holder_qrule_volume
protected

Holds volume qrules for each dimension.

Definition at line 724 of file Assembly.h.

Referenced by createQRules(), reinit(), reinitNeighbor(), and ~Assembly().

std::vector<std::vector<unsigned char> > Assembly::_jacobian_block_neighbor_used
protected

Flag that indicates if the jacobian block for neighbor was used.

Definition at line 679 of file Assembly.h.

Referenced by addJacobianNeighbor(), cacheJacobianNeighbor(), init(), jacobianBlockNeighbor(), and prepareNeighbor().

std::vector<std::vector<unsigned char> > Assembly::_jacobian_block_nonlocal_used
protected
std::vector<std::vector<unsigned char> > Assembly::_jacobian_block_used
protected

Flag that indicates if the jacobian block was used.

Definition at line 676 of file Assembly.h.

Referenced by addJacobian(), addJacobianOffDiagScalar(), addJacobianScalar(), cacheJacobian(), init(), jacobianBlock(), prepare(), prepareBlock(), prepareOffDiagScalar(), and prepareScalar().

unsigned int Assembly::_max_cached_jacobians
protected

Definition at line 916 of file Assembly.h.

Referenced by addCachedJacobian().

unsigned int Assembly::_max_cached_residuals
protected

Definition at line 907 of file Assembly.h.

Referenced by addCachedResidual().

MooseMesh& Assembly::_mesh
protected

Definition at line 685 of file Assembly.h.

unsigned int Assembly::_mesh_dimension
protected
bool Assembly::_need_neighbor_elem_volume
protected

true is apps need to compute neighbor element volume

Definition at line 800 of file Assembly.h.

Referenced by neighborVolume(), and reinitNeighbor().

std::map<FEType, bool> Assembly::_need_second_derivative
const CouplingMatrix& Assembly::_nonlocal_cm
protected

Definition at line 671 of file Assembly.h.

Referenced by addJacobianNonlocal(), cacheJacobianNonlocal(), and initNonlocalCoupling().

VariablePhiValue Assembly::_phi
protected

Definition at line 837 of file Assembly.h.

Referenced by copyShapes().

VariablePhiValue Assembly::_phi_face
protected

Definition at line 841 of file Assembly.h.

Referenced by copyFaceShapes().

VariablePhiValue Assembly::_phi_face_neighbor
protected

Definition at line 849 of file Assembly.h.

Referenced by copyNeighborShapes().

VariablePhiValue Assembly::_phi_neighbor
protected

Definition at line 845 of file Assembly.h.

Referenced by copyNeighborShapes().

VariablePhiSecond Assembly::_second_phi
protected

Definition at line 839 of file Assembly.h.

Referenced by copyShapes().

VariablePhiSecond Assembly::_second_phi_face
protected

Definition at line 843 of file Assembly.h.

Referenced by copyFaceShapes().

VariablePhiSecond Assembly::_second_phi_face_neighbor
protected

Definition at line 851 of file Assembly.h.

Referenced by copyNeighborShapes().

VariablePhiSecond Assembly::_second_phi_neighbor
protected

Definition at line 847 of file Assembly.h.

Referenced by copyNeighborShapes().

bool Assembly::_should_use_fe_cache
protected

Whether or not fe cache should be built at all.

Definition at line 890 of file Assembly.h.

Referenced by reinitFE().

std::vector<std::vector<DenseMatrix<Number> > > Assembly::_sub_Kee
protected

jacobian contributions

Definition at line 823 of file Assembly.h.

Referenced by init(), jacobianBlock(), and jacobianBlockNeighbor().

std::vector<std::vector<DenseMatrix<Number> > > Assembly::_sub_Keg
protected

Definition at line 824 of file Assembly.h.

Referenced by init(), and jacobianBlockNonlocal().

std::vector<std::vector<DenseMatrix<Number> > > Assembly::_sub_Ken
protected

jacobian contributions from the element and neighbor

Definition at line 827 of file Assembly.h.

Referenced by init(), and jacobianBlockNeighbor().

std::vector<std::vector<DenseMatrix<Number> > > Assembly::_sub_Kne
protected

jacobian contributions from the neighbor and element

Definition at line 829 of file Assembly.h.

Referenced by init(), and jacobianBlockNeighbor().

std::vector<std::vector<DenseMatrix<Number> > > Assembly::_sub_Knn
protected

jacobian contributions from the neighbor

Definition at line 831 of file Assembly.h.

Referenced by init(), and jacobianBlockNeighbor().

std::vector<std::vector<DenseVector<Number> > > Assembly::_sub_Re
protected

residual contributions for each variable from the element

Definition at line 816 of file Assembly.h.

Referenced by addCachedResiduals(), addResidual(), addResidualScalar(), cacheResidual(), cacheResidualNeighbor(), init(), prepare(), prepareBlock(), prepareScalar(), prepareVariable(), and setResidual().

std::vector<std::vector<DenseVector<Number> > > Assembly::_sub_Rn
protected

residual contributions for each variable from the neighbor

Definition at line 818 of file Assembly.h.

Referenced by addResidualNeighbor(), cacheResidualNeighbor(), init(), prepareNeighbor(), and setResidualNeighbor().

SystemBase& Assembly::_sys
protected
std::vector<dof_id_type> Assembly::_temp_dof_indices
protected

Temporary work vector to keep from reallocating it.

Definition at line 922 of file Assembly.h.

Referenced by addResidualBlock(), and cacheResidualBlock().

std::vector<Point> Assembly::_temp_reference_points
protected

Temporary work data for reinitAtPhysical()

Definition at line 925 of file Assembly.h.

Referenced by reinitAtPhysical().

THREAD_ID Assembly::_tid
protected
DenseMatrix<Number> Assembly::_tmp_Ke
protected

auxiliary matrix for scaling jacobians (optimization to avoid expensive construction/destruction)

Definition at line 834 of file Assembly.h.

Referenced by addJacobianBlock(), ad