8.3
general documentation
cs_at_opt_interp.h
Go to the documentation of this file.
1#ifndef __CS_AT_OPT_INTERP_H__
2#define __CS_AT_OPT_INTERP_H__
3
4/*============================================================================
5 * Optimal Interpolation.
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2024 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------*/
29
30#if defined(HAVE_MPI)
31#include <mpi.h>
32#endif
33
34/*----------------------------------------------------------------------------
35 * Local headers
36 *----------------------------------------------------------------------------*/
37
38#include "cs_defs.h"
39
40#include "cs_field.h"
41#include "cs_measures_util.h"
42
43/*----------------------------------------------------------------------------*/
44
46
47/*=============================================================================
48 * Macro definitions
49 *============================================================================*/
50
51/*============================================================================
52 * Type definitions
53 *============================================================================*/
54
55typedef enum {
56
57 CS_AT_OPT_INTERP_P0, /* Interpolation from cell containing the observation */
58 CS_AT_OPT_INTERP_P1 /* Interpolation from (partial) extended neighbourhood */
59
61
62typedef struct _cs_at_opt_interp_t {
63
64 const char *name; /* Name */
65 int id; /* Id */
66 int ig_id;
74 cs_real_t ir[2];
84 int steady;
87
89
90/*============================================================================
91 * Global variables
92 *============================================================================*/
93
94/*=============================================================================
95 * Public function prototypes
96 *============================================================================*/
97
98/*----------------------------------------------------------------------------*/
105/*----------------------------------------------------------------------------*/
106
108cs_at_opt_interp_create(const char *name);
109
110/*----------------------------------------------------------------------------*/
121/*----------------------------------------------------------------------------*/
122
125
126/*----------------------------------------------------------------------------*/
137/*----------------------------------------------------------------------------*/
138
140cs_at_opt_interp_by_name(const char *name);
141
142/*----------------------------------------------------------------------------*/
146/*----------------------------------------------------------------------------*/
147
148void
150
151/*----------------------------------------------------------------------------*/
162/*----------------------------------------------------------------------------*/
163
164void
165cs_at_opt_interp_read_file(char const filename[50],
168 const int f_dim);
169
170/*----------------------------------------------------------------------------*/
178/*----------------------------------------------------------------------------*/
179
180int
182
183/*----------------------------------------------------------------------------*/
191/*----------------------------------------------------------------------------*/
192
193void
196
197/*----------------------------------------------------------------------------*/
205/*----------------------------------------------------------------------------*/
206
207void
211
212/*----------------------------------------------------------------------------*/
219/*----------------------------------------------------------------------------*/
220
221void
224
225/*----------------------------------------------------------------------------*/
239/*----------------------------------------------------------------------------*/
240
241int *
244 cs_field_t *f_oia,
245 bool **inverse,
246 int ***ao_idx);
247
248/*----------------------------------------------------------------------------*/
260/*----------------------------------------------------------------------------*/
261
262void
265 cs_field_t *f_oia,
266 int n_active_obs,
267 int *ao_idx,
268 bool inverse,
269 int mc_id);
270
271/*----------------------------------------------------------------------------*/
272
274
275#endif /* __CS_AT_OPT_INTERP_H__ */
cs_at_opt_interp_t * cs_at_opt_interp_by_id(int id)
Return a pointer to an optimal interpolation based on its id.
Definition: cs_at_opt_interp.cpp:614
void cs_at_opt_interp_map_values(cs_at_opt_interp_t *oi, cs_measures_set_t *ms)
(re)Allocate and fill in an optimal interpolation structure from an optimal interpolation file.
Definition: cs_at_opt_interp.cpp:1283
void cs_at_opt_interp_project_model_covariance(cs_measures_set_t *ms, cs_at_opt_interp_t *oi)
Compute $\tens{H}\tens{B}\transpose{\tens{H}}$.
Definition: cs_at_opt_interp.cpp:1364
void cs_at_opt_interps_destroy(void)
Destroy all defined optimal interpolations.
Definition: cs_at_opt_interp.cpp:659
int cs_at_opt_interp_is_p1_proj_needed(void)
Return 1 if a p1 projection has been enabled for at least one optimal interpolation....
Definition: cs_at_opt_interp.cpp:1267
void cs_at_opt_interp_obs_operator(cs_measures_set_t *ms, cs_at_opt_interp_t *oi, cs_interpol_grid_t *ig)
Compute observation operator (H).
Definition: cs_at_opt_interp.cpp:1332
int * cs_at_opt_interp_get_active_obs(cs_measures_set_t *ms, cs_at_opt_interp_t *oi, cs_field_t *f_oia, bool **inverse, int ***ao_idx)
Count active observations and compute time weights in case of unsteady.
Definition: cs_at_opt_interp.cpp:1423
void cs_at_opt_interp_read_file(char const filename[50], cs_measures_set_t *ms, cs_at_opt_interp_t *oi, const int f_dim)
Read an optimal interpolation file for a given variable and fill in the matching measures set and opt...
Definition: cs_at_opt_interp.cpp:699
cs_at_opt_interp_type_t
Definition: cs_at_opt_interp.h:55
@ CS_AT_OPT_INTERP_P0
Definition: cs_at_opt_interp.h:57
@ CS_AT_OPT_INTERP_P1
Definition: cs_at_opt_interp.h:58
void cs_at_opt_interp_compute_analysis(cs_field_t *f, cs_at_opt_interp_t *oi, cs_field_t *f_oia, int n_active_obs, int *ao_idx, bool inverse, int mc_id)
Compute analysis for a given variable.
Definition: cs_at_opt_interp.cpp:1587
cs_at_opt_interp_t * cs_at_opt_interp_create(const char *name)
Create an optimal interpolation descriptor.
Definition: cs_at_opt_interp.cpp:525
cs_at_opt_interp_t * cs_at_opt_interp_by_name(const char *name)
Return a pointer to an optimal interpolation based on its name.
Definition: cs_at_opt_interp.cpp:639
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
Definition: cs_at_opt_interp.h:62
int frequency
Definition: cs_at_opt_interp.h:85
int steady
Definition: cs_at_opt_interp.h:84
cs_real_t * times
Definition: cs_at_opt_interp.h:78
int ig_id
Definition: cs_at_opt_interp.h:66
cs_real_t * time_weights
Definition: cs_at_opt_interp.h:81
int nb_times
Definition: cs_at_opt_interp.h:76
cs_real_t * times_read
Definition: cs_at_opt_interp.h:79
cs_lnum_t * model_to_obs_proj_c_ids
Definition: cs_at_opt_interp.h:72
int id
Definition: cs_at_opt_interp.h:65
cs_at_opt_interp_type_t interp_type
Definition: cs_at_opt_interp.h:69
const char * name
Definition: cs_at_opt_interp.h:64
cs_real_t * b_proj
Definition: cs_at_opt_interp.h:73
cs_lnum_t * model_to_obs_proj_idx
Definition: cs_at_opt_interp.h:71
int n_log_data
Definition: cs_at_opt_interp.h:83
cs_real_t * time_window
Definition: cs_at_opt_interp.h:82
int * active_time
Definition: cs_at_opt_interp.h:80
int * measures_idx
Definition: cs_at_opt_interp.h:77
cs_real_t * model_to_obs_proj
Definition: cs_at_opt_interp.h:70
cs_real_t * obs_cov
Definition: cs_at_opt_interp.h:67
cs_real_t * relax
Definition: cs_at_opt_interp.h:75
bool obs_cov_is_diag
Definition: cs_at_opt_interp.h:68
int type_nudging
Definition: cs_at_opt_interp.h:86
Field descriptor.
Definition: cs_field.h:131
Definition: cs_measures_util.h:72
Definition: cs_measures_util.h:47