YAC 3.7.0
Yet Another Coupler
Loading...
Searching...
No Matches
interp_method_fixed.c
Go to the documentation of this file.
1// Copyright (c) 2024 The YAC Authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifdef HAVE_CONFIG_H
6// Get the definition of the 'restrict' keyword.
7#include "config.h"
8#endif
9
11#include "interp_method_fixed.h"
12
13static size_t do_search_fixed(struct interp_method * method,
14 struct yac_interp_grid * interp_grid,
15 size_t * tgt_points, size_t count,
16 struct yac_interp_weights * weights,
17 int * interpolation_complete);
18static void delete_fixed(struct interp_method * method);
19
20static struct interp_method_vtable
24
30
31static size_t do_search_fixed (struct interp_method * method,
32 struct yac_interp_grid * interp_grid,
33 size_t * tgt_points, size_t count,
34 struct yac_interp_weights * weights,
35 int * interpolation_complete) {
36
37 if (*interpolation_complete) return 0;
38
39 struct remote_points tgts = {
40 .data =
41 yac_interp_grid_get_tgt_remote_points(interp_grid, tgt_points, count),
42 .count = count};
43
45 weights, &tgts, ((struct interp_method_fixed *)method)->value);
46
47 free(tgts.data);
48
49 return count;
50}
51
53
54 struct interp_method_fixed * method = xmalloc(1 * sizeof(*method));
55
57 method->value = value;
58
59 return (struct interp_method*)method;
60}
61
62static void delete_fixed(struct interp_method * method) {
63 free(method);
64}
struct remote_point * yac_interp_grid_get_tgt_remote_points(struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count)
struct @7::@8 value
static struct interp_method_vtable interp_method_fixed_vtable
static void delete_fixed(struct interp_method *method)
static size_t do_search_fixed(struct interp_method *method, struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, struct yac_interp_weights *weights, int *interpolation_complete)
struct interp_method * yac_interp_method_fixed_new(double value)
void yac_interp_weights_add_fixed(struct yac_interp_weights *weights, struct remote_points *tgts, double fixed_value)
#define xmalloc(size)
Definition ppm_xfuncs.h:66
struct interp_method_vtable * vtable
size_t(* do_search)(struct interp_method *method, struct yac_interp_grid *grid, size_t *tgt_points, size_t count, struct yac_interp_weights *weights, int *interpolation_complete)
structure containing the information (global id and location)
struct remote_point * data