Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-02 08:48:23

0001 #ifndef TRAPEZOIDAL_INTEGRATOR_1D_H
0002 #define TRAPEZOIDAL_INTEGRATOR_1D_H
0003 
0004 /**
0005  * @file TrapezoidalIntegrator1D.h
0006  * @author Bryan BERTHOU (SPhN / CEA Saclay)
0007  * @author Cédric Mezrag (ANL / PHY)
0008  * @date 23 October 2015
0009  * @version 1.0
0010  */
0011 
0012 #include "QuadratureIntegrator1D.h"
0013 
0014 class FunctionType1D;
0015 
0016 namespace NumA {
0017 
0018 /**
0019  * @class TrapezoidalIntegrator1D
0020  *
0021  * @brief Trapezoidal integration.
0022  *
0023  * See Integrator1D documentation for an example.
0024  */
0025 
0026 class TrapezoidalIntegrator1D: public QuadratureIntegrator1D {
0027 
0028 public:
0029 
0030     /**
0031      * Constructor.
0032      * @param N Order of the quadrature (number of nodes).
0033      */
0034     TrapezoidalIntegrator1D(unsigned int N = 40);
0035 
0036     /**
0037      * Default destructor.
0038      */
0039     virtual ~TrapezoidalIntegrator1D();
0040 
0041     virtual TrapezoidalIntegrator1D* clone() const;
0042 
0043     virtual void setN(unsigned int n);
0044 
0045 protected:
0046 
0047     /**
0048      * Copy constructor.
0049      * Called by clone().
0050      * @param other TrapezoidalIntegrator1D object to copy.
0051      */
0052     TrapezoidalIntegrator1D(const TrapezoidalIntegrator1D &other);
0053 
0054     /**
0055      * Computes the nodes and weights of the Gauss-Legendre quadrature. Called when N is set.
0056      */
0057     void setNodesAndWeights();
0058 };
0059 
0060 } /* namespace NumA */
0061 
0062 #endif /* TRAPEZOIDAL_INTEGRATOR_1D_H */