TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Quadrature_base.h
1/****************************************************************************
2 * Copyright (c) 2024, CEA
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6 * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7 * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8 * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9 *
10 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13 *
14 *****************************************************************************/
15#ifndef Quadrature_base_included
16#define Quadrature_base_included
17
18#include <TRUSTTabs_forward.h>
19#include <Parser_U.h>
20#include <Domaine_DG.h>
21#include <Matrice_Morse_Sym.h>
22
24{
25public:
28
29 virtual ~Quadrature_base() {}
30
31 inline const DoubleTab& get_integ_points() const { return integ_points_; }
32 inline const DoubleTab& get_integ_points_facets() const { return integ_points_facets_; }
33
34 inline const DoubleTab& get_weights() const { return weights_; }
35 inline const DoubleTab& get_weights_facets() const { return weights_facets_; }
36
37 inline const IntTab& get_tab_nb_pts_integ() const { return tab_nb_pts_integ_; }
38 inline const IntTab& get_ind_pts_integ() const { return ind_pts_integ_; }
39
40 /*! Compute for the whole domain the exact location of integration points per element
41 */
42 virtual void compute_integ_points() = 0;
43
44 /*! Compute for the whole domain the exact location of integration points per facet
45 */
47
48
49 inline int nb_pts_integ_max() const { return nb_pts_integ_max_; } // TODO: max du nombre de pts de la quadrature
50 inline int nb_pts_integ(int e ) const { return tab_nb_pts_integ_(e); }
51 inline int nb_pts_integ_facets() const { return nb_pts_integ_facets_; }
52 inline int ind_pts_integ(int e ) const { return ind_pts_integ_(e); }
53
54 /*! Compute the integral of a function on the whole domain
55 */
56 double compute_integral(Parser_U& parser) const;
57 /*! Compute the integral of a function on the whole domain with its values on integration points
58 */
59 double compute_integral(DoubleTab& vals_pts_integ) const;
60 /*! Compute the integral of a function on one triangle
61 */
62 double compute_integral_on_elem(int num_elem, Parser_U& parser) const ;
63 /*! Compute the integral of a function on each triangle
64 */
65 double compute_integral_on_elem(Parser_U& parser) const ;
66
67 /*! Compute the integral of a function on one triangle with its value on integration points
68 */
69 double compute_integral_on_elem(int num_elem, DoubleTab& val_pts_integ) const ;
70 /*! Compute the integral of a function on each triangle with its value on integration points
71 */
72 // DoubleTab compute_integral_on_elem(DoubleTab& val_pts_integ) const ; // pas sur que cela serve : je commente jusqu'a destruction
73
74 /*! Compute the integral of a function on one facet
75 */
76 double compute_integral_on_facet(int num_facet, Parser_U& parser) const ;
77 /*! Compute the integral of a function on one facet with its value on integration points
78 */
79 double compute_integral_on_facet(int num_facet, DoubleTab& val_pts_integ) const ;
80
81
82protected:
84
85 int nb_pts_integ_quad_; // local numbers of integ points for quadrangles
86 int nb_pts_integ_tri_; // // local numbers of integ points for triangles
87 int nb_pts_integ_facets_; // local numbers of integ points for facets
88 int nb_pts_integ_max_; // maximal number of integ points for all geometrical types
89
90 IntTab tab_nb_pts_integ_; // numbers of integ points cumulated
91
92 IntTab ind_pts_integ_; // numero of the first integ points
93
94 DoubleTab integ_points_; // Integ points for quadrature formula
95 DoubleTab integ_points_facets_; // Integ points for quadrature formula for facets
96 DoubleTab weights_; //global weights
97 DoubleTab weights_quad_; // local numbers
98 DoubleTab weights_tri_; // local numbers
99 DoubleTab weights_facets_; // local numbers
100
101 // Computes the area of a triangle from vertex coordinates
102 double triangleArea(double x1, double y1, double x2, double y2, double x3, double y3);
103
104 // Computes a weight scale based on tessellation triangle and element volume
105 double calculateWeightScale(const IntTab& vert_elems, const DoubleTab& xs, DoubleVect& volumes, int e, int s1, int s2, int s3);
106 double calculateWeightScale(double ve, double s1x, double s1y, double s2x, double s2y, double s3x, double s3y);
107
108};
109
110#endif
classe Parser_U Version de la classe Parser, derivant de Objet_U.
Definition Parser_U.h:32
double triangleArea(double x1, double y1, double x2, double y2, double x3, double y3)
DoubleTab weights_facets_
int ind_pts_integ(int e) const
DoubleTab integ_points_
int nb_pts_integ(int e) const
double calculateWeightScale(const IntTab &vert_elems, const DoubleTab &xs, DoubleVect &volumes, int e, int s1, int s2, int s3)
const DoubleTab & get_weights() const
DoubleTab weights_tri_
double compute_integral_on_facet(int num_facet, Parser_U &parser) const
const DoubleTab & get_integ_points_facets() const
double compute_integral(Parser_U &parser) const
const DoubleTab & get_weights_facets() const
DoubleTab integ_points_facets_
const DoubleTab & get_integ_points() const
virtual void compute_integ_points()=0
double compute_integral_on_elem(Parser_U &parser) const
int nb_pts_integ_max() const
const IntTab & get_tab_nb_pts_integ() const
double compute_integral_on_elem(int num_elem, Parser_U &parser) const
Quadrature_base(const Domaine_DG &dom)
int nb_pts_integ_facets() const
virtual void compute_integ_points_on_facet()=0
const IntTab & get_ind_pts_integ() const
OBS_PTR(Domaine_DG) dom_
virtual ~Quadrature_base()
DoubleTab weights_quad_