www.mooseframework.org
ArbitraryQuadrature.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 // MOOSE includes
13 #include "Moose.h" // using namespace libMesh
14 
15 #include "libmesh/quadrature.h"
16 
21 class ArbitraryQuadrature : public QBase
22 {
23 public:
24  ArbitraryQuadrature(const unsigned int _dim, const Order _order = INVALID_ORDER);
25 
30  ArbitraryQuadrature(const ArbitraryQuadrature &) = default;
34  virtual ~ArbitraryQuadrature() = default;
35 
36  QuadratureType type() const override;
37 
41  void setPoints(const std::vector<Point> & points);
42 
46  void setWeights(const std::vector<Real> & weights);
47 
48  virtual bool shapes_need_reinit() override { return true; }
49 
50  virtual std::unique_ptr<QBase> clone() const override;
51 
52 private:
58  void init_1D(const ElemType _type = INVALID_ELEM, unsigned int p_level = 0) override;
59  void init_2D(const ElemType _type = INVALID_ELEM, unsigned int p_level = 0) override;
60  void init_3D(const ElemType _type = INVALID_ELEM, unsigned int p_level = 0) override;
61 };
void setWeights(const std::vector< Real > &weights)
Set the quadrature weights.
ElemType
Order
QuadratureType type() const override
void init_2D(const ElemType _type=INVALID_ELEM, unsigned int p_level=0) override
void setPoints(const std::vector< Point > &points)
Set the quadrature points.
void init_1D(const ElemType _type=INVALID_ELEM, unsigned int p_level=0) override
These functions must be defined to fulfill the interface expected by the quadrature initialization ro...
ArbitraryQuadrature & operator=(const ArbitraryQuadrature &)=default
QuadratureType
virtual ~ArbitraryQuadrature()=default
Implements a fake quadrature rule where you can specify the locations (in the reference domain) of th...
virtual std::unique_ptr< QBase > clone() const override
INVALID_ORDER
void init_3D(const ElemType _type=INVALID_ELEM, unsigned int p_level=0) override
virtual bool shapes_need_reinit() override
ArbitraryQuadrature(const unsigned int _dim, const Order _order=INVALID_ORDER)