9.2
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-2026 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 "base/cs_defs.h"
39
40#include "base/cs_field.h"
42
43/*=============================================================================
44 * Macro definitions
45 *============================================================================*/
46
47/*============================================================================
48 * Type definitions
49 *============================================================================*/
50
51typedef enum {
52
53 CS_AT_OPT_INTERP_P0, /* Interpolation from cell containing the observation */
54 CS_AT_OPT_INTERP_P1 /* Interpolation from (partial) extended neighbourhood */
55
57
58typedef struct _cs_at_opt_interp_t {
59
60 const char *name; /* Name */
61 int id; /* Id */
62 int ig_id;
70 cs_real_t ir[2];
80 int steady;
83
85
86/*============================================================================
87 * Global variables
88 *============================================================================*/
89
90/*=============================================================================
91 * Public function prototypes
92 *============================================================================*/
93
94/*----------------------------------------------------------------------------*/
101/*----------------------------------------------------------------------------*/
102
104cs_at_opt_interp_create(const char *name);
105
106/*----------------------------------------------------------------------------*/
117/*----------------------------------------------------------------------------*/
118
121
122/*----------------------------------------------------------------------------*/
133/*----------------------------------------------------------------------------*/
134
136cs_at_opt_interp_by_name(const char *name);
137
138/*----------------------------------------------------------------------------*/
142/*----------------------------------------------------------------------------*/
143
144void
146
147/*----------------------------------------------------------------------------*/
158/*----------------------------------------------------------------------------*/
159
160void
161cs_at_opt_interp_read_file(char const filename[50],
164 const int f_dim);
165
166/*----------------------------------------------------------------------------*/
174/*----------------------------------------------------------------------------*/
175
176int
178
179/*----------------------------------------------------------------------------*/
187/*----------------------------------------------------------------------------*/
188
189void
192
193/*----------------------------------------------------------------------------*/
201/*----------------------------------------------------------------------------*/
202
203void
207
208/*----------------------------------------------------------------------------*/
215/*----------------------------------------------------------------------------*/
216
217void
220
221/*----------------------------------------------------------------------------*/
235/*----------------------------------------------------------------------------*/
236
237int *
240 cs_field_t *f_oia,
241 bool **inverse,
242 int ***ao_idx);
243
244/*----------------------------------------------------------------------------*/
256/*----------------------------------------------------------------------------*/
257
258void
261 cs_field_t *f_oia,
262 int n_active_obs,
263 int *ao_idx,
264 bool inverse,
265 int mc_id);
266
267/*----------------------------------------------------------------------------*/
268
269#endif /* CS_AT_OPT_INTERP_H */
Field descriptor.
Definition: cs_field.h:275
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:599
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:1268
void cs_at_opt_interp_project_model_covariance(cs_measures_set_t *ms, cs_at_opt_interp_t *oi)
Compute .
Definition: cs_at_opt_interp.cpp:1349
void cs_at_opt_interps_destroy(void)
Destroy all defined optimal interpolations.
Definition: cs_at_opt_interp.cpp:644
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:1252
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:1317
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:1408
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:684
cs_at_opt_interp_type_t
Definition: cs_at_opt_interp.h:51
@ CS_AT_OPT_INTERP_P0
Definition: cs_at_opt_interp.h:53
@ CS_AT_OPT_INTERP_P1
Definition: cs_at_opt_interp.h:54
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:1572
cs_at_opt_interp_t * cs_at_opt_interp_create(const char *name)
Create an optimal interpolation descriptor.
Definition: cs_at_opt_interp.cpp:510
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:624
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
Definition: cs_at_opt_interp.h:58
int frequency
Definition: cs_at_opt_interp.h:81
int steady
Definition: cs_at_opt_interp.h:80
cs_real_t * times
Definition: cs_at_opt_interp.h:74
int ig_id
Definition: cs_at_opt_interp.h:62
cs_real_t * time_weights
Definition: cs_at_opt_interp.h:77
int nb_times
Definition: cs_at_opt_interp.h:72
cs_real_t * times_read
Definition: cs_at_opt_interp.h:75
cs_lnum_t * model_to_obs_proj_c_ids
Definition: cs_at_opt_interp.h:68
int id
Definition: cs_at_opt_interp.h:61
cs_at_opt_interp_type_t interp_type
Definition: cs_at_opt_interp.h:65
const char * name
Definition: cs_at_opt_interp.h:60
cs_real_t * b_proj
Definition: cs_at_opt_interp.h:69
cs_lnum_t * model_to_obs_proj_idx
Definition: cs_at_opt_interp.h:67
int n_log_data
Definition: cs_at_opt_interp.h:79
cs_real_t * time_window
Definition: cs_at_opt_interp.h:78
int * active_time
Definition: cs_at_opt_interp.h:76
int * measures_idx
Definition: cs_at_opt_interp.h:73
cs_real_t * model_to_obs_proj
Definition: cs_at_opt_interp.h:66
cs_real_t * obs_cov
Definition: cs_at_opt_interp.h:63
cs_real_t * relax
Definition: cs_at_opt_interp.h:71
bool obs_cov_is_diag
Definition: cs_at_opt_interp.h:64
int type_nudging
Definition: cs_at_opt_interp.h:82
Definition: cs_measures_util.h:69
Definition: cs_measures_util.h:44