18#include "libmesh/node.h"
19#include "libmesh/elem.h"
28 params.
addClassDescription(
"Creates an AD material property for a variable transferred from the "
29 "boundary of a 2D mesh onto a 1D mesh.");
32 params.
addRequiredParam<std::string>(
"paired_variable",
"The variable to get the value of.");
35 "The name of the material property that will be "
36 "declared that will represent the transferred variable.");
44 _nl_sys(_subproblem.systemBaseNonlinear(0)),
45 _serialized_solution(_nl_sys.currentSolution()),
47 _subproblem.getVariable(_tid, getParam<
std::string>(
"paired_variable"),
Moose::VAR_SOLVER)
49 _mesh_alignment(*getParam<
MeshAlignment *>(
"_mesh_alignment")),
50 _prop(declareADProperty<Real>(getParam<MaterialPropertyName>(
"property_name"))),
51 _phi(_assembly.fePhi<Real>(FEType(FIRST, LAGRANGE)))
58 std::vector<ADReal> nodal_values;
65 const Node *
const coupled_node =
_mesh.
nodePtr(coupled_node_id);
71 for (
const auto qp : make_range(
_qrule->n_points()))
75 _prop[qp] += nodal_values[i] *
_phi[i][qp];
registerMooseObject("ThermalHydraulicsApp", MeshAlignmentVariableTransferMaterial)
static InputParameters validParams()
const Elem *const & _current_elem
const QBase *const & _qrule
Creates an AD material property for a variable transferred from the boundary of a 2D mesh onto a 1D m...
MeshAlignmentVariableTransferMaterial(const InputParameters ¶meters)
static InputParameters validParams()
const VariablePhiValue & _phi
Basis function for transferred variable.
ADMaterialProperty< Real > & _prop
Material property for the transferred variable.
unsigned int _paired_variable
Variable number of the variable to transfer.
virtual void computeProperties() override
const NumericVector< Number > *const & _serialized_solution
Solution vector.
const SystemBase & _nl_sys
Nonlinear system.
const MeshAlignment & _mesh_alignment
Mesh alignment object.
Builds mapping between two aligned subdomains/boundaries.
const dof_id_type & getCoupledNodeID(const dof_id_type &node_id) const
Gets the coupled node ID for a given node ID.
virtual const Node * nodePtr(const dof_id_type i) const
unsigned int number() const
void derivInsert(SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N > > &derivs, libMesh::dof_id_type index, Real value)