programmer's documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cs_hho_builder.h
Go to the documentation of this file.
1 #ifndef __CS_HHO_BUILDER_H__
2 #define __CS_HHO_BUILDER_H__
3 
4 /*============================================================================
5  * Low-level functions and structures used to build the algebraic system with
6  * a cellwise process when Hybrid High Order schemes are set for the space
7  * discretization
8  *============================================================================*/
9 
10 /*
11  This file is part of Code_Saturne, a general-purpose CFD tool.
12 
13  Copyright (C) 1998-2017 EDF S.A.
14 
15  This program is free software; you can redistribute it and/or modify it under
16  the terms of the GNU General Public License as published by the Free Software
17  Foundation; either version 2 of the License, or (at your option) any later
18  version.
19 
20  This program is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
23  details.
24 
25  You should have received a copy of the GNU General Public License along with
26  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
27  Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29 
30 /*----------------------------------------------------------------------------
31  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_base.h"
35 #include "cs_basis_func.h"
36 #include "cs_cdo.h"
37 #include "cs_cdo_connect.h"
38 #include "cs_sdm.h"
39 #include "cs_xdef.h"
40 
41 /*----------------------------------------------------------------------------*/
42 
44 
45 /*============================================================================
46  * Macro definitions
47  *============================================================================*/
48 
49 /*============================================================================
50  * Type definitions
51  *============================================================================*/
52 
53 /* Cellwise builder for HHO discretization */
54 typedef struct {
55 
56  /* Current and maximal number of face basis allocated. This number is equal
57  to the max. number of faces for a cell */
58  short int n_face_basis;
59  short int n_max_face_basis;
60 
61  cs_basis_func_t **face_basis; /* P_(d-1)^k polynomial basis */
62  cs_basis_func_t *cell_basis; /* P_d^k polynomial basis */
63  cs_basis_func_t *grad_basis; /* P_d^(k+1) \ P_d^0 polynomial basis */
64 
65  cs_sdm_t *grad_reco_op; /* Gradient operator; Rectangular matrix */
66 
67  /* Temporary matrices defined by blocks */
68  cs_sdm_t *tmp; /* Temporary block matrix (fs x ts) */
69  cs_sdm_t *bf_t; /* Transposed of Bf (used in stabilization) */
70  cs_sdm_t *jstab; /* Stabilization part related to a face */
71 
73 
74 /*============================================================================
75  * Public function prototypes
76  *============================================================================*/
77 
78 /*----------------------------------------------------------------------------*/
87 /*----------------------------------------------------------------------------*/
88 
90 cs_hho_builder_create(int order,
91  int n_fc);
92 
93 /*----------------------------------------------------------------------------*/
99 /*----------------------------------------------------------------------------*/
100 
101 void
103 
104 /*----------------------------------------------------------------------------*/
115 /*----------------------------------------------------------------------------*/
116 
117 void
119  cs_cell_builder_t *cb,
120  cs_hho_builder_t *hhob);
121 
122 /*----------------------------------------------------------------------------*/
134 /*----------------------------------------------------------------------------*/
135 
136 void
138  cs_cell_builder_t *cb,
139  cs_hho_builder_t *hhob);
140 
141 /*----------------------------------------------------------------------------*/
150 /*----------------------------------------------------------------------------*/
151 
152 void
154  cs_cell_builder_t *cb,
155  cs_hho_builder_t *hhob);
156 
157 /*----------------------------------------------------------------------------*/
170 /*----------------------------------------------------------------------------*/
171 
172 void
174  const cs_cell_mesh_t *cm,
175  cs_cell_builder_t *cb,
176  cs_hho_builder_t *hhob,
177  cs_real_t red[]);
178 
179 /*----------------------------------------------------------------------------*/
180 
182 
183 #endif /* __CS_HHO_BUILDER_H__ */
Definition: cs_basis_func.h:182
void cs_hho_builder_cellwise_setup(const cs_cell_mesh_t *cm, cs_cell_builder_t *cb, cs_hho_builder_t *hhob)
Set-up the basis functions related to a cell, its gradient and to the faces of this cell...
Definition: cs_hho_builder.c:699
cs_sdm_t * bf_t
Definition: cs_hho_builder.h:69
#define BEGIN_C_DECLS
Definition: cs_defs.h:453
short int n_face_basis
Definition: cs_hho_builder.h:58
void cs_hho_builder_reduction_from_analytic(const cs_xdef_t *def, const cs_cell_mesh_t *cm, cs_cell_builder_t *cb, cs_hho_builder_t *hhob, cs_real_t red[])
Compute the reduction onto the polynomial spaces (cell and faces) of a function defined by an analyti...
Definition: cs_hho_builder.c:1271
Definition: cs_cdo_local.h:138
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
cs_sdm_t * grad_reco_op
Definition: cs_hho_builder.h:65
void cs_hho_builder_diffusion(const cs_cell_mesh_t *cm, cs_cell_builder_t *cb, cs_hho_builder_t *hhob)
Compute the diffusion operator. The gradient reconstruction operator has to be built just before this...
Definition: cs_hho_builder.c:975
cs_basis_func_t * grad_basis
Definition: cs_hho_builder.h:63
void cs_hho_builder_free(cs_hho_builder_t **p_builder)
Free a cs_hho_builder_t structure.
Definition: cs_hho_builder.c:659
short int n_max_face_basis
Definition: cs_hho_builder.h:59
Definition: cs_hho_builder.h:54
cs_basis_func_t * cell_basis
Definition: cs_hho_builder.h:62
void cs_hho_builder_compute_grad_reco(const cs_cell_mesh_t *cm, cs_cell_builder_t *cb, cs_hho_builder_t *hhob)
Compute the gradient operator stemming from the relation stiffness * grad_op = rhs where stiffness is...
Definition: cs_hho_builder.c:749
cs_hho_builder_t * cs_hho_builder_create(int order, int n_fc)
Allocate a cs_hho_builder_t structure.
Definition: cs_hho_builder.c:606
Definition: cs_cdo_local.h:71
Definition: cs_xdef.h:72
cs_sdm_t * jstab
Definition: cs_hho_builder.h:70
#define END_C_DECLS
Definition: cs_defs.h:454
cs_basis_func_t ** face_basis
Definition: cs_hho_builder.h:61
cs_sdm_t * tmp
Definition: cs_hho_builder.h:68