libMesh
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
libMesh::HDGProblem Class Referenceabstract

#include <hdg_problem.h>

Inheritance diagram for libMesh::HDGProblem:
[legend]

Public Member Functions

 HDGProblem (const Real nu_in, const bool cavity_in)
 
 ~HDGProblem ()
 
void init ()
 
virtual void residual (const NumericVector< Number > &X, NumericVector< Number > &R, NonlinearImplicitSystem &S) override
 
virtual void jacobian (const NumericVector< Number > &X, SparseMatrix< Number > &, NonlinearImplicitSystem &S) override
 
virtual void residual (const NumericVector< Number > &X, NumericVector< Number > &R, sys_type &S)=0
 Residual function. More...
 
virtual void jacobian (const NumericVector< Number > &X, SparseMatrix< Number > &J, sys_type &S)=0
 Jacobian function. More...
 

Public Attributes

Systemsystem
 
const MeshBasemesh
 
const DofMapdof_map
 
StaticCondensationsc
 
std::unique_ptr< FEVectorBasevector_fe
 
std::unique_ptr< FEBasescalar_fe
 
std::unique_ptr< QBaseqrule
 
std::unique_ptr< FEVectorBasevector_fe_face
 
std::unique_ptr< FEBasescalar_fe_face
 
std::unique_ptr< FEBaselm_fe_face
 
std::unique_ptr< QBaseqface
 
boundary_id_type left_bnd
 
boundary_id_type top_bnd
 
boundary_id_type right_bnd
 
boundary_id_type bottom_bnd
 
Real nu
 
bool cavity
 
const USoln u_true_soln
 
const VSoln v_true_soln
 
const PSoln p_true_soln
 
bool mms
 

Private Member Functions

void add_matrix (NonlinearImplicitSystem &sys, const unsigned int ivar_num, const unsigned int jvar_num, const DenseMatrix< Number > &elem_mat)
 
void create_identity_residual (const QBase &quadrature, const std::vector< Real > &JxW_local, const std::vector< std::vector< Real >> &phi, const std::vector< Number > &sol, const std::size_t n_dofs, DenseVector< Number > &R)
 
void create_identity_jacobian (const QBase &quadrature, const std::vector< Real > &JxW_local, const std::vector< std::vector< Real >> &phi, const std::size_t n_dofs, DenseMatrix< Number > &J)
 
void compute_stress (const std::vector< Gradient > &vel_gradient, const unsigned int vel_component, std::vector< Gradient > &sigma)
 
void vector_volume_residual (const std::vector< Gradient > &vector_sol, const std::vector< Number > &scalar_sol, DenseVector< Number > &R)
 
void vector_volume_jacobian (DenseMatrix< Number > &Jqq, DenseMatrix< Number > &Jqs)
 
NumberVectorValue vel_cross_vel_residual (const std::vector< Number > &u_sol_local, const std::vector< Number > &v_sol_local, const unsigned int qp, const unsigned int vel_component) const
 
NumberVectorValue vel_cross_vel_jacobian (const std::vector< Number > &u_sol_local, const std::vector< Number > &v_sol_local, const unsigned int qp, const unsigned int vel_component, const unsigned int vel_j_component, const std::vector< std::vector< Real >> &phi, const unsigned int j) const
 
void scalar_volume_residual (const std::vector< Gradient > &vel_gradient, const unsigned int vel_component, std::vector< Gradient > &sigma, DenseVector< Number > &R)
 
void scalar_volume_jacobian (const unsigned int vel_component, DenseMatrix< Number > &Jsq, DenseMatrix< Number > &Jsp, DenseMatrix< Number > &Jsu, DenseMatrix< Number > &Jsv)
 
void pressure_volume_residual (DenseVector< Number > &Rp, DenseVector< Number > &Rglm)
 
void pressure_volume_jacobian (DenseMatrix< Number > &Jpu, DenseMatrix< Number > &Jpv, DenseMatrix< Number > &Jpglm, DenseMatrix< Number > &Jglmp)
 
void pressure_face_residual (DenseVector< Number > &R)
 
void pressure_face_jacobian (DenseMatrix< Number > &Jplm_u, DenseMatrix< Number > &Jplm_v)
 
RealVectorValue get_dirichlet_velocity (const unsigned int qp) const
 
void pressure_dirichlet_residual (DenseVector< Number > &R)
 
void vector_dirichlet_residual (const unsigned int vel_component, DenseVector< Number > &R)
 
void vector_face_residual (const std::vector< Number > &lm_sol, DenseVector< Number > &R)
 
void vector_face_jacobian (DenseMatrix< Number > &Jqlm)
 
void scalar_dirichlet_residual (const std::vector< Gradient > &vector_sol, const std::vector< Number > &scalar_sol, const unsigned int vel_component, DenseVector< Number > &R)
 
void scalar_dirichlet_jacobian (const unsigned int vel_component, DenseMatrix< Number > &Jsq, DenseMatrix< Number > &Jsp, DenseMatrix< Number > &Jss)
 
void scalar_face_residual (const std::vector< Gradient > &vector_sol, const std::vector< Number > &scalar_sol, const std::vector< Number > &lm_sol, const unsigned int vel_component, DenseVector< Number > &R)
 
void scalar_face_jacobian (const unsigned int vel_component, DenseMatrix< Number > &Jsq, DenseMatrix< Number > &Jsp, DenseMatrix< Number > &Jss, DenseMatrix< Number > &Jslm, DenseMatrix< Number > &Js_lmu, DenseMatrix< Number > &Js_lmv)
 
void lm_face_residual (const std::vector< Gradient > &vector_sol, const std::vector< Number > &scalar_sol, const std::vector< Number > &lm_sol, const unsigned int vel_component, DenseVector< Number > &R)
 
void lm_face_jacobian (const unsigned int vel_component, DenseMatrix< Number > &Jlmq, DenseMatrix< Number > &Jlmp, DenseMatrix< Number > &Jlms, DenseMatrix< Number > &Jlmlm, DenseMatrix< Number > &Jlm_lmu, DenseMatrix< Number > &Jlm_lmv)
 

Private Attributes

const std::vector< Real > * JxW
 
const std::vector< Point > * q_point
 
const std::vector< std::vector< RealVectorValue > > * vector_phi
 
const std::vector< std::vector< Real > > * scalar_phi
 
const std::vector< std::vector< RealVectorValue > > * grad_scalar_phi
 
const std::vector< std::vector< Real > > * div_vector_phi
 
const std::vector< Real > * JxW_face
 
const std::vector< Point > * qface_point
 
const std::vector< std::vector< RealVectorValue > > * vector_phi_face
 
const std::vector< std::vector< Real > > * scalar_phi_face
 
const std::vector< std::vector< Real > > * lm_phi_face
 
const std::vector< Point > * normals
 
std::unordered_map< unsigned int, std::vector< dof_id_type > > dof_indices
 
std::vector< Gradientqu_sol
 
std::vector< Numberu_sol
 
std::vector< Numberlm_u_sol
 
std::vector< Gradientqv_sol
 
std::vector< Numberv_sol
 
std::vector< Numberlm_v_sol
 
std::vector< Numberp_sol
 
std::vector< Gradientsigma_u
 
std::vector< Gradientsigma_v
 
std::vector< Numberqu_dof_values
 
std::vector< Numberu_dof_values
 
std::vector< Numberlm_u_dof_values
 
std::vector< Numberqv_dof_values
 
std::vector< Numberv_dof_values
 
std::vector< Numberlm_v_dof_values
 
std::vector< Numberp_dof_values
 
Number global_lm_dof_value
 
std::size_t vector_n_dofs
 
std::size_t scalar_n_dofs
 
std::size_t lm_n_dofs
 
std::size_t p_n_dofs
 
std::size_t global_lm_n_dofs
 
boundary_id_type current_bnd
 
const Elemneigh
 
std::vector< Numberqbar
 

Static Private Attributes

static constexpr Real tau = 1
 

Detailed Description

Definition at line 36 of file hdg_problem.h.

Constructor & Destructor Documentation

◆ HDGProblem()

libMesh::HDGProblem::HDGProblem ( const Real  nu_in,
const bool  cavity_in 
)

Definition at line 55 of file hdg_problem.C.

56  : nu(nu_in),
57  cavity(cavity_in),
61 {
62 }
const VSoln v_true_soln
Definition: hdg_problem.h:72
const PSoln p_true_soln
Definition: hdg_problem.h:73
const USoln u_true_soln
Definition: hdg_problem.h:71

◆ ~HDGProblem()

libMesh::HDGProblem::~HDGProblem ( )
default

Member Function Documentation

◆ add_matrix()

void libMesh::HDGProblem::add_matrix ( NonlinearImplicitSystem sys,
const unsigned int  ivar_num,
const unsigned int  jvar_num,
const DenseMatrix< Number > &  elem_mat 
)
private

Definition at line 888 of file hdg_problem.C.

References libMesh::SparseMatrix< T >::add_matrix(), dof_indices, and libMesh::ImplicitSystem::get_system_matrix().

Referenced by jacobian().

892 {
893  sys.get_system_matrix().add_matrix(
894  elem_mat, libmesh_map_find(dof_indices, ivar_num), libmesh_map_find(dof_indices, jvar_num));
895 }
std::unordered_map< unsigned int, std::vector< dof_id_type > > dof_indices
Definition: hdg_problem.h:217

◆ compute_stress()

void libMesh::HDGProblem::compute_stress ( const std::vector< Gradient > &  vel_gradient,
const unsigned int  vel_component,
std::vector< Gradient > &  sigma 
)
private

Definition at line 133 of file hdg_problem.C.

References libMesh::make_range(), nu, p_sol, and qrule.

Referenced by scalar_volume_residual().

136 {
137  sigma.resize(qrule->n_points());
138  for (const auto qp : make_range(qrule->n_points()))
139  {
140  Gradient qp_p;
141  qp_p(vel_component) = p_sol[qp];
142  sigma[qp] = nu * vel_gradient[qp] - qp_p;
143  }
144 }
std::vector< Number > p_sol
Definition: hdg_problem.h:226
std::unique_ptr< QBase > qrule
Definition: hdg_problem.h:52
NumberVectorValue Gradient
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140

◆ create_identity_jacobian()

void libMesh::HDGProblem::create_identity_jacobian ( const QBase quadrature,
const std::vector< Real > &  JxW_local,
const std::vector< std::vector< Real >> &  phi,
const std::size_t  n_dofs,
DenseMatrix< Number > &  J 
)
private

Definition at line 120 of file hdg_problem.C.

References libMesh::make_range(), and libMesh::QBase::n_points().

Referenced by jacobian().

125 {
126  for (const auto qp : make_range(quadrature.n_points()))
127  for (const auto i : make_range(n_dofs))
128  for (const auto j : make_range(n_dofs))
129  J(i, j) -= JxW_local[qp] * phi[i][qp] * phi[j][qp];
130 }
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140

◆ create_identity_residual()

void libMesh::HDGProblem::create_identity_residual ( const QBase quadrature,
const std::vector< Real > &  JxW_local,
const std::vector< std::vector< Real >> &  phi,
const std::vector< Number > &  sol,
const std::size_t  n_dofs,
DenseVector< Number > &  R 
)
private

Definition at line 107 of file hdg_problem.C.

References libMesh::make_range(), and libMesh::QBase::n_points().

Referenced by residual().

113 {
114  for (const auto qp : make_range(quadrature.n_points()))
115  for (const auto i : make_range(n_dofs))
116  R(i) -= JxW_local[qp] * phi[i][qp] * sol[qp];
117 }
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140

◆ get_dirichlet_velocity()

RealVectorValue libMesh::HDGProblem::get_dirichlet_velocity ( const unsigned int  qp) const
private

Definition at line 373 of file hdg_problem.C.

References cavity, current_bnd, left_bnd, libMesh::libmesh_assert(), mms, qface_point, right_bnd, top_bnd, u_true_soln, and v_true_soln.

Referenced by pressure_dirichlet_residual(), scalar_dirichlet_residual(), and vector_dirichlet_residual().

374 {
375  if (mms)
377 
378  if (cavity)
379  {
380  if (current_bnd == top_bnd)
381  return RealVectorValue(1, 0);
382  else
383  return RealVectorValue(0, 0);
384  }
385  else // channel flow case
386  {
388 
389  if (current_bnd == left_bnd)
390  return RealVectorValue(1, 0);
391 
392  else
393  return RealVectorValue(0, 0);
394  }
395 }
boundary_id_type current_bnd
Definition: hdg_problem.h:253
VectorValue< Real > RealVectorValue
Useful typedefs to allow transparent switching between Real and Complex data types.
const VSoln v_true_soln
Definition: hdg_problem.h:72
boundary_id_type top_bnd
Definition: hdg_problem.h:60
libmesh_assert(ctx)
boundary_id_type left_bnd
Definition: hdg_problem.h:59
const std::vector< Point > * qface_point
Definition: hdg_problem.h:210
const USoln u_true_soln
Definition: hdg_problem.h:71
boundary_id_type right_bnd
Definition: hdg_problem.h:61

◆ init()

void libMesh::HDGProblem::init ( )

Definition at line 67 of file hdg_problem.C.

References bottom_bnd, cavity, div_vector_phi, libMesh::MeshBase::get_boundary_info(), global_lm_n_dofs, grad_scalar_phi, libMesh::BoundaryInfo::invalid_id, JxW, JxW_face, left_bnd, libMesh::libmesh_assert(), lm_fe_face, lm_phi_face, mesh, normals, q_point, qface, qface_point, qrule, right_bnd, scalar_fe, scalar_fe_face, scalar_phi, scalar_phi_face, top_bnd, vector_fe, vector_fe_face, vector_phi, and vector_phi_face.

Referenced by main().

68 {
69  // Attach quadrature rules for the FE objects that we will reinit within the element "volume"
70  vector_fe->attach_quadrature_rule(qrule.get());
71  scalar_fe->attach_quadrature_rule(qrule.get());
72 
73  // Attach quadrature rules for the FE objects that we will reinit on the element faces
74  vector_fe_face->attach_quadrature_rule(qface.get());
75  scalar_fe_face->attach_quadrature_rule(qface.get());
76  lm_fe_face->attach_quadrature_rule(qface.get());
77 
78  // pre-request our required volumetric data
79  JxW = &vector_fe->get_JxW();
80  q_point = &vector_fe->get_xyz();
81  vector_phi = &vector_fe->get_phi();
82  scalar_phi = &scalar_fe->get_phi();
83  grad_scalar_phi = &scalar_fe->get_dphi();
84  div_vector_phi = &vector_fe->get_div_phi();
85 
86  // pre-request our required element face data
87  vector_phi_face = &vector_fe_face->get_phi();
88  scalar_phi_face = &scalar_fe_face->get_phi();
89  lm_phi_face = &lm_fe_face->get_phi();
90  JxW_face = &vector_fe_face->get_JxW();
91  qface_point = &vector_fe_face->get_xyz();
92  normals = &vector_fe_face->get_normals();
93 
94  const auto & bnd_info = mesh->get_boundary_info();
95  left_bnd = bnd_info.get_id_by_name("left");
96  top_bnd = bnd_info.get_id_by_name("top");
97  right_bnd = bnd_info.get_id_by_name("right");
98  bottom_bnd = bnd_info.get_id_by_name("bottom");
103  global_lm_n_dofs = cavity ? 1 : 0;
104 }
const std::vector< std::vector< Real > > * scalar_phi_face
Definition: hdg_problem.h:212
boundary_id_type bottom_bnd
Definition: hdg_problem.h:62
std::unique_ptr< QBase > qface
Definition: hdg_problem.h:56
const std::vector< std::vector< Real > > * scalar_phi
Definition: hdg_problem.h:204
const std::vector< std::vector< RealVectorValue > > * vector_phi_face
Definition: hdg_problem.h:211
const std::vector< std::vector< RealVectorValue > > * vector_phi
Definition: hdg_problem.h:203
std::unique_ptr< FEVectorBase > vector_fe
Definition: hdg_problem.h:50
std::unique_ptr< FEBase > lm_fe_face
Definition: hdg_problem.h:55
std::unique_ptr< FEBase > scalar_fe
Definition: hdg_problem.h:51
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
Definition: mesh_base.h:165
const std::vector< Real > * JxW_face
Definition: hdg_problem.h:209
const std::vector< Real > * JxW
Definition: hdg_problem.h:201
const std::vector< std::vector< Real > > * div_vector_phi
Definition: hdg_problem.h:206
const std::vector< Point > * q_point
Definition: hdg_problem.h:202
static const boundary_id_type invalid_id
Number used for internal use.
boundary_id_type top_bnd
Definition: hdg_problem.h:60
std::size_t global_lm_n_dofs
Definition: hdg_problem.h:247
std::unique_ptr< QBase > qrule
Definition: hdg_problem.h:52
const std::vector< std::vector< Real > > * lm_phi_face
Definition: hdg_problem.h:213
libmesh_assert(ctx)
std::unique_ptr< FEBase > scalar_fe_face
Definition: hdg_problem.h:54
const std::vector< Point > * normals
Definition: hdg_problem.h:214
const MeshBase * mesh
Definition: hdg_problem.h:45
boundary_id_type left_bnd
Definition: hdg_problem.h:59
const std::vector< Point > * qface_point
Definition: hdg_problem.h:210
const std::vector< std::vector< RealVectorValue > > * grad_scalar_phi
Definition: hdg_problem.h:205
boundary_id_type right_bnd
Definition: hdg_problem.h:61
std::unique_ptr< FEVectorBase > vector_fe_face
Definition: hdg_problem.h:53

◆ jacobian() [1/2]

void libMesh::HDGProblem::jacobian ( const NumericVector< Number > &  X,
SparseMatrix< Number > &  ,
NonlinearImplicitSystem S 
)
overridevirtual

Definition at line 898 of file hdg_problem.C.

References libMesh::SparseMatrix< T >::add(), add_matrix(), cavity, libMesh::compute_qp_soln(), create_identity_jacobian(), current_bnd, dof_indices, libMesh::DofMap::dof_indices(), dof_map, libMesh::NumericVector< T >::get(), libMesh::MeshBase::get_boundary_info(), libMesh::ImplicitSystem::get_system_matrix(), global_lm_dof_value, libMesh::invalid_uint, JxW_face, libMesh::libmesh_assert(), lm_face_jacobian(), lm_fe_face, lm_n_dofs, lm_phi_face, lm_u_dof_values, lm_u_sol, lm_v_dof_values, lm_v_sol, libMesh::make_range(), mesh, neigh, libMesh::Elem::neighbor_ptr(), p_dof_values, p_n_dofs, p_sol, pressure_face_jacobian(), pressure_volume_jacobian(), qface, qrule, qu_dof_values, qu_sol, qv_dof_values, qv_sol, libMesh::DenseMatrix< T >::resize(), right_bnd, sc, scalar_dirichlet_jacobian(), scalar_face_jacobian(), scalar_fe, scalar_fe_face, scalar_n_dofs, scalar_phi, scalar_phi_face, scalar_volume_jacobian(), libMesh::StaticCondensation::set_current_elem(), u_dof_values, u_sol, v_dof_values, v_sol, libMesh::System::variable_number(), vector_face_jacobian(), vector_fe, vector_fe_face, vector_n_dofs, vector_phi, vector_phi_face, and vector_volume_jacobian().

901 {
902  auto * J = &S.get_system_matrix();
903 
904  if (!sc)
905  // PETSc requires that the Jacobian matrix have a diagonal for some types of preconditioners
906  for (const auto i : make_range(J->row_start(), J->row_stop()))
907  J->add(i, i, 0);
908 
909  const auto u_num = S.variable_number("vel_x");
910  const auto v_num = S.variable_number("vel_y");
911  const auto qu_num = S.variable_number("qu");
912  const auto qv_num = S.variable_number("qv");
913  const auto lm_u_num = S.variable_number("lm_u");
914  const auto lm_v_num = S.variable_number("lm_v");
915  const auto p_num = S.variable_number("pressure");
916  const auto global_lm_num = cavity ? S.variable_number("global_lm") : invalid_uint;
917 
918  auto & qu_dof_indices = dof_indices[qu_num];
919  auto & u_dof_indices = dof_indices[u_num];
920  auto & lm_u_dof_indices = dof_indices[lm_u_num];
921  auto & qv_dof_indices = dof_indices[qv_num];
922  auto & v_dof_indices = dof_indices[v_num];
923  auto & lm_v_dof_indices = dof_indices[lm_v_num];
924  auto & p_dof_indices = dof_indices[p_num];
925  static std::vector<dof_id_type> dummy_indices;
926  auto & global_lm_dof_indices = cavity ? dof_indices[global_lm_num] : dummy_indices;
927 
928  std::vector<boundary_id_type> boundary_ids;
929  const auto & boundary_info = mesh->get_boundary_info();
930 
931  DenseMatrix<Number> Jqu_qu, Jqv_qv, Jqu_u, Jqv_v, Ju_qu, Jv_qv, Ju_p, Jv_p, Ju_u, Jv_u, Ju_v,
932  Jv_v, Jp_u, Jp_v, Jp_glm, Jglm_p, Jp_lmu, Jp_lmv, Jqu_lmu, Jqv_lmv, Ju_lmu, Jv_lmv, Jv_lmu,
933  Ju_lmv, Jlmu_qu, Jlmv_qv, Jlmu_p, Jlmv_p, Jlmu_u, Jlmv_v, Jlmu_lmu, Jlmv_lmu, Jlmu_lmv,
934  Jlmv_lmv;
935 
936  for (const auto & elem : mesh->active_local_element_ptr_range())
937  {
938  if (sc)
939  sc->set_current_elem(*elem);
940 
941  // Retrive our dof indices for all fields
942  dof_map->dof_indices(elem, qu_dof_indices, qu_num);
943  dof_map->dof_indices(elem, u_dof_indices, u_num);
944  dof_map->dof_indices(elem, lm_u_dof_indices, lm_u_num);
945  dof_map->dof_indices(elem, qv_dof_indices, qv_num);
946  dof_map->dof_indices(elem, v_dof_indices, v_num);
947  dof_map->dof_indices(elem, lm_v_dof_indices, lm_v_num);
948  dof_map->dof_indices(elem, p_dof_indices, p_num);
949  if (cavity)
950  {
951  dof_map->dof_indices(elem, global_lm_dof_indices, global_lm_num);
952  libmesh_assert(global_lm_dof_indices.size() == 1);
953  }
954 
955  vector_n_dofs = qu_dof_indices.size();
956  scalar_n_dofs = u_dof_indices.size();
957  lm_n_dofs = lm_u_dof_indices.size();
958  p_n_dofs = p_dof_indices.size();
960 
961  Jqu_qu.resize(qu_dof_indices.size(), qu_dof_indices.size());
962  Jqv_qv.resize(qv_dof_indices.size(), qv_dof_indices.size());
963  Jqu_u.resize(qu_dof_indices.size(), u_dof_indices.size());
964  Jqv_v.resize(qv_dof_indices.size(), v_dof_indices.size());
965  Ju_qu.resize(u_dof_indices.size(), qu_dof_indices.size());
966  Jv_qv.resize(v_dof_indices.size(), qv_dof_indices.size());
967  Ju_p.resize(u_dof_indices.size(), p_dof_indices.size());
968  Jv_p.resize(v_dof_indices.size(), p_dof_indices.size());
969  Ju_u.resize(u_dof_indices.size(), u_dof_indices.size());
970  Jv_u.resize(v_dof_indices.size(), u_dof_indices.size());
971  Ju_v.resize(u_dof_indices.size(), v_dof_indices.size());
972  Jv_v.resize(v_dof_indices.size(), v_dof_indices.size());
973  Jp_u.resize(p_dof_indices.size(), u_dof_indices.size());
974  Jp_v.resize(p_dof_indices.size(), v_dof_indices.size());
975  Jp_glm.resize(p_dof_indices.size(), global_lm_dof_indices.size());
976  Jglm_p.resize(global_lm_dof_indices.size(), p_dof_indices.size());
977  Jp_lmu.resize(p_dof_indices.size(), lm_u_dof_indices.size());
978  Jp_lmv.resize(p_dof_indices.size(), lm_v_dof_indices.size());
979  Jqu_lmu.resize(qu_dof_indices.size(), lm_u_dof_indices.size());
980  Jqv_lmv.resize(qv_dof_indices.size(), lm_v_dof_indices.size());
981  Ju_lmu.resize(u_dof_indices.size(), lm_u_dof_indices.size());
982  Jv_lmv.resize(v_dof_indices.size(), lm_v_dof_indices.size());
983  Jv_lmu.resize(v_dof_indices.size(), lm_u_dof_indices.size());
984  Ju_lmv.resize(u_dof_indices.size(), lm_v_dof_indices.size());
985  Jlmu_qu.resize(lm_u_dof_indices.size(), qu_dof_indices.size());
986  Jlmv_qv.resize(lm_v_dof_indices.size(), qv_dof_indices.size());
987  Jlmu_p.resize(lm_u_dof_indices.size(), p_dof_indices.size());
988  Jlmv_p.resize(lm_v_dof_indices.size(), p_dof_indices.size());
989  Jlmu_u.resize(lm_u_dof_indices.size(), u_dof_indices.size());
990  Jlmv_v.resize(lm_v_dof_indices.size(), v_dof_indices.size());
991  Jlmu_lmu.resize(lm_u_dof_indices.size(), lm_u_dof_indices.size());
992  Jlmv_lmu.resize(lm_v_dof_indices.size(), lm_u_dof_indices.size());
993  Jlmu_lmv.resize(lm_u_dof_indices.size(), lm_v_dof_indices.size());
994  Jlmv_lmv.resize(lm_v_dof_indices.size(), lm_v_dof_indices.size());
995 
996  // Reinit our volume FE objects
997  vector_fe->reinit(elem);
998  scalar_fe->reinit(elem);
999 
1000  libmesh_assert_equal_to(vector_n_dofs, vector_phi->size());
1001  libmesh_assert_equal_to(scalar_n_dofs, scalar_phi->size());
1002 
1003  // Get our local element dof values
1004  X.get(qu_dof_indices, qu_dof_values);
1005  X.get(u_dof_indices, u_dof_values);
1006  X.get(lm_u_dof_indices, lm_u_dof_values);
1007  X.get(qv_dof_indices, qv_dof_values);
1008  X.get(v_dof_indices, v_dof_values);
1009  X.get(lm_v_dof_indices, lm_v_dof_values);
1010  X.get(p_dof_indices, p_dof_values);
1011  if (cavity)
1012  global_lm_dof_value = X(global_lm_dof_indices[0]);
1013 
1014  // Compute volumetric local qp solutions
1020 
1021  //
1022  // compute volumetric residuals and Jacobians
1023  //
1024 
1025  // qu and u
1026  vector_volume_jacobian(Jqu_qu, Jqu_u);
1027  scalar_volume_jacobian(0, Ju_qu, Ju_p, Ju_u, Ju_v);
1028 
1029  // qv and v
1030  vector_volume_jacobian(Jqv_qv, Jqv_v);
1031  scalar_volume_jacobian(1, Jv_qv, Jv_p, Jv_u, Jv_v);
1032 
1033  // p
1034  pressure_volume_jacobian(Jp_u, Jp_v, Jp_glm, Jglm_p);
1035 
1036  for (auto side : elem->side_index_range())
1037  {
1038  neigh = elem->neighbor_ptr(side);
1039 
1040  // Reinit our face FE objects
1041  vector_fe_face->reinit(elem, side);
1042  scalar_fe_face->reinit(elem, side);
1043  lm_fe_face->reinit(elem, side);
1044 
1045  // Compute face local qp solutions
1053 
1054  if (neigh == nullptr)
1055  {
1056  boundary_info.boundary_ids(elem, side, boundary_ids);
1057  libmesh_assert(boundary_ids.size() == 1);
1058  current_bnd = boundary_ids[0];
1059  if (cavity || (current_bnd != right_bnd))
1060  {
1061  // qu, u
1062  scalar_dirichlet_jacobian(0, Ju_qu, Ju_p, Ju_u);
1063 
1064  // qv, v
1065  scalar_dirichlet_jacobian(1, Jv_qv, Jv_p, Jv_v);
1066 
1067  // Set the LMs on these Dirichlet boundary faces to 0
1070 
1071  continue;
1072  }
1073  }
1074 
1075  //
1076  // if we got here, then we are on an internal face or an outlet face
1077  //
1078 
1079  // qu, u, lm_u
1080  vector_face_jacobian(Jqu_lmu);
1081  scalar_face_jacobian(0, Ju_qu, Ju_p, Ju_u, Ju_lmu, Ju_lmu, Ju_lmv);
1082  lm_face_jacobian(0, Jlmu_qu, Jlmu_p, Jlmu_u, Jlmu_lmu, Jlmu_lmu, Jlmu_lmv);
1083 
1084  // qv, v, lm_v
1085  vector_face_jacobian(Jqv_lmv);
1086  scalar_face_jacobian(1, Jv_qv, Jv_p, Jv_v, Jv_lmv, Jv_lmu, Jv_lmv);
1087  lm_face_jacobian(1, Jlmv_qv, Jlmv_p, Jlmv_v, Jlmv_lmv, Jlmv_lmu, Jlmv_lmv);
1088 
1089  // p
1090  pressure_face_jacobian(Jp_lmu, Jp_lmv);
1091  }
1092 
1093  add_matrix(S, qu_num, qu_num, Jqu_qu);
1094  add_matrix(S, qv_num, qv_num, Jqv_qv);
1095  add_matrix(S, qu_num, u_num, Jqu_u);
1096  add_matrix(S, qv_num, v_num, Jqv_v);
1097  add_matrix(S, u_num, qu_num, Ju_qu);
1098  add_matrix(S, v_num, qv_num, Jv_qv);
1099  add_matrix(S, u_num, p_num, Ju_p);
1100  add_matrix(S, v_num, p_num, Jv_p);
1101  add_matrix(S, u_num, u_num, Ju_u);
1102  add_matrix(S, v_num, u_num, Jv_u);
1103  add_matrix(S, u_num, v_num, Ju_v);
1104  add_matrix(S, v_num, v_num, Jv_v);
1105  add_matrix(S, p_num, u_num, Jp_u);
1106  add_matrix(S, p_num, v_num, Jp_v);
1107  if (global_lm_num != invalid_uint)
1108  {
1109  add_matrix(S, p_num, global_lm_num, Jp_glm);
1110  add_matrix(S, global_lm_num, p_num, Jglm_p);
1111  }
1112  add_matrix(S, p_num, lm_u_num, Jp_lmu);
1113  add_matrix(S, p_num, lm_v_num, Jp_lmv);
1114  add_matrix(S, qu_num, lm_u_num, Jqu_lmu);
1115  add_matrix(S, qv_num, lm_v_num, Jqv_lmv);
1116  add_matrix(S, u_num, lm_u_num, Ju_lmu);
1117  add_matrix(S, v_num, lm_v_num, Jv_lmv);
1118  add_matrix(S, v_num, lm_u_num, Jv_lmu);
1119  add_matrix(S, u_num, lm_v_num, Ju_lmv);
1120  add_matrix(S, lm_u_num, qu_num, Jlmu_qu);
1121  add_matrix(S, lm_v_num, qv_num, Jlmv_qv);
1122  add_matrix(S, lm_u_num, p_num, Jlmu_p);
1123  add_matrix(S, lm_v_num, p_num, Jlmv_p);
1124  add_matrix(S, lm_u_num, u_num, Jlmu_u);
1125  add_matrix(S, lm_v_num, v_num, Jlmv_v);
1126  add_matrix(S, lm_u_num, lm_u_num, Jlmu_lmu);
1127  add_matrix(S, lm_v_num, lm_u_num, Jlmv_lmu);
1128  add_matrix(S, lm_u_num, lm_v_num, Jlmu_lmv);
1129  add_matrix(S, lm_v_num, lm_v_num, Jlmv_lmv);
1130  }
1131 
1132  J->close();
1133 }
const std::vector< std::vector< Real > > * scalar_phi_face
Definition: hdg_problem.h:212
void scalar_face_jacobian(const unsigned int vel_component, DenseMatrix< Number > &Jsq, DenseMatrix< Number > &Jsp, DenseMatrix< Number > &Jss, DenseMatrix< Number > &Jslm, DenseMatrix< Number > &Js_lmu, DenseMatrix< Number > &Js_lmv)
Definition: hdg_problem.C:551
std::unique_ptr< QBase > qface
Definition: hdg_problem.h:56
void create_identity_jacobian(const QBase &quadrature, const std::vector< Real > &JxW_local, const std::vector< std::vector< Real >> &phi, const std::size_t n_dofs, DenseMatrix< Number > &J)
Definition: hdg_problem.C:120
const std::vector< std::vector< Real > > * scalar_phi
Definition: hdg_problem.h:204
const std::vector< std::vector< RealVectorValue > > * vector_phi_face
Definition: hdg_problem.h:211
void lm_face_jacobian(const unsigned int vel_component, DenseMatrix< Number > &Jlmq, DenseMatrix< Number > &Jlmp, DenseMatrix< Number > &Jlms, DenseMatrix< Number > &Jlmlm, DenseMatrix< Number > &Jlm_lmu, DenseMatrix< Number > &Jlm_lmv)
Definition: hdg_problem.C:657
const std::vector< std::vector< RealVectorValue > > * vector_phi
Definition: hdg_problem.h:203
void set_current_elem(const Elem &elem)
Set the current element.
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:310
std::unique_ptr< FEVectorBase > vector_fe
Definition: hdg_problem.h:50
boundary_id_type current_bnd
Definition: hdg_problem.h:253
virtual void get(const std::vector< numeric_index_type > &index, T *values) const
Access multiple components at once.
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition: dof_map.C:2164
std::unique_ptr< FEBase > lm_fe_face
Definition: hdg_problem.h:55
std::vector< Number > v_sol
Definition: hdg_problem.h:224
std::vector< Number > p_sol
Definition: hdg_problem.h:226
const DofMap * dof_map
Definition: hdg_problem.h:46
std::unique_ptr< FEBase > scalar_fe
Definition: hdg_problem.h:51
std::vector< Number > v_dof_values
Definition: hdg_problem.h:237
void scalar_volume_jacobian(const unsigned int vel_component, DenseMatrix< Number > &Jsq, DenseMatrix< Number > &Jsp, DenseMatrix< Number > &Jsu, DenseMatrix< Number > &Jsv)
Definition: hdg_problem.C:240
const Elem * neigh
Definition: hdg_problem.h:256
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
Definition: mesh_base.h:165
const std::vector< Real > * JxW_face
Definition: hdg_problem.h:209
std::size_t lm_n_dofs
Definition: hdg_problem.h:245
std::vector< Number > lm_u_sol
Definition: hdg_problem.h:222
std::unordered_map< unsigned int, std::vector< dof_id_type > > dof_indices
Definition: hdg_problem.h:217
std::vector< Number > qv_dof_values
Definition: hdg_problem.h:236
std::vector< Number > p_dof_values
Definition: hdg_problem.h:239
std::unique_ptr< QBase > qrule
Definition: hdg_problem.h:52
std::vector< Number > lm_v_sol
Definition: hdg_problem.h:225
const std::vector< std::vector< Real > > * lm_phi_face
Definition: hdg_problem.h:213
libmesh_assert(ctx)
std::unique_ptr< FEBase > scalar_fe_face
Definition: hdg_problem.h:54
std::vector< Number > u_sol
Definition: hdg_problem.h:221
void add_matrix(NonlinearImplicitSystem &sys, const unsigned int ivar_num, const unsigned int jvar_num, const DenseMatrix< Number > &elem_mat)
Definition: hdg_problem.C:888
std::vector< Number > u_dof_values
Definition: hdg_problem.h:234
void scalar_dirichlet_jacobian(const unsigned int vel_component, DenseMatrix< Number > &Jsq, DenseMatrix< Number > &Jsp, DenseMatrix< Number > &Jss)
Definition: hdg_problem.C:481
std::vector< Gradient > qu_sol
Definition: hdg_problem.h:220
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2598
std::vector< Gradient > qv_sol
Definition: hdg_problem.h:223
std::vector< Number > qu_dof_values
Definition: hdg_problem.h:233
StaticCondensation * sc
Definition: hdg_problem.h:47
void vector_volume_jacobian(DenseMatrix< Number > &Jqq, DenseMatrix< Number > &Jqs)
Definition: hdg_problem.C:163
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
const MeshBase * mesh
Definition: hdg_problem.h:45
void pressure_face_jacobian(DenseMatrix< Number > &Jplm_u, DenseMatrix< Number > &Jplm_v)
Definition: hdg_problem.C:355
std::vector< Number > lm_u_dof_values
Definition: hdg_problem.h:235
Number global_lm_dof_value
Definition: hdg_problem.h:240
void pressure_volume_jacobian(DenseMatrix< Number > &Jpu, DenseMatrix< Number > &Jpv, DenseMatrix< Number > &Jpglm, DenseMatrix< Number > &Jglmp)
Definition: hdg_problem.C:309
void compute_qp_soln(std::vector< SolnType > &qp_vec, const unsigned int n_qps, const std::vector< std::vector< PhiType >> &phi, const std::vector< Number > &dof_values)
Definition: hdg_problem.C:36
std::size_t p_n_dofs
Definition: hdg_problem.h:246
void vector_face_jacobian(DenseMatrix< Number > &Jqlm)
Definition: hdg_problem.C:432
std::vector< Number > lm_v_dof_values
Definition: hdg_problem.h:238
std::size_t scalar_n_dofs
Definition: hdg_problem.h:244
std::size_t vector_n_dofs
Definition: hdg_problem.h:243
boundary_id_type right_bnd
Definition: hdg_problem.h:61
std::unique_ptr< FEVectorBase > vector_fe_face
Definition: hdg_problem.h:53

◆ jacobian() [2/2]

virtual void libMesh::NonlinearImplicitSystem::ComputeJacobian::jacobian ( const NumericVector< Number > &  X,
SparseMatrix< Number > &  J,
sys_type S 
)
pure virtualinherited

Jacobian function.

This function will be called to compute the jacobian and must be implemented by the user in a derived class.

Referenced by libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), and libMesh::libmesh_petsc_snes_jacobian().

◆ lm_face_jacobian()

void libMesh::HDGProblem::lm_face_jacobian ( const unsigned int  vel_component,
DenseMatrix< Number > &  Jlmq,
DenseMatrix< Number > &  Jlmp,
DenseMatrix< Number > &  Jlms,
DenseMatrix< Number > &  Jlmlm,
DenseMatrix< Number > &  Jlm_lmu,
DenseMatrix< Number > &  Jlm_lmv 
)
private

Definition at line 657 of file hdg_problem.C.

References current_bnd, lm_n_dofs, lm_phi_face, lm_u_sol, lm_v_sol, libMesh::make_range(), neigh, nu, p_n_dofs, qface, right_bnd, scalar_n_dofs, tau, vector_n_dofs, and vel_cross_vel_jacobian().

Referenced by jacobian().

664 {
665  for (const auto qp : make_range(qface->n_points()))
666  for (const auto i : make_range(lm_n_dofs))
667  {
668  for (const auto j : make_range(vector_n_dofs))
669  Jlmq(i, j) -= (*JxW_face)[qp] * nu * (*lm_phi_face)[i][qp] *
670  ((*vector_phi_face)[j][qp] * (*normals)[qp]);
671 
672  for (const auto j : make_range(p_n_dofs))
673  {
674  Gradient p_phi;
675  p_phi(vel_component) = (*scalar_phi_face)[j][qp];
676  Jlmp(i, j) += (*JxW_face)[qp] * (*lm_phi_face)[i][qp] * (p_phi * (*normals)[qp]);
677  }
678 
679  for (const auto j : make_range(scalar_n_dofs))
680  Jlms(i, j) += (*JxW_face)[qp] * (*lm_phi_face)[i][qp] * tau * (*scalar_phi_face)[j][qp] *
681  (*normals)[qp] * (*normals)[qp];
682 
683  for (const auto j : make_range(lm_n_dofs))
684  {
685  // from stabilization term
686  Jlmlm(i, j) -= (*JxW_face)[qp] * (*lm_phi_face)[i][qp] * tau * (*lm_phi_face)[j][qp] *
687  (*normals)[qp] * (*normals)[qp];
688  if (neigh)
689  {
690  // derivatives wrt 0th component
691  {
692  const auto vel_cross_vel =
693  vel_cross_vel_jacobian(lm_u_sol, lm_v_sol, qp, vel_component, 0, (*lm_phi_face), j);
694  Jlm_lmu(i, j) +=
695  (*JxW_face)[qp] * (*lm_phi_face)[i][qp] * vel_cross_vel * (*normals)[qp];
696  }
697  // derivatives wrt 1th component
698  {
699  const auto vel_cross_vel =
700  vel_cross_vel_jacobian(lm_u_sol, lm_v_sol, qp, vel_component, 1, (*lm_phi_face), j);
701  Jlm_lmv(i, j) +=
702  (*JxW_face)[qp] * (*lm_phi_face)[i][qp] * vel_cross_vel * (*normals)[qp];
703  }
704  }
705  else
706  libmesh_assert_msg(current_bnd == right_bnd,
707  "This method should only be called with an outflow boundary. "
708  "Dirichlet boundaries should call a different routine");
709  }
710  }
711 }
std::unique_ptr< QBase > qface
Definition: hdg_problem.h:56
boundary_id_type current_bnd
Definition: hdg_problem.h:253
const Elem * neigh
Definition: hdg_problem.h:256
std::size_t lm_n_dofs
Definition: hdg_problem.h:245
std::vector< Number > lm_u_sol
Definition: hdg_problem.h:222
static constexpr Real tau
Definition: hdg_problem.h:250
std::vector< Number > lm_v_sol
Definition: hdg_problem.h:225
NumberVectorValue Gradient
const std::vector< std::vector< Real > > * lm_phi_face
Definition: hdg_problem.h:213
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::size_t p_n_dofs
Definition: hdg_problem.h:246
std::size_t scalar_n_dofs
Definition: hdg_problem.h:244
std::size_t vector_n_dofs
Definition: hdg_problem.h:243
boundary_id_type right_bnd
Definition: hdg_problem.h:61
NumberVectorValue vel_cross_vel_jacobian(const std::vector< Number > &u_sol_local, const std::vector< Number > &v_sol_local, const unsigned int qp, const unsigned int vel_component, const unsigned int vel_j_component, const std::vector< std::vector< Real >> &phi, const unsigned int j) const
Definition: hdg_problem.C:189

◆ lm_face_residual()

void libMesh::HDGProblem::lm_face_residual ( const std::vector< Gradient > &  vector_sol,
const std::vector< Number > &  scalar_sol,
const std::vector< Number > &  lm_sol,
const unsigned int  vel_component,
DenseVector< Number > &  R 
)
private

Definition at line 615 of file hdg_problem.C.

References current_bnd, lm_n_dofs, lm_u_sol, lm_v_sol, libMesh::make_range(), neigh, nu, p_sol, qface, right_bnd, tau, and vel_cross_vel_residual().

Referenced by residual().

620 {
621  for (const auto qp : make_range(qface->n_points()))
622  {
623  Gradient qp_p;
624  qp_p(vel_component) = p_sol[qp];
625  const auto vel_cross_vel = vel_cross_vel_residual(lm_u_sol, lm_v_sol, qp, vel_component);
626 
627  for (const auto i : make_range(lm_n_dofs))
628  {
629  // vector
630  R(i) -= (*JxW_face)[qp] * nu * (*lm_phi_face)[i][qp] * (vector_sol[qp] * (*normals)[qp]);
631 
632  // pressure
633  R(i) += (*JxW_face)[qp] * (*lm_phi_face)[i][qp] * (qp_p * (*normals)[qp]);
634 
635  // scalar from stabilization term
636  R(i) += (*JxW_face)[qp] * (*lm_phi_face)[i][qp] * tau * scalar_sol[qp] * (*normals)[qp] *
637  (*normals)[qp];
638 
639  // lm from stabilization term
640  R(i) -= (*JxW_face)[qp] * (*lm_phi_face)[i][qp] * tau * lm_sol[qp] * (*normals)[qp] *
641  (*normals)[qp];
642 
643  // If we are an internal face we add the convective term. On the outflow boundary we do not
644  // zero out the convection term, e.g. we are going to set q + p + tau * (u - u_hat) to zero
645  if (neigh)
646  // lm from convection term
647  R(i) += (*JxW_face)[qp] * (*lm_phi_face)[i][qp] * vel_cross_vel * (*normals)[qp];
648  else
649  libmesh_assert_msg(current_bnd == right_bnd,
650  "This method should only be called with an outflow boundary. "
651  "Dirichlet boundaries should call a different routine");
652  }
653  }
654 }
NumberVectorValue vel_cross_vel_residual(const std::vector< Number > &u_sol_local, const std::vector< Number > &v_sol_local, const unsigned int qp, const unsigned int vel_component) const
Definition: hdg_problem.C:179
std::unique_ptr< QBase > qface
Definition: hdg_problem.h:56
boundary_id_type current_bnd
Definition: hdg_problem.h:253
std::vector< Number > p_sol
Definition: hdg_problem.h:226
const Elem * neigh
Definition: hdg_problem.h:256
std::size_t lm_n_dofs
Definition: hdg_problem.h:245
std::vector< Number > lm_u_sol
Definition: hdg_problem.h:222
static constexpr Real tau
Definition: hdg_problem.h:250
std::vector< Number > lm_v_sol
Definition: hdg_problem.h:225
NumberVectorValue Gradient
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
boundary_id_type right_bnd
Definition: hdg_problem.h:61

◆ pressure_dirichlet_residual()

void libMesh::HDGProblem::pressure_dirichlet_residual ( DenseVector< Number > &  R)
private

Definition at line 398 of file hdg_problem.C.

References get_dirichlet_velocity(), libMesh::make_range(), p_n_dofs, and qface.

Referenced by residual().

399 {
400  for (const auto qp : make_range(qface->n_points()))
401  {
402  const auto dirichlet_velocity = get_dirichlet_velocity(qp);
403  const auto vdotn = dirichlet_velocity * (*normals)[qp];
404  for (const auto i : make_range(p_n_dofs))
405  R(i) += (*JxW_face)[qp] * vdotn * (*scalar_phi_face)[i][qp];
406  }
407 }
std::unique_ptr< QBase > qface
Definition: hdg_problem.h:56
RealVectorValue get_dirichlet_velocity(const unsigned int qp) const
Definition: hdg_problem.C:373
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::size_t p_n_dofs
Definition: hdg_problem.h:246

◆ pressure_face_jacobian()

void libMesh::HDGProblem::pressure_face_jacobian ( DenseMatrix< Number > &  Jplm_u,
DenseMatrix< Number > &  Jplm_v 
)
private

Definition at line 355 of file hdg_problem.C.

References lm_n_dofs, lm_phi_face, libMesh::make_range(), p_n_dofs, and qface.

Referenced by jacobian().

356 {
357  for (const auto qp : make_range(qface->n_points()))
358  for (const auto i : make_range(p_n_dofs))
359  for (const auto j : make_range(lm_n_dofs))
360  {
361  {
362  const Gradient phi((*lm_phi_face)[j][qp], Number(0));
363  Jplm_u(i, j) += (*JxW_face)[qp] * phi * (*normals)[qp] * (*scalar_phi_face)[i][qp];
364  }
365  {
366  const Gradient phi(Number(0), (*lm_phi_face)[j][qp]);
367  Jplm_v(i, j) += (*JxW_face)[qp] * phi * (*normals)[qp] * (*scalar_phi_face)[i][qp];
368  }
369  }
370 }
std::unique_ptr< QBase > qface
Definition: hdg_problem.h:56
std::size_t lm_n_dofs
Definition: hdg_problem.h:245
NumberVectorValue Gradient
const std::vector< std::vector< Real > > * lm_phi_face
Definition: hdg_problem.h:213
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::size_t p_n_dofs
Definition: hdg_problem.h:246

◆ pressure_face_residual()

void libMesh::HDGProblem::pressure_face_residual ( DenseVector< Number > &  R)
private

Definition at line 343 of file hdg_problem.C.

References lm_u_sol, lm_v_sol, libMesh::make_range(), p_n_dofs, and qface.

Referenced by residual().

344 {
345  for (const auto qp : make_range(qface->n_points()))
346  {
347  const Gradient vel(lm_u_sol[qp], lm_v_sol[qp]);
348  const auto vdotn = vel * (*normals)[qp];
349  for (const auto i : make_range(p_n_dofs))
350  R(i) += (*JxW_face)[qp] * vdotn * (*scalar_phi_face)[i][qp];
351  }
352 }
std::unique_ptr< QBase > qface
Definition: hdg_problem.h:56
std::vector< Number > lm_u_sol
Definition: hdg_problem.h:222
std::vector< Number > lm_v_sol
Definition: hdg_problem.h:225
NumberVectorValue Gradient
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::size_t p_n_dofs
Definition: hdg_problem.h:246

◆ pressure_volume_jacobian()

void libMesh::HDGProblem::pressure_volume_jacobian ( DenseMatrix< Number > &  Jpu,
DenseMatrix< Number > &  Jpv,
DenseMatrix< Number > &  Jpglm,
DenseMatrix< Number > &  Jglmp 
)
private

Definition at line 309 of file hdg_problem.C.

References cavity, libMesh::libmesh_assert(), libMesh::make_range(), p_n_dofs, qrule, scalar_n_dofs, and scalar_phi.

Referenced by jacobian().

313 {
314  for (const auto qp : make_range(qrule->n_points()))
315  {
316  for (const auto i : make_range(p_n_dofs))
317  {
318  for (const auto j : make_range(scalar_n_dofs))
319  {
320  {
321  const Gradient phi((*scalar_phi)[j][qp], Number(0));
322  Jpu(i, j) -= (*JxW)[qp] * ((*grad_scalar_phi)[i][qp] * phi);
323  }
324  {
325  const Gradient phi(Number(0), (*scalar_phi)[j][qp]);
326  Jpv(i, j) -= (*JxW)[qp] * ((*grad_scalar_phi)[i][qp] * phi);
327  }
328  }
329  if (cavity)
330  Jpglm(i, 0) -= (*JxW)[qp] * (*scalar_phi)[i][qp];
331  }
332 
333  if (cavity)
334  {
336  for (const auto j : make_range(p_n_dofs))
337  Jglmp(0, j) -= (*JxW)[qp] * (*scalar_phi)[j][qp];
338  }
339  }
340 }
const std::vector< std::vector< Real > > * scalar_phi
Definition: hdg_problem.h:204
std::unique_ptr< QBase > qrule
Definition: hdg_problem.h:52
NumberVectorValue Gradient
libmesh_assert(ctx)
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::size_t p_n_dofs
Definition: hdg_problem.h:246
std::size_t scalar_n_dofs
Definition: hdg_problem.h:244

◆ pressure_volume_residual()

void libMesh::HDGProblem::pressure_volume_residual ( DenseVector< Number > &  Rp,
DenseVector< Number > &  Rglm 
)
private

Definition at line 281 of file hdg_problem.C.

References cavity, libMesh::PSoln::forcing(), global_lm_dof_value, libMesh::make_range(), mms, p_n_dofs, p_sol, p_true_soln, q_point, qrule, libMesh::Real, u_sol, and v_sol.

Referenced by residual().

282 {
283  for (const auto qp : make_range(qrule->n_points()))
284  {
285  // Prepare forcing function
286  Real f = 0;
287  if (mms)
288  f = p_true_soln.forcing((*q_point)[qp]);
289 
290  const Gradient vel(u_sol[qp], v_sol[qp]);
291  for (const auto i : make_range(p_n_dofs))
292  {
293  Rp(i) -= (*JxW)[qp] * ((*grad_scalar_phi)[i][qp] * vel);
294 
295  if (mms)
296  // Pressure equation RHS
297  Rp(i) -= (*JxW)[qp] * (*scalar_phi)[i][qp] * f;
298 
299  if (cavity)
300  Rp(i) -= (*JxW)[qp] * (*scalar_phi)[i][qp] * global_lm_dof_value;
301  }
302 
303  if (cavity)
304  Rglm(0) -= (*JxW)[qp] * p_sol[qp];
305  }
306 }
std::vector< Number > v_sol
Definition: hdg_problem.h:224
std::vector< Number > p_sol
Definition: hdg_problem.h:226
const std::vector< Point > * q_point
Definition: hdg_problem.h:202
std::unique_ptr< QBase > qrule
Definition: hdg_problem.h:52
const PSoln p_true_soln
Definition: hdg_problem.h:73
NumberVectorValue Gradient
std::vector< Number > u_sol
Definition: hdg_problem.h:221
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real forcing(const Point &p) const override
Definition: exact_soln.h:148
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
Number global_lm_dof_value
Definition: hdg_problem.h:240
std::size_t p_n_dofs
Definition: hdg_problem.h:246

◆ residual() [1/2]

void libMesh::HDGProblem::residual ( const NumericVector< Number > &  X,
NumericVector< Number > &  R,
NonlinearImplicitSystem S 
)
overridevirtual

Definition at line 714 of file hdg_problem.C.

References libMesh::NumericVector< T >::add_vector(), cavity, libMesh::compute_qp_soln(), create_identity_residual(), current_bnd, dof_indices, libMesh::DofMap::dof_indices(), dof_map, libMesh::NumericVector< T >::get(), libMesh::MeshBase::get_boundary_info(), global_lm_dof_value, libMesh::invalid_uint, JxW_face, libMesh::libmesh_assert(), lm_face_residual(), lm_fe_face, lm_n_dofs, lm_phi_face, lm_u_dof_values, lm_u_sol, lm_v_dof_values, lm_v_sol, mesh, neigh, libMesh::Elem::neighbor_ptr(), p_dof_values, p_n_dofs, p_sol, pressure_dirichlet_residual(), pressure_face_residual(), pressure_volume_residual(), qface, qrule, qu_dof_values, qu_sol, qv_dof_values, qv_sol, libMesh::DenseVector< T >::resize(), right_bnd, scalar_dirichlet_residual(), scalar_face_residual(), scalar_fe, scalar_fe_face, scalar_n_dofs, scalar_phi, scalar_phi_face, scalar_volume_residual(), sigma_u, sigma_v, u_dof_values, u_sol, v_dof_values, v_sol, libMesh::System::variable_number(), vector_dirichlet_residual(), vector_face_residual(), vector_fe, vector_fe_face, vector_n_dofs, vector_phi, vector_phi_face, vector_volume_residual(), and libMesh::NumericVector< T >::zero().

717 {
718  R.zero();
719 
720  const auto u_num = S.variable_number("vel_x");
721  const auto v_num = S.variable_number("vel_y");
722  const auto qu_num = S.variable_number("qu");
723  const auto qv_num = S.variable_number("qv");
724  const auto lm_u_num = S.variable_number("lm_u");
725  const auto lm_v_num = S.variable_number("lm_v");
726  const auto p_num = S.variable_number("pressure");
727  const auto global_lm_num = cavity ? S.variable_number("global_lm") : invalid_uint;
728 
729  auto & qu_dof_indices = dof_indices[qu_num];
730  auto & u_dof_indices = dof_indices[u_num];
731  auto & lm_u_dof_indices = dof_indices[lm_u_num];
732  auto & qv_dof_indices = dof_indices[qv_num];
733  auto & v_dof_indices = dof_indices[v_num];
734  auto & lm_v_dof_indices = dof_indices[lm_v_num];
735  auto & p_dof_indices = dof_indices[p_num];
736  static std::vector<dof_id_type> dummy_indices;
737  auto & global_lm_dof_indices = cavity ? dof_indices[global_lm_num] : dummy_indices;
738 
739  std::vector<boundary_id_type> boundary_ids;
740  const auto & boundary_info = mesh->get_boundary_info();
741  DenseVector<Number> Rqu, Rqv, Ru, Rv, Rlm_u, Rlm_v, Rp, Rglm;
742 
743  for (const auto & elem : mesh->active_local_element_ptr_range())
744  {
745  // Retrive our dof indices for all fields
746  dof_map->dof_indices(elem, qu_dof_indices, qu_num);
747  dof_map->dof_indices(elem, u_dof_indices, u_num);
748  dof_map->dof_indices(elem, lm_u_dof_indices, lm_u_num);
749  dof_map->dof_indices(elem, qv_dof_indices, qv_num);
750  dof_map->dof_indices(elem, v_dof_indices, v_num);
751  dof_map->dof_indices(elem, lm_v_dof_indices, lm_v_num);
752  dof_map->dof_indices(elem, p_dof_indices, p_num);
753  if (cavity)
754  {
755  dof_map->dof_indices(elem, global_lm_dof_indices, global_lm_num);
756  libmesh_assert(global_lm_dof_indices.size() == 1);
757  }
758 
759  vector_n_dofs = qu_dof_indices.size();
760  scalar_n_dofs = u_dof_indices.size();
761  lm_n_dofs = lm_u_dof_indices.size();
762  p_n_dofs = p_dof_indices.size();
764  Rqu.resize(vector_n_dofs);
765  Rqv.resize(vector_n_dofs);
766  Ru.resize(scalar_n_dofs);
767  Rv.resize(scalar_n_dofs);
768  Rlm_u.resize(lm_n_dofs);
769  Rlm_v.resize(lm_n_dofs);
770  Rp.resize(p_n_dofs);
771  Rglm.resize(global_lm_dof_indices.size());
772 
773  // Reinit our volume FE objects
774  vector_fe->reinit(elem);
775  scalar_fe->reinit(elem);
776 
777  libmesh_assert_equal_to(vector_n_dofs, vector_phi->size());
778  libmesh_assert_equal_to(scalar_n_dofs, scalar_phi->size());
779 
780  // Get our local element dof values
781  X.get(qu_dof_indices, qu_dof_values);
782  X.get(u_dof_indices, u_dof_values);
783  X.get(lm_u_dof_indices, lm_u_dof_values);
784  X.get(qv_dof_indices, qv_dof_values);
785  X.get(v_dof_indices, v_dof_values);
786  X.get(lm_v_dof_indices, lm_v_dof_values);
787  X.get(p_dof_indices, p_dof_values);
788  if (cavity)
789  global_lm_dof_value = X(global_lm_dof_indices[0]);
790 
791  // Compute volumetric local qp solutions
797 
798  //
799  // compute volumetric residuals and Jacobians
800  //
801 
802  // qu and u
805 
806  // qv and v
809 
810  // p
811  pressure_volume_residual(Rp, Rglm);
812 
813  for (auto side : elem->side_index_range())
814  {
815  neigh = elem->neighbor_ptr(side);
816 
817  // Reinit our face FE objects
818  vector_fe_face->reinit(elem, side);
819  scalar_fe_face->reinit(elem, side);
820  lm_fe_face->reinit(elem, side);
821 
822  // Compute face local qp solutions
830 
831  if (neigh == nullptr)
832  {
833  boundary_info.boundary_ids(elem, side, boundary_ids);
834  libmesh_assert(boundary_ids.size() == 1);
835  current_bnd = boundary_ids[0];
836  if (cavity || (current_bnd != right_bnd))
837  {
838  // qu, u
841 
842  // qv, v
845 
846  // p
848 
849  // Set the LMs on these Dirichlet boundary faces to 0
852 
853  continue;
854  }
855  }
856 
857  //
858  // if we got here, then we are on an internal face or an outlet face
859  //
860 
861  // qu, u, lm_u
864  lm_face_residual(qu_sol, u_sol, lm_u_sol, 0, Rlm_u);
865 
866  // qv, v, lm_v
869  lm_face_residual(qv_sol, v_sol, lm_v_sol, 1, Rlm_v);
870 
871  // p
873  }
874 
875  R.add_vector(Rqu, qu_dof_indices);
876  R.add_vector(Rqv, qv_dof_indices);
877  R.add_vector(Ru, u_dof_indices);
878  R.add_vector(Rv, v_dof_indices);
879  R.add_vector(Rlm_u, lm_u_dof_indices);
880  R.add_vector(Rlm_v, lm_v_dof_indices);
881  R.add_vector(Rp, p_dof_indices);
882  if (cavity)
883  R.add_vector(Rglm, global_lm_dof_indices);
884  }
885 }
const std::vector< std::vector< Real > > * scalar_phi_face
Definition: hdg_problem.h:212
std::unique_ptr< QBase > qface
Definition: hdg_problem.h:56
const std::vector< std::vector< Real > > * scalar_phi
Definition: hdg_problem.h:204
void vector_face_residual(const std::vector< Number > &lm_sol, DenseVector< Number > &R)
Definition: hdg_problem.C:423
const std::vector< std::vector< RealVectorValue > > * vector_phi_face
Definition: hdg_problem.h:211
void pressure_face_residual(DenseVector< Number > &R)
Definition: hdg_problem.C:343
std::vector< Gradient > sigma_u
Definition: hdg_problem.h:229
const std::vector< std::vector< RealVectorValue > > * vector_phi
Definition: hdg_problem.h:203
void scalar_face_residual(const std::vector< Gradient > &vector_sol, const std::vector< Number > &scalar_sol, const std::vector< Number > &lm_sol, const unsigned int vel_component, DenseVector< Number > &R)
Definition: hdg_problem.C:508
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:310
std::unique_ptr< FEVectorBase > vector_fe
Definition: hdg_problem.h:50
void vector_volume_residual(const std::vector< Gradient > &vector_sol, const std::vector< Number > &scalar_sol, DenseVector< Number > &R)
Definition: hdg_problem.C:147
boundary_id_type current_bnd
Definition: hdg_problem.h:253
virtual void get(const std::vector< numeric_index_type > &index, T *values) const
Access multiple components at once.
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Definition: dof_map.C:2164
std::unique_ptr< FEBase > lm_fe_face
Definition: hdg_problem.h:55
std::vector< Number > v_sol
Definition: hdg_problem.h:224
virtual void add_vector(const T *v, const std::vector< numeric_index_type > &dof_indices)
Computes , where v is a pointer and each dof_indices[i] specifies where to add value v[i]...
std::vector< Number > p_sol
Definition: hdg_problem.h:226
const DofMap * dof_map
Definition: hdg_problem.h:46
std::unique_ptr< FEBase > scalar_fe
Definition: hdg_problem.h:51
void scalar_volume_residual(const std::vector< Gradient > &vel_gradient, const unsigned int vel_component, std::vector< Gradient > &sigma, DenseVector< Number > &R)
Definition: hdg_problem.C:207
std::vector< Number > v_dof_values
Definition: hdg_problem.h:237
void pressure_volume_residual(DenseVector< Number > &Rp, DenseVector< Number > &Rglm)
Definition: hdg_problem.C:281
const Elem * neigh
Definition: hdg_problem.h:256
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
Definition: mesh_base.h:165
const std::vector< Real > * JxW_face
Definition: hdg_problem.h:209
virtual void zero()=0
Set all entries to zero.
void create_identity_residual(const QBase &quadrature, const std::vector< Real > &JxW_local, const std::vector< std::vector< Real >> &phi, const std::vector< Number > &sol, const std::size_t n_dofs, DenseVector< Number > &R)
Definition: hdg_problem.C:107
std::size_t lm_n_dofs
Definition: hdg_problem.h:245
std::vector< Number > lm_u_sol
Definition: hdg_problem.h:222
std::unordered_map< unsigned int, std::vector< dof_id_type > > dof_indices
Definition: hdg_problem.h:217
std::vector< Number > qv_dof_values
Definition: hdg_problem.h:236
std::vector< Number > p_dof_values
Definition: hdg_problem.h:239
std::unique_ptr< QBase > qrule
Definition: hdg_problem.h:52
std::vector< Number > lm_v_sol
Definition: hdg_problem.h:225
const std::vector< std::vector< Real > > * lm_phi_face
Definition: hdg_problem.h:213
libmesh_assert(ctx)
void lm_face_residual(const std::vector< Gradient > &vector_sol, const std::vector< Number > &scalar_sol, const std::vector< Number > &lm_sol, const unsigned int vel_component, DenseVector< Number > &R)
Definition: hdg_problem.C:615
std::unique_ptr< FEBase > scalar_fe_face
Definition: hdg_problem.h:54
std::vector< Number > u_sol
Definition: hdg_problem.h:221
std::vector< Number > u_dof_values
Definition: hdg_problem.h:234
void pressure_dirichlet_residual(DenseVector< Number > &R)
Definition: hdg_problem.C:398
std::vector< Gradient > qu_sol
Definition: hdg_problem.h:220
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2598
std::vector< Gradient > qv_sol
Definition: hdg_problem.h:223
std::vector< Number > qu_dof_values
Definition: hdg_problem.h:233
const MeshBase * mesh
Definition: hdg_problem.h:45
std::vector< Number > lm_u_dof_values
Definition: hdg_problem.h:235
Number global_lm_dof_value
Definition: hdg_problem.h:240
void compute_qp_soln(std::vector< SolnType > &qp_vec, const unsigned int n_qps, const std::vector< std::vector< PhiType >> &phi, const std::vector< Number > &dof_values)
Definition: hdg_problem.C:36
std::size_t p_n_dofs
Definition: hdg_problem.h:246
std::vector< Number > lm_v_dof_values
Definition: hdg_problem.h:238
std::size_t scalar_n_dofs
Definition: hdg_problem.h:244
std::size_t vector_n_dofs
Definition: hdg_problem.h:243
void vector_dirichlet_residual(const unsigned int vel_component, DenseVector< Number > &R)
Definition: hdg_problem.C:410
std::vector< Gradient > sigma_v
Definition: hdg_problem.h:230
boundary_id_type right_bnd
Definition: hdg_problem.h:61
std::unique_ptr< FEVectorBase > vector_fe_face
Definition: hdg_problem.h:53
void scalar_dirichlet_residual(const std::vector< Gradient > &vector_sol, const std::vector< Number > &scalar_sol, const unsigned int vel_component, DenseVector< Number > &R)
Definition: hdg_problem.C:443

◆ residual() [2/2]

virtual void libMesh::NonlinearImplicitSystem::ComputeResidual::residual ( const NumericVector< Number > &  X,
NumericVector< Number > &  R,
sys_type S 
)
pure virtualinherited

Residual function.

This function will be called to compute the residual and must be implemented by the user in a derived class.

Referenced by libMesh::Problem_Interface::computeF(), libMesh::libmesh_petsc_snes_fd_residual(), libMesh::libmesh_petsc_snes_mffd_residual(), and libMesh::libmesh_petsc_snes_residual().

◆ scalar_dirichlet_jacobian()

void libMesh::HDGProblem::scalar_dirichlet_jacobian ( const unsigned int  vel_component,
DenseMatrix< Number > &  Jsq,
DenseMatrix< Number > &  Jsp,
DenseMatrix< Number > &  Jss 
)
private

Definition at line 481 of file hdg_problem.C.

References libMesh::make_range(), nu, p_n_dofs, qface, scalar_n_dofs, tau, and vector_n_dofs.

Referenced by jacobian().

485 {
486  for (const auto qp : make_range(qface->n_points()))
487  for (const auto i : make_range(scalar_n_dofs))
488  {
489  for (const auto j : make_range(vector_n_dofs))
490  Jsq(i, j) -= (*JxW_face)[qp] * nu * (*scalar_phi_face)[i][qp] *
491  ((*vector_phi_face)[j][qp] * (*normals)[qp]);
492 
493  for (const auto j : make_range(p_n_dofs))
494  {
495  Gradient p_phi;
496  p_phi(vel_component) = (*scalar_phi_face)[j][qp];
497  // pressure
498  Jsp(i, j) += (*JxW_face)[qp] * (*scalar_phi_face)[i][qp] * (p_phi * (*normals)[qp]);
499  }
500 
501  for (const auto j : make_range(scalar_n_dofs))
502  Jss(i, j) += (*JxW_face)[qp] * (*scalar_phi_face)[i][qp] * tau * (*scalar_phi_face)[j][qp] *
503  (*normals)[qp] * (*normals)[qp];
504  }
505 }
std::unique_ptr< QBase > qface
Definition: hdg_problem.h:56
static constexpr Real tau
Definition: hdg_problem.h:250
NumberVectorValue Gradient
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::size_t p_n_dofs
Definition: hdg_problem.h:246
std::size_t scalar_n_dofs
Definition: hdg_problem.h:244
std::size_t vector_n_dofs
Definition: hdg_problem.h:243

◆ scalar_dirichlet_residual()

void libMesh::HDGProblem::scalar_dirichlet_residual ( const std::vector< Gradient > &  vector_sol,
const std::vector< Number > &  scalar_sol,
const unsigned int  vel_component,
DenseVector< Number > &  R 
)
private

Definition at line 443 of file hdg_problem.C.

References get_dirichlet_velocity(), libMesh::make_range(), nu, p_sol, qface, scalar_n_dofs, and tau.

Referenced by residual().

447 {
448  for (const auto qp : make_range(qface->n_points()))
449  {
450  Gradient qp_p;
451  qp_p(vel_component) = p_sol[qp];
452 
453  const auto dirichlet_velocity = get_dirichlet_velocity(qp);
454  const auto scalar_value = dirichlet_velocity(vel_component);
455  ;
456 
457  for (const auto i : make_range(scalar_n_dofs))
458  {
459  // vector
460  R(i) -= (*JxW_face)[qp] * nu * (*scalar_phi_face)[i][qp] * (vector_sol[qp] * (*normals)[qp]);
461 
462  // pressure
463  R(i) += (*JxW_face)[qp] * (*scalar_phi_face)[i][qp] * (qp_p * (*normals)[qp]);
464 
465  // scalar from stabilization term
466  R(i) += (*JxW_face)[qp] * (*scalar_phi_face)[i][qp] * tau * scalar_sol[qp] * (*normals)[qp] *
467  (*normals)[qp];
468 
469  // dirichlet lm from stabilization term
470  R(i) -= (*JxW_face)[qp] * (*scalar_phi_face)[i][qp] * tau * scalar_value * (*normals)[qp] *
471  (*normals)[qp];
472 
473  // dirichlet lm from advection term
474  R(i) += (*JxW_face)[qp] * (*scalar_phi_face)[i][qp] * (dirichlet_velocity * (*normals)[qp]) *
475  scalar_value;
476  }
477  }
478 }
std::unique_ptr< QBase > qface
Definition: hdg_problem.h:56
std::vector< Number > p_sol
Definition: hdg_problem.h:226
static constexpr Real tau
Definition: hdg_problem.h:250
NumberVectorValue Gradient
RealVectorValue get_dirichlet_velocity(const unsigned int qp) const
Definition: hdg_problem.C:373
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::size_t scalar_n_dofs
Definition: hdg_problem.h:244

◆ scalar_face_jacobian()

void libMesh::HDGProblem::scalar_face_jacobian ( const unsigned int  vel_component,
DenseMatrix< Number > &  Jsq,
DenseMatrix< Number > &  Jsp,
DenseMatrix< Number > &  Jss,
DenseMatrix< Number > &  Jslm,
DenseMatrix< Number > &  Js_lmu,
DenseMatrix< Number > &  Js_lmv 
)
private

Definition at line 551 of file hdg_problem.C.

References current_bnd, lm_n_dofs, lm_phi_face, lm_u_sol, lm_v_sol, libMesh::make_range(), neigh, nu, p_n_dofs, qface, right_bnd, scalar_n_dofs, tau, vector_n_dofs, and vel_cross_vel_jacobian().

Referenced by jacobian().

558 {
559  for (const auto qp : make_range(qface->n_points()))
560  for (const auto i : make_range(scalar_n_dofs))
561  {
562  if (neigh)
563  {
564  for (const auto j : make_range(vector_n_dofs))
565  Jsq(i, j) -= (*JxW_face)[qp] * nu * (*scalar_phi_face)[i][qp] *
566  ((*vector_phi_face)[j][qp] * (*normals)[qp]);
567 
568  for (const auto j : make_range(p_n_dofs))
569  {
570  Gradient p_phi;
571  p_phi(vel_component) = (*scalar_phi_face)[j][qp];
572  // pressure
573  Jsp(i, j) += (*JxW_face)[qp] * (*scalar_phi_face)[i][qp] * (p_phi * (*normals)[qp]);
574  }
575 
576  for (const auto j : make_range(scalar_n_dofs))
577  Jss(i, j) += (*JxW_face)[qp] * (*scalar_phi_face)[i][qp] * tau *
578  (*scalar_phi_face)[j][qp] * (*normals)[qp] * (*normals)[qp];
579  }
580  else
581  libmesh_assert_msg(current_bnd == right_bnd,
582  "This method should only be called with an outflow boundary. "
583  "Dirichlet boundaries should call a different routine");
584 
585  for (const auto j : make_range(lm_n_dofs))
586  {
587  if (neigh)
588  // from stabilization term
589  Jslm(i, j) -= (*JxW_face)[qp] * (*scalar_phi_face)[i][qp] * tau * (*lm_phi_face)[j][qp] *
590  (*normals)[qp] * (*normals)[qp];
591 
592  //
593  // from convection term
594  //
595 
596  // derivatives wrt 0th component
597  {
598  const auto vel_cross_vel =
599  vel_cross_vel_jacobian(lm_u_sol, lm_v_sol, qp, vel_component, 0, (*lm_phi_face), j);
600  Js_lmu(i, j) +=
601  (*JxW_face)[qp] * (*scalar_phi_face)[i][qp] * vel_cross_vel * (*normals)[qp];
602  }
603  // derivatives wrt 1th component
604  {
605  const auto vel_cross_vel =
606  vel_cross_vel_jacobian(lm_u_sol, lm_v_sol, qp, vel_component, 1, (*lm_phi_face), j);
607  Js_lmv(i, j) +=
608  (*JxW_face)[qp] * (*scalar_phi_face)[i][qp] * vel_cross_vel * (*normals)[qp];
609  }
610  }
611  }
612 }
std::unique_ptr< QBase > qface
Definition: hdg_problem.h:56
boundary_id_type current_bnd
Definition: hdg_problem.h:253
const Elem * neigh
Definition: hdg_problem.h:256
std::size_t lm_n_dofs
Definition: hdg_problem.h:245
std::vector< Number > lm_u_sol
Definition: hdg_problem.h:222
static constexpr Real tau
Definition: hdg_problem.h:250
std::vector< Number > lm_v_sol
Definition: hdg_problem.h:225
NumberVectorValue Gradient
const std::vector< std::vector< Real > > * lm_phi_face
Definition: hdg_problem.h:213
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::size_t p_n_dofs
Definition: hdg_problem.h:246
std::size_t scalar_n_dofs
Definition: hdg_problem.h:244
std::size_t vector_n_dofs
Definition: hdg_problem.h:243
boundary_id_type right_bnd
Definition: hdg_problem.h:61
NumberVectorValue vel_cross_vel_jacobian(const std::vector< Number > &u_sol_local, const std::vector< Number > &v_sol_local, const unsigned int qp, const unsigned int vel_component, const unsigned int vel_j_component, const std::vector< std::vector< Real >> &phi, const unsigned int j) const
Definition: hdg_problem.C:189

◆ scalar_face_residual()

void libMesh::HDGProblem::scalar_face_residual ( const std::vector< Gradient > &  vector_sol,
const std::vector< Number > &  scalar_sol,
const std::vector< Number > &  lm_sol,
const unsigned int  vel_component,
DenseVector< Number > &  R 
)
private

Definition at line 508 of file hdg_problem.C.

References current_bnd, lm_u_sol, lm_v_sol, libMesh::make_range(), neigh, nu, p_sol, qface, right_bnd, scalar_n_dofs, tau, and vel_cross_vel_residual().

Referenced by residual().

513 {
514  for (const auto qp : make_range(qface->n_points()))
515  {
516  Gradient qp_p;
517  qp_p(vel_component) = p_sol[qp];
518  const auto vel_cross_vel = vel_cross_vel_residual(lm_u_sol, lm_v_sol, qp, vel_component);
519 
520  for (const auto i : make_range(scalar_n_dofs))
521  {
522  if (neigh)
523  {
524  // vector
525  R(i) -=
526  (*JxW_face)[qp] * nu * (*scalar_phi_face)[i][qp] * (vector_sol[qp] * (*normals)[qp]);
527 
528  // pressure
529  R(i) += (*JxW_face)[qp] * (*scalar_phi_face)[i][qp] * (qp_p * (*normals)[qp]);
530 
531  // scalar from stabilization term
532  R(i) += (*JxW_face)[qp] * (*scalar_phi_face)[i][qp] * tau * scalar_sol[qp] *
533  (*normals)[qp] * (*normals)[qp];
534 
535  // lm from stabilization term
536  R(i) -= (*JxW_face)[qp] * (*scalar_phi_face)[i][qp] * tau * lm_sol[qp] * (*normals)[qp] *
537  (*normals)[qp];
538  }
539  else
540  libmesh_assert_msg(current_bnd == right_bnd,
541  "This method should only be called with an outflow boundary. "
542  "Dirichlet boundaries should call a different routine");
543 
544  // lm from convection term
545  R(i) += (*JxW_face)[qp] * (*scalar_phi_face)[i][qp] * vel_cross_vel * (*normals)[qp];
546  }
547  }
548 }
NumberVectorValue vel_cross_vel_residual(const std::vector< Number > &u_sol_local, const std::vector< Number > &v_sol_local, const unsigned int qp, const unsigned int vel_component) const
Definition: hdg_problem.C:179
std::unique_ptr< QBase > qface
Definition: hdg_problem.h:56
boundary_id_type current_bnd
Definition: hdg_problem.h:253
std::vector< Number > p_sol
Definition: hdg_problem.h:226
const Elem * neigh
Definition: hdg_problem.h:256
std::vector< Number > lm_u_sol
Definition: hdg_problem.h:222
static constexpr Real tau
Definition: hdg_problem.h:250
std::vector< Number > lm_v_sol
Definition: hdg_problem.h:225
NumberVectorValue Gradient
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::size_t scalar_n_dofs
Definition: hdg_problem.h:244
boundary_id_type right_bnd
Definition: hdg_problem.h:61

◆ scalar_volume_jacobian()

void libMesh::HDGProblem::scalar_volume_jacobian ( const unsigned int  vel_component,
DenseMatrix< Number > &  Jsq,
DenseMatrix< Number > &  Jsp,
DenseMatrix< Number > &  Jsu,
DenseMatrix< Number > &  Jsv 
)
private

Definition at line 240 of file hdg_problem.C.

References libMesh::make_range(), nu, p_n_dofs, qrule, scalar_n_dofs, scalar_phi, u_sol, v_sol, vector_n_dofs, and vel_cross_vel_jacobian().

Referenced by jacobian().

245 {
246  for (const auto qp : make_range(qrule->n_points()))
247  for (const auto i : make_range(scalar_n_dofs))
248  {
249  // Scalar equation dependence on vector dofs
250  for (const auto j : make_range(vector_n_dofs))
251  Jsq(i, j) += (*JxW)[qp] * nu * ((*grad_scalar_phi)[i][qp] * (*vector_phi)[j][qp]);
252 
253  // Scalar equation dependence on pressure dofs
254  for (const auto j : make_range(p_n_dofs))
255  {
256  Gradient p_phi;
257  p_phi(vel_component) = (*scalar_phi)[j][qp];
258  Jsp(i, j) -= (*JxW)[qp] * ((*grad_scalar_phi)[i][qp] * p_phi);
259  }
260 
261  // Scalar equation dependence on scalar dofs
262  for (const auto j : make_range(scalar_n_dofs))
263  {
264  // derivatives wrt 0th component
265  {
266  const auto vel_cross_vel =
267  vel_cross_vel_jacobian(u_sol, v_sol, qp, vel_component, 0, (*scalar_phi), j);
268  Jsu(i, j) -= (*JxW)[qp] * ((*grad_scalar_phi)[i][qp] * vel_cross_vel);
269  }
270  // derivatives wrt 1th component
271  {
272  const auto vel_cross_vel =
273  vel_cross_vel_jacobian(u_sol, v_sol, qp, vel_component, 1, (*scalar_phi), j);
274  Jsv(i, j) -= (*JxW)[qp] * ((*grad_scalar_phi)[i][qp] * vel_cross_vel);
275  }
276  }
277  }
278 }
const std::vector< std::vector< Real > > * scalar_phi
Definition: hdg_problem.h:204
std::vector< Number > v_sol
Definition: hdg_problem.h:224
std::unique_ptr< QBase > qrule
Definition: hdg_problem.h:52
NumberVectorValue Gradient
std::vector< Number > u_sol
Definition: hdg_problem.h:221
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::size_t p_n_dofs
Definition: hdg_problem.h:246
std::size_t scalar_n_dofs
Definition: hdg_problem.h:244
std::size_t vector_n_dofs
Definition: hdg_problem.h:243
NumberVectorValue vel_cross_vel_jacobian(const std::vector< Number > &u_sol_local, const std::vector< Number > &v_sol_local, const unsigned int qp, const unsigned int vel_component, const unsigned int vel_j_component, const std::vector< std::vector< Real >> &phi, const unsigned int j) const
Definition: hdg_problem.C:189

◆ scalar_volume_residual()

void libMesh::HDGProblem::scalar_volume_residual ( const std::vector< Gradient > &  vel_gradient,
const unsigned int  vel_component,
std::vector< Gradient > &  sigma,
DenseVector< Number > &  R 
)
private

Definition at line 207 of file hdg_problem.C.

References compute_stress(), libMesh::make_range(), mms, q_point, qrule, libMesh::Real, scalar_n_dofs, u_sol, u_true_soln, v_sol, v_true_soln, and vel_cross_vel_residual().

Referenced by residual().

211 {
212  compute_stress(vel_gradient, vel_component, sigma);
213  const auto & mms_info = vel_component == 0 ? static_cast<const ExactSoln &>(u_true_soln)
214  : static_cast<const ExactSoln &>(v_true_soln);
215  for (const auto qp : make_range(qrule->n_points()))
216  {
217  const auto vel_cross_vel = vel_cross_vel_residual(u_sol, v_sol, qp, vel_component);
218 
219  // Prepare forcing function
220  Real f = 0;
221  if (mms)
222  f = mms_info.forcing((*q_point)[qp]);
223 
224  for (const auto i : make_range(scalar_n_dofs))
225  {
226  // Scalar equation dependence on vector and pressure dofs
227  R(i) += (*JxW)[qp] * ((*grad_scalar_phi)[i][qp] * sigma[qp]);
228 
229  // Scalar equation dependence on scalar dofs
230  R(i) -= (*JxW)[qp] * ((*grad_scalar_phi)[i][qp] * vel_cross_vel);
231 
232  if (mms)
233  // Scalar equation RHS
234  R(i) -= (*JxW)[qp] * (*scalar_phi)[i][qp] * f;
235  }
236  }
237 }
NumberVectorValue vel_cross_vel_residual(const std::vector< Number > &u_sol_local, const std::vector< Number > &v_sol_local, const unsigned int qp, const unsigned int vel_component) const
Definition: hdg_problem.C:179
std::vector< Number > v_sol
Definition: hdg_problem.h:224
void compute_stress(const std::vector< Gradient > &vel_gradient, const unsigned int vel_component, std::vector< Gradient > &sigma)
Definition: hdg_problem.C:133
const VSoln v_true_soln
Definition: hdg_problem.h:72
const std::vector< Point > * q_point
Definition: hdg_problem.h:202
std::unique_ptr< QBase > qrule
Definition: hdg_problem.h:52
std::vector< Number > u_sol
Definition: hdg_problem.h:221
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
const USoln u_true_soln
Definition: hdg_problem.h:71
std::size_t scalar_n_dofs
Definition: hdg_problem.h:244

◆ vector_dirichlet_residual()

void libMesh::HDGProblem::vector_dirichlet_residual ( const unsigned int  vel_component,
DenseVector< Number > &  R 
)
private

Definition at line 410 of file hdg_problem.C.

References get_dirichlet_velocity(), libMesh::make_range(), qface, and vector_n_dofs.

Referenced by residual().

411 {
412  for (const auto qp : make_range(qface->n_points()))
413  {
414  const auto scalar_value = get_dirichlet_velocity(qp)(vel_component);
415 
416  // External boundary -> Dirichlet faces -> Vector equation RHS
417  for (const auto i : make_range(vector_n_dofs))
418  R(i) -= (*JxW_face)[qp] * ((*vector_phi_face)[i][qp] * (*normals)[qp]) * scalar_value;
419  }
420 }
std::unique_ptr< QBase > qface
Definition: hdg_problem.h:56
RealVectorValue get_dirichlet_velocity(const unsigned int qp) const
Definition: hdg_problem.C:373
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::size_t vector_n_dofs
Definition: hdg_problem.h:243

◆ vector_face_jacobian()

void libMesh::HDGProblem::vector_face_jacobian ( DenseMatrix< Number > &  Jqlm)
private

Definition at line 432 of file hdg_problem.C.

References lm_n_dofs, lm_phi_face, libMesh::make_range(), qface, and vector_n_dofs.

Referenced by jacobian().

433 {
434  for (const auto qp : make_range(qface->n_points()))
435  // Vector equation dependence on LM dofs
436  for (const auto i : make_range(vector_n_dofs))
437  for (const auto j : make_range(lm_n_dofs))
438  Jqlm(i, j) -=
439  (*JxW_face)[qp] * ((*vector_phi_face)[i][qp] * (*normals)[qp]) * (*lm_phi_face)[j][qp];
440 }
std::unique_ptr< QBase > qface
Definition: hdg_problem.h:56
std::size_t lm_n_dofs
Definition: hdg_problem.h:245
const std::vector< std::vector< Real > > * lm_phi_face
Definition: hdg_problem.h:213
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::size_t vector_n_dofs
Definition: hdg_problem.h:243

◆ vector_face_residual()

void libMesh::HDGProblem::vector_face_residual ( const std::vector< Number > &  lm_sol,
DenseVector< Number > &  R 
)
private

Definition at line 423 of file hdg_problem.C.

References libMesh::make_range(), qface, and vector_n_dofs.

Referenced by residual().

424 {
425  for (const auto qp : make_range(qface->n_points()))
426  // Vector equation dependence on LM dofs
427  for (const auto i : make_range(vector_n_dofs))
428  R(i) -= (*JxW_face)[qp] * ((*vector_phi_face)[i][qp] * (*normals)[qp]) * lm_sol[qp];
429 }
std::unique_ptr< QBase > qface
Definition: hdg_problem.h:56
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::size_t vector_n_dofs
Definition: hdg_problem.h:243

◆ vector_volume_jacobian()

void libMesh::HDGProblem::vector_volume_jacobian ( DenseMatrix< Number > &  Jqq,
DenseMatrix< Number > &  Jqs 
)
private

Definition at line 163 of file hdg_problem.C.

References libMesh::make_range(), qrule, scalar_n_dofs, and vector_n_dofs.

Referenced by jacobian().

164 {
165  for (const auto qp : make_range(qrule->n_points()))
166  for (const auto i : make_range(vector_n_dofs))
167  {
168  // Vector equation dependence on vector dofs
169  for (const auto j : make_range(vector_n_dofs))
170  Jqq(i, j) += (*JxW)[qp] * ((*vector_phi)[i][qp] * (*vector_phi)[j][qp]);
171 
172  // Vector equation dependence on scalar dofs
173  for (const auto j : make_range(scalar_n_dofs))
174  Jqs(i, j) += (*JxW)[qp] * ((*div_vector_phi)[i][qp] * (*scalar_phi)[j][qp]);
175  }
176 }
std::unique_ptr< QBase > qrule
Definition: hdg_problem.h:52
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::size_t scalar_n_dofs
Definition: hdg_problem.h:244
std::size_t vector_n_dofs
Definition: hdg_problem.h:243

◆ vector_volume_residual()

void libMesh::HDGProblem::vector_volume_residual ( const std::vector< Gradient > &  vector_sol,
const std::vector< Number > &  scalar_sol,
DenseVector< Number > &  R 
)
private

Definition at line 147 of file hdg_problem.C.

References libMesh::make_range(), qrule, and vector_n_dofs.

Referenced by residual().

150 {
151  for (const auto qp : make_range(qrule->n_points()))
152  for (const auto i : make_range(vector_n_dofs))
153  {
154  // Vector equation dependence on vector dofs
155  R(i) += (*JxW)[qp] * ((*vector_phi)[i][qp] * vector_sol[qp]);
156 
157  // Vector equation dependence on scalar dofs
158  R(i) += (*JxW)[qp] * ((*div_vector_phi)[i][qp] * scalar_sol[qp]);
159  }
160 }
std::unique_ptr< QBase > qrule
Definition: hdg_problem.h:52
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:140
std::size_t vector_n_dofs
Definition: hdg_problem.h:243

◆ vel_cross_vel_jacobian()

NumberVectorValue libMesh::HDGProblem::vel_cross_vel_jacobian ( const std::vector< Number > &  u_sol_local,
const std::vector< Number > &  v_sol_local,
const unsigned int  qp,
const unsigned int  vel_component,
const unsigned int  vel_j_component,
const std::vector< std::vector< Real >> &  phi,
const unsigned int  j 
) const
private

Definition at line 189 of file hdg_problem.C.

Referenced by lm_face_jacobian(), scalar_face_jacobian(), and scalar_volume_jacobian().

196 {
197  const NumberVectorValue U(u_sol_local[qp], v_sol_local[qp]);
198  NumberVectorValue vector_phi_local;
199  vector_phi_local(vel_j_component) = phi[j][qp];
200  auto ret = vector_phi_local * U(vel_component);
201  if (vel_component == vel_j_component)
202  ret += U * phi[j][qp];
203  return ret;
204 }
VectorValue< Number > NumberVectorValue

◆ vel_cross_vel_residual()

NumberVectorValue libMesh::HDGProblem::vel_cross_vel_residual ( const std::vector< Number > &  u_sol_local,
const std::vector< Number > &  v_sol_local,
const unsigned int  qp,
const unsigned int  vel_component 
) const
private

Definition at line 179 of file hdg_problem.C.

Referenced by lm_face_residual(), scalar_face_residual(), and scalar_volume_residual().

183 {
184  const NumberVectorValue U(u_sol_local[qp], v_sol_local[qp]);
185  return U * U(vel_component);
186 }
VectorValue< Number > NumberVectorValue

Member Data Documentation

◆ bottom_bnd

boundary_id_type libMesh::HDGProblem::bottom_bnd

Definition at line 62 of file hdg_problem.h.

Referenced by init().

◆ cavity

bool libMesh::HDGProblem::cavity

◆ current_bnd

boundary_id_type libMesh::HDGProblem::current_bnd
private

◆ div_vector_phi

const std::vector<std::vector<Real> >* libMesh::HDGProblem::div_vector_phi
private

Definition at line 206 of file hdg_problem.h.

Referenced by init().

◆ dof_indices

std::unordered_map<unsigned int, std::vector<dof_id_type> > libMesh::HDGProblem::dof_indices
private

Definition at line 217 of file hdg_problem.h.

Referenced by add_matrix(), jacobian(), and residual().

◆ dof_map

const DofMap* libMesh::HDGProblem::dof_map

Definition at line 46 of file hdg_problem.h.

Referenced by jacobian(), main(), and residual().

◆ global_lm_dof_value

Number libMesh::HDGProblem::global_lm_dof_value
private

Definition at line 240 of file hdg_problem.h.

Referenced by jacobian(), pressure_volume_residual(), and residual().

◆ global_lm_n_dofs

std::size_t libMesh::HDGProblem::global_lm_n_dofs
private

Definition at line 247 of file hdg_problem.h.

Referenced by init().

◆ grad_scalar_phi

const std::vector<std::vector<RealVectorValue> >* libMesh::HDGProblem::grad_scalar_phi
private

Definition at line 205 of file hdg_problem.h.

Referenced by init().

◆ JxW

const std::vector<Real>* libMesh::HDGProblem::JxW
private

Definition at line 201 of file hdg_problem.h.

Referenced by init().

◆ JxW_face

const std::vector<Real>* libMesh::HDGProblem::JxW_face
private

Definition at line 209 of file hdg_problem.h.

Referenced by init(), jacobian(), and residual().

◆ left_bnd

boundary_id_type libMesh::HDGProblem::left_bnd

Definition at line 59 of file hdg_problem.h.

Referenced by get_dirichlet_velocity(), and init().

◆ lm_fe_face

std::unique_ptr<FEBase> libMesh::HDGProblem::lm_fe_face

Definition at line 55 of file hdg_problem.h.

Referenced by init(), jacobian(), main(), and residual().

◆ lm_n_dofs

std::size_t libMesh::HDGProblem::lm_n_dofs
private

◆ lm_phi_face

const std::vector<std::vector<Real> >* libMesh::HDGProblem::lm_phi_face
private

◆ lm_u_dof_values

std::vector<Number> libMesh::HDGProblem::lm_u_dof_values
private

Definition at line 235 of file hdg_problem.h.

Referenced by jacobian(), and residual().

◆ lm_u_sol

std::vector<Number> libMesh::HDGProblem::lm_u_sol
private

◆ lm_v_dof_values

std::vector<Number> libMesh::HDGProblem::lm_v_dof_values
private

Definition at line 238 of file hdg_problem.h.

Referenced by jacobian(), and residual().

◆ lm_v_sol

std::vector<Number> libMesh::HDGProblem::lm_v_sol
private

◆ mesh

const MeshBase* libMesh::HDGProblem::mesh

Definition at line 45 of file hdg_problem.h.

Referenced by init(), jacobian(), main(), and residual().

◆ mms

bool libMesh::HDGProblem::mms

◆ neigh

const Elem* libMesh::HDGProblem::neigh
private

◆ normals

const std::vector<Point>* libMesh::HDGProblem::normals
private

Definition at line 214 of file hdg_problem.h.

Referenced by init().

◆ nu

Real libMesh::HDGProblem::nu

◆ p_dof_values

std::vector<Number> libMesh::HDGProblem::p_dof_values
private

Definition at line 239 of file hdg_problem.h.

Referenced by jacobian(), and residual().

◆ p_n_dofs

std::size_t libMesh::HDGProblem::p_n_dofs
private

◆ p_sol

std::vector<Number> libMesh::HDGProblem::p_sol
private

◆ p_true_soln

const PSoln libMesh::HDGProblem::p_true_soln

Definition at line 73 of file hdg_problem.h.

Referenced by main(), and pressure_volume_residual().

◆ q_point

const std::vector<Point>* libMesh::HDGProblem::q_point
private

Definition at line 202 of file hdg_problem.h.

Referenced by init(), pressure_volume_residual(), and scalar_volume_residual().

◆ qbar

std::vector<Number> libMesh::HDGProblem::qbar
private

Definition at line 259 of file hdg_problem.h.

◆ qface

std::unique_ptr<QBase> libMesh::HDGProblem::qface

◆ qface_point

const std::vector<Point>* libMesh::HDGProblem::qface_point
private

Definition at line 210 of file hdg_problem.h.

Referenced by get_dirichlet_velocity(), and init().

◆ qrule

std::unique_ptr<QBase> libMesh::HDGProblem::qrule

◆ qu_dof_values

std::vector<Number> libMesh::HDGProblem::qu_dof_values
private

Definition at line 233 of file hdg_problem.h.

Referenced by jacobian(), and residual().

◆ qu_sol

std::vector<Gradient> libMesh::HDGProblem::qu_sol
private

Definition at line 220 of file hdg_problem.h.

Referenced by jacobian(), and residual().

◆ qv_dof_values

std::vector<Number> libMesh::HDGProblem::qv_dof_values
private

Definition at line 236 of file hdg_problem.h.

Referenced by jacobian(), and residual().

◆ qv_sol

std::vector<Gradient> libMesh::HDGProblem::qv_sol
private

Definition at line 223 of file hdg_problem.h.

Referenced by jacobian(), and residual().

◆ right_bnd

boundary_id_type libMesh::HDGProblem::right_bnd

◆ sc

StaticCondensation* libMesh::HDGProblem::sc

Definition at line 47 of file hdg_problem.h.

Referenced by jacobian(), and main().

◆ scalar_fe

std::unique_ptr<FEBase> libMesh::HDGProblem::scalar_fe

Definition at line 51 of file hdg_problem.h.

Referenced by init(), jacobian(), main(), and residual().

◆ scalar_fe_face

std::unique_ptr<FEBase> libMesh::HDGProblem::scalar_fe_face

Definition at line 54 of file hdg_problem.h.

Referenced by init(), jacobian(), main(), and residual().

◆ scalar_n_dofs

std::size_t libMesh::HDGProblem::scalar_n_dofs
private

◆ scalar_phi

const std::vector<std::vector<Real> >* libMesh::HDGProblem::scalar_phi
private

◆ scalar_phi_face

const std::vector<std::vector<Real> >* libMesh::HDGProblem::scalar_phi_face
private

Definition at line 212 of file hdg_problem.h.

Referenced by init(), jacobian(), and residual().

◆ sigma_u

std::vector<Gradient> libMesh::HDGProblem::sigma_u
private

Definition at line 229 of file hdg_problem.h.

Referenced by residual().

◆ sigma_v

std::vector<Gradient> libMesh::HDGProblem::sigma_v
private

Definition at line 230 of file hdg_problem.h.

Referenced by residual().

◆ system

System* libMesh::HDGProblem::system

Definition at line 44 of file hdg_problem.h.

Referenced by main().

◆ tau

constexpr Real libMesh::HDGProblem::tau = 1
staticprivate

◆ top_bnd

boundary_id_type libMesh::HDGProblem::top_bnd

Definition at line 60 of file hdg_problem.h.

Referenced by get_dirichlet_velocity(), and init().

◆ u_dof_values

std::vector<Number> libMesh::HDGProblem::u_dof_values
private

Definition at line 234 of file hdg_problem.h.

Referenced by jacobian(), and residual().

◆ u_sol

std::vector<Number> libMesh::HDGProblem::u_sol
private

◆ u_true_soln

const USoln libMesh::HDGProblem::u_true_soln

Definition at line 71 of file hdg_problem.h.

Referenced by get_dirichlet_velocity(), main(), and scalar_volume_residual().

◆ v_dof_values

std::vector<Number> libMesh::HDGProblem::v_dof_values
private

Definition at line 237 of file hdg_problem.h.

Referenced by jacobian(), and residual().

◆ v_sol

std::vector<Number> libMesh::HDGProblem::v_sol
private

◆ v_true_soln

const VSoln libMesh::HDGProblem::v_true_soln

Definition at line 72 of file hdg_problem.h.

Referenced by get_dirichlet_velocity(), main(), and scalar_volume_residual().

◆ vector_fe

std::unique_ptr<FEVectorBase> libMesh::HDGProblem::vector_fe

Definition at line 50 of file hdg_problem.h.

Referenced by init(), jacobian(), main(), and residual().

◆ vector_fe_face

std::unique_ptr<FEVectorBase> libMesh::HDGProblem::vector_fe_face

Definition at line 53 of file hdg_problem.h.

Referenced by init(), jacobian(), main(), and residual().

◆ vector_n_dofs

std::size_t libMesh::HDGProblem::vector_n_dofs
private

◆ vector_phi

const std::vector<std::vector<RealVectorValue> >* libMesh::HDGProblem::vector_phi
private

Definition at line 203 of file hdg_problem.h.

Referenced by init(), jacobian(), and residual().

◆ vector_phi_face

const std::vector<std::vector<RealVectorValue> >* libMesh::HDGProblem::vector_phi_face
private

Definition at line 211 of file hdg_problem.h.

Referenced by init(), jacobian(), and residual().


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