9.0
general documentation
Loading...
Searching...
No Matches
cs_medcoupling_remapper.cxx File Reference
#include "base/cs_defs.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include "bft/bft_error.h"
#include "bft/bft_printf.h"
#include "base/cs_mem.h"
#include "mesh/cs_mesh.h"
#include "mesh/cs_mesh_connect.h"
#include "base/cs_parall.h"
#include "base/cs_prototypes.h"
#include "base/cs_selector.h"
#include "base/cs_timer.h"
#include "cs_medcoupling_mesh.hxx"
#include "base/cs_medcoupling_remapper.h"
Include dependency graph for cs_medcoupling_remapper.cxx:

Functions

cs_medcoupling_remapper_tcs_medcoupling_remapper_by_id (int r_id)
 get a remapper by its id
cs_medcoupling_remapper_tcs_medcoupling_remapper_by_name_try (const char *name)
 get a remapper by its name
int cs_medcoupling_remapper_initialize (const char *name, int elt_dim, const char *select_criteria, const char *medfile_path, int n_fields, const char **field_names, int iteration, int order)
 initialize a remapper based on a set of given arguments
void cs_medcoupling_remapper_set_iteration (cs_medcoupling_remapper_t *r, int iteration, int order)
 set and load a given time iteration from the MED file
void cs_medcoupling_remapper_set_options (cs_medcoupling_remapper_t *r, const char key[], const char value[])
 set non-default options for a remapper
void cs_medcoupling_remapper_setup (cs_medcoupling_remapper_t *r)
 update the interpolation matrix of the remapper
cs_real_tcs_medcoupling_remapper_copy_values (cs_medcoupling_remapper_t *r, int field_id, double default_val)
 Interpolate values for a given field.
void cs_medcoupling_remapper_translate (cs_medcoupling_remapper_t *r, cs_real_t translation[3])
 translate the mesh using a given vector
void cs_medcoupling_remapper_rotate (cs_medcoupling_remapper_t *r, cs_real_t invariant[3], cs_real_t axis[3], cs_real_t angle)
 Rotate the mesh using a center point, axis and angle.
void cs_medcoupling_remapper_find_time_index (cs_medcoupling_remapper_t *r, cs_real_t t, int *id1, int *id2)
 Retrieve the two closest time steps indexes.
void cs_medcoupling_remapper_get_time_from_index (cs_medcoupling_remapper_t *r, int id, cs_real_t *t)
 Retrieve the two closest time steps indexes.
void cs_medcoupling_remapper_get_iter_order_from_index (cs_medcoupling_remapper_t *r, int id, int *it, int *order)
 Retrieve the two closest time steps indexes.
void cs_medcoupling_remapper_destroy_all (void)
 Destroy all remappers.
void cs_medcoupling_remapper_update_time_value (cs_medcoupling_remapper_t *r, int id)
 Load the time value corresponding to id.

Function Documentation

◆ cs_medcoupling_remapper_by_id()

cs_medcoupling_remapper_t * cs_medcoupling_remapper_by_id ( int r_id)

get a remapper by its id

Parameters
[in]r_idid of the remapper
Returns
pointer to cs_medcoupling_remapper_t struct

◆ cs_medcoupling_remapper_by_name_try()

cs_medcoupling_remapper_t * cs_medcoupling_remapper_by_name_try ( const char * name)

get a remapper by its name

Parameters
[in]namename of the remapper
Returns
pointer to cs_medcoupling_remapper_t struct

◆ cs_medcoupling_remapper_copy_values()

cs_real_t * cs_medcoupling_remapper_copy_values ( cs_medcoupling_remapper_t * r,
int field_id,
double default_val )

Interpolate values for a given field.

Parameters
[in]rpointer to the cs_medcoupling_remapper_t struct
[in]field_idid of the field to interpolate (in the list given before)
[in]default_valvalue to apply for elements not intersected by source mesh
Returns
pointer to cs_real_t array containing the new values

◆ cs_medcoupling_remapper_destroy_all()

void cs_medcoupling_remapper_destroy_all ( void )

Destroy all remappers.

◆ cs_medcoupling_remapper_find_time_index()

void cs_medcoupling_remapper_find_time_index ( cs_medcoupling_remapper_t * r,
cs_real_t t,
int * id1,
int * id2 )

Retrieve the two closest time steps indexes.

The returned value is int[2]. If the requested time value if outside the time bounds stored in the file, the both values are identical (first or last value), and a warning is printed in the listing file.

Parameters
[in]rpointer to remapper object
[in]trequested time value
[in,out]id1first returned index
[in,out]id2second returned index

◆ cs_medcoupling_remapper_get_iter_order_from_index()

void cs_medcoupling_remapper_get_iter_order_from_index ( cs_medcoupling_remapper_t * r,
int id,
int * it,
int * order )

Retrieve the two closest time steps indexes.

The returned value is int[2]. If the requested time value if outside the time bounds stored in the file, the both values are identical (first or last value), and a warning is output in the lod file.

Parameters
[in]rpointer to remapper object
[in]idrequested time index
[in,out]itindex iteration
[in,out]orderindex iteration order

◆ cs_medcoupling_remapper_get_time_from_index()

void cs_medcoupling_remapper_get_time_from_index ( cs_medcoupling_remapper_t * r,
int id,
cs_real_t * t )

Retrieve the two closest time steps indexes.

The returned value is int[2]. If the requested time value if outside the time bounds stored in the file, the both values are identical (first or last value), and a warning is printed in the listing file.

Parameters
[in]rpointer to remapper object
[in]idrequested index
[in,out]tcorresponding time value

◆ cs_medcoupling_remapper_initialize()

int cs_medcoupling_remapper_initialize ( const char * name,
int elt_dim,
const char * select_criteria,
const char * medfile_path,
int n_fields,
const char ** field_names,
int iteration,
int order )

initialize a remapper based on a set of given arguments

Parameters
[in]namename of the new remapper
[in]elt_dimelement dimension
[in]select_criteriaselection criteria for the elements
[in]medfile_pathpath to the med file
[in]n_fieldsnumber of fields to load
[in]field_namesnames of the fields to load
[in]iterationtime iteration to load
[in]orderiteration order to load
Returns
id of the new remapper

◆ cs_medcoupling_remapper_rotate()

void cs_medcoupling_remapper_rotate ( cs_medcoupling_remapper_t * r,
cs_real_t invariant[3],
cs_real_t axis[3],
cs_real_t angle )

Rotate the mesh using a center point, axis and angle.

Parameters
[in]rpointer to the cs_medcoupling_remapper_t struct
[in]invariantcoordinates of the invariant point
[in]axisrotation axis vector
[in]anglerotation angle in radians

◆ cs_medcoupling_remapper_set_iteration()

void cs_medcoupling_remapper_set_iteration ( cs_medcoupling_remapper_t * r,
int iteration,
int order )

set and load a given time iteration from the MED file

Parameters
[in]rpointer to the cs_medcoupling_remapper_t struct
[in]iterationtime iteration to load
[in]orderiteration order to load

◆ cs_medcoupling_remapper_set_options()

void cs_medcoupling_remapper_set_options ( cs_medcoupling_remapper_t * r,
const char key[],
const char value[] )

set non-default options for a remapper

Parameters
[in]rpointer to the cs_medcoupling_remapper_t struct
[in]keypointer to string representing key currently handled: one of {Precision, IntersectionType}
[in]valuepointer to string representing value:
  • for Precision: floating-point value (default: 1e-12)
  • for IntersectionType: one of {Triangulation, Convex, Geometric2D, PointLocator, Barycentric, BarycentricGeo2D, MappedBarycentric} (see MEDCoupling INTERP_KERNEL documentation)

◆ cs_medcoupling_remapper_setup()

void cs_medcoupling_remapper_setup ( cs_medcoupling_remapper_t * r)

update the interpolation matrix of the remapper

Parameters
[in]rpointer to the cs_medcoupling_remapper_t struct

◆ cs_medcoupling_remapper_translate()

void cs_medcoupling_remapper_translate ( cs_medcoupling_remapper_t * r,
cs_real_t translation[3] )

translate the mesh using a given vector

Parameters
[in]rpointer to the cs_medcoupling_remapper_t struct
[in]translationtranslation vector

◆ cs_medcoupling_remapper_update_time_value()

void cs_medcoupling_remapper_update_time_value ( cs_medcoupling_remapper_t * r,
int id )

Load the time value corresponding to id.

Parameters
[in]rpointer to remapper object
[in]idrequested time index