YAC
3.13.0
Yet Another Coupler
Loading...
Searching...
No Matches
toy_multi_common.h
Go to the documentation of this file.
1
// Copyright (c) 2024 The YAC Authors
2
//
3
// SPDX-License-Identifier: BSD-3-Clause
4
5
#include <math.h>
6
7
int
run_toy_multi_common
(
8
char
const
* comp_name,
int
comp_id
,
int
grid_id
,
9
int
cell_point_id
,
int
corner_point_id,
10
double
* cell_point_data,
double
* corner_point_data,
11
YAC_VTK_FILE
* vtk_file);
12
13
static
inline
void
LLtoXYZ
(
double
lon,
double
lat,
double
p_out[]) {
14
15
while
(lon < -M_PI) lon += 2.0 * M_PI;
16
while
(lon >= M_PI) lon -= 2.0 * M_PI;
17
18
double
cos_lat = cos(lat);
19
p_out[0] = cos_lat * cos(lon);
20
p_out[1] = cos_lat * sin(lon);
21
p_out[2] = sin(lat);
22
}
23
24
static
inline
void
XYZtoLL
(
double
const
p_in[],
double
* lon,
double
* lat) {
25
26
*lon = atan2(p_in[1] , p_in[0]);
27
*lat = M_PI_2 - acos(p_in[2]);
28
}
29
30
#define MIN(a,b) ((a) < (b) ? (a) : (b))
YAC_VTK_FILE_
Definition
vtk_output.c:35
grid_id
int grid_id
Definition
toy_coupling.c:32
cell_point_id
int cell_point_id
Definition
toy_coupling.c:30
comp_id
int comp_id
Definition
toy_coupling.c:27
run_toy_multi_common
int run_toy_multi_common(char const *comp_name, int comp_id, int grid_id, int cell_point_id, int corner_point_id, double *cell_point_data, double *corner_point_data, YAC_VTK_FILE *vtk_file)
Definition
toy_multi_common.c:40
LLtoXYZ
static void LLtoXYZ(double lon, double lat, double p_out[])
Definition
toy_multi_common.h:13
XYZtoLL
static void XYZtoLL(double const p_in[], double *lon, double *lat)
Definition
toy_multi_common.h:24
examples
toy_multi
toy_multi_common.h
Generated on Tue Jan 13 2026 15:07:54 for YAC by
1.11.0