4 #include "libmesh/sparse_matrix.h" 5 #include "libmesh/numeric_vector.h" 6 #include "libmesh/dense_matrix.h" 7 #include "libmesh/dense_vector.h" 8 #include "libmesh/fe.h" 9 #include "libmesh/fe_interface.h" 10 #include "libmesh/fe_base.h" 11 #include "libmesh/elem_assembly.h" 12 #include "libmesh/quadrature_gauss.h" 13 #include "libmesh/boundary_info.h" 16 #include "libmesh/rb_theta.h" 17 #include "libmesh/rb_assembly_expansion.h" 18 #include "libmesh/rb_parametrized_function.h" 19 #include "libmesh/rb_eim_construction.h" 20 #include "libmesh/rb_eim_theta.h" 56 virtual std::vector<Number>
62 const std::vector<Point> & ,
63 const std::vector<Real> & )
override 67 return {1. + curvature*p(0), 1. + curvature*p(0), 1./(1. + curvature*p(0))};
83 std::vector<boundary_id_type> bc_ids;
85 for (
const auto & bc_id : bc_ids)
86 if (bc_id == 1 || bc_id == 2 || bc_id == 3 || bc_id == 4)
88 const unsigned int u_var = 0;
90 FEBase * side_fe =
nullptr;
93 const std::vector<Real> & JxW_side = side_fe->get_JxW();
95 const std::vector<std::vector<Real>> & phi_side = side_fe->get_phi();
103 for (
unsigned int qp=0; qp != n_sidepoints; qp++)
104 for (
unsigned int i=0; i != n_u_dofs; i++)
105 for (
unsigned int j=0; j != n_u_dofs; j++)
125 std::vector<boundary_id_type> bc_ids;
127 for (
const auto & bc_id : bc_ids)
128 if (bc_id == 1 || bc_id == 3)
130 const unsigned int u_var = 0;
132 FEBase * side_fe =
nullptr;
135 const std::vector<Real> & JxW_side = side_fe->get_JxW();
137 const std::vector<std::vector<Real>> & phi_side = side_fe->get_phi();
139 const std::vector<Point> & xyz = side_fe->get_xyz();
147 for (
unsigned int qp=0; qp != n_sidepoints; qp++)
149 Real x_hat = xyz[qp](0);
151 for (
unsigned int i=0; i != n_u_dofs; i++)
152 for (
unsigned int j=0; j != n_u_dofs; j++)
153 c.
get_elem_jacobian()(i,j) += JxW_side[qp] * x_hat * phi_side[j][qp]*phi_side[i][qp];
171 std::vector<boundary_id_type> bc_ids;
173 for (
const auto & bc_id : bc_ids)
174 if (bc_id == 2 || bc_id == 4)
176 const unsigned int u_var = 0;
178 FEBase * side_fe =
nullptr;
181 const std::vector<Real> & JxW_side = side_fe->get_JxW();
183 const std::vector<std::vector<Real>> & phi_side = side_fe->get_phi();
193 for (
unsigned int qp=0; qp != n_sidepoints; qp++)
195 for (
unsigned int i=0; i != n_u_dofs; i++)
196 for (
unsigned int j=0; j != n_u_dofs; j++)
203 for (
unsigned int qp=0; qp != n_sidepoints; qp++)
205 for (
unsigned int i=0; i != n_u_dofs; i++)
206 for (
unsigned int j=0; j != n_u_dofs; j++)
222 return mu.
get_value(
"kappa") * RBEIMTheta::evaluate(mu);
229 unsigned int basis_function_index_in) :
231 basis_function_index_in)
237 const unsigned int u_var = 0;
240 const unsigned int Gx_var = 0;
241 const unsigned int Gy_var = 1;
242 const unsigned int Gz_var = 2;
244 FEBase * elem_fe =
nullptr;
247 const std::vector<Real> & JxW = elem_fe->get_JxW();
249 const std::vector<std::vector<RealGradient>> & dphi = elem_fe->get_dphi();
254 std::vector<Number> eim_values_Gx;
259 std::vector<Number> eim_values_Gy;
264 std::vector<Number> eim_values_Gz;
270 for (
unsigned int i=0; i != n_u_dofs; i++)
271 for (
unsigned int j=0; j != n_u_dofs; j++)
272 c.
get_elem_jacobian()(i,j) += JxW[qp] * (eim_values_Gx[qp]*dphi[i][qp](0)*dphi[j][qp](0) +
273 eim_values_Gy[qp]*dphi[i][qp](1)*dphi[j][qp](1) +
274 eim_values_Gz[qp]*dphi[i][qp](2)*dphi[j][qp](2));
289 const unsigned int u_var = 0;
291 FEBase * elem_fe =
nullptr;
294 const std::vector<Real> & JxW = elem_fe->get_JxW();
296 const std::vector<std::vector<Real>> & phi = elem_fe->get_phi();
304 for (
unsigned int qp=0; qp != n_qpoints; qp++)
305 for (
unsigned int i=0; i != n_u_dofs; i++)
323 const unsigned int u_var = 0;
325 FEBase * elem_fe =
nullptr;
328 const std::vector<Real> & JxW = elem_fe->get_JxW();
330 const std::vector<std::vector<Real>> & phi = elem_fe->get_phi();
332 const std::vector<Point> & xyz = elem_fe->get_xyz();
340 for (
unsigned int qp=0; qp != n_qpoints; qp++)
342 Real x_hat = xyz[qp](0);
344 for (
unsigned int i=0; i != n_u_dofs; i++)
355 const unsigned int u_var = 0;
357 FEBase * elem_fe =
nullptr;
360 const std::vector<Real> & JxW = elem_fe->get_JxW();
362 const std::vector<std::vector<RealGradient>> & dphi = elem_fe->get_dphi();
370 for (
unsigned int qp=0; qp != n_qpoints; qp++)
371 for (
unsigned int i=0; i != n_u_dofs; i++)
372 for (
unsigned int j=0; j != n_u_dofs; j++)
unsigned int get_n_components() const override
Specify the number of components in this parametrized function.
Real get_value(const std::string ¶m_name) const
Get the value of the specified parameter, throw an error if it does not exist.
RealVectorValue RealGradient
const DenseMatrix< Number > & get_elem_jacobian() const
Const accessor for element Jacobian.
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for edge/face (2D/3D) finite element object for variable var for the largest dimension in th...
virtual void boundary_assembly(FEMContext &c)
Perform the element boundary assembly.
const Elem & get_elem() const
Accessor for current Elem object.
A simple functor class that provides a RBParameter-dependent function.
This class provides functionality required to define an RBTheta object that arises from an "Empirical...
TestClass subdomain_id_type
Based on the 4-byte comment warning above, this probably doesn't work with exodusII at all...
virtual Number evaluate(const RBParameters &mu)
Evaluate the functor object for the given parameter.
virtual Number evaluate(const RBParameters &mu)
Evaluate the functor object for the given parameter.
This class is part of the rbOOmit framework.
This is the base class from which all geometric element types are derived.
void evaluate_basis_function(dof_id_type elem_id, unsigned int var, std::vector< Number > &values)
Return the basis function values for all quadrature points for variable var on element elem_id...
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
Ex6ThetaExpansion()
Constructor.
const MeshBase & get_mesh() const
void attach_F_assembly(ElemAssembly *Fq_assembly)
Attach ElemAssembly object for the right-hand side (both interior and boundary assembly).
This class stores the set of RBTheta functor objects that define the "parameter-dependent expansion" ...
virtual void attach_F_theta(RBTheta *theta_q_f)
Attach a pointer to a functor object that defines one of the theta_q_a terms.
virtual void boundary_assembly(FEMContext &c)
Perform the element boundary assembly.
This class provides functionality required to define an assembly object that arises from an "Empirica...
virtual void interior_assembly(FEMContext &c)
Perform the element interior assembly.
ThetaEIM(RBEIMEvaluation &rb_eim_eval_in, unsigned int index_in)
const System & get_system() const
Accessor for associated system.
virtual void interior_assembly(FEMContext &c)
Perform the element interior assembly.
Defines a dense submatrix for use in Finite Element-type computations.
virtual Number evaluate(const RBParameters &mu)
Evaluate the functor object for the given parameter.
This class provides all data required for a physics package (e.g.
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
unsigned int n_points() const
This class is part of the rbOOmit framework.
virtual Number evaluate(const RBParameters &)
Evaluate the functor object for the given parameter.
FEGenericBase< Real > FEBase
This class provides an encapsulated access to all static public member functions of finite element cl...
virtual Number evaluate(const RBParameters &mu)
Evaluate this RBEIMTheta object at the parameter mu.
void attach_A_assembly(ElemAssembly *Aq_assembly)
Attach ElemAssembly object for the left-hand side (both interior and boundary assembly).
virtual void boundary_assembly(FEMContext &c)
Perform the element boundary assembly.
const DenseVector< Number > & get_elem_residual() const
Const accessor for element residual.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
unsigned char side
Current side for side_* to examine.
virtual Number evaluate(const RBParameters &mu)
Evaluate the functor object for the given parameter.
virtual std::vector< Number > evaluate(const RBParameters &mu, const Point &p, dof_id_type, unsigned int, subdomain_id_type, const std::vector< Point > &, const std::vector< Real > &) override
This class stores the set of ElemAssembly functor objects that define the "parameter-independent expa...
ElemAssembly provides a per-element (interior and boundary) assembly functionality.
AssemblyEIM(RBEIMConstruction &rb_eim_con_in, unsigned int basis_function_index_in)
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh...
This class is part of the rbOOmit framework.
virtual void interior_assembly(FEMContext &c)
Perform the element interior assembly.
Ex6AssemblyExpansion()
Constructor.
This class is part of the rbOOmit framework.
This class enables evaluation of an Empirical Interpolation Method (EIM) approximation.
virtual void interior_assembly(FEMContext &c)
Perform the element interior assembly.
A Point defines a location in LIBMESH_DIM dimensional Real space.
const QBase & get_element_qrule() const
Accessor for element interior quadrature rule for the dimension of the current _elem.
const QBase & get_side_qrule() const
Accessor for element side quadrature rule for the dimension of the current _elem. ...
virtual void attach_A_theta(RBTheta *theta_q_a)
Attach a pointer to a functor object that defines one of the theta_q_a terms.