#include "cs_defs.h"#include <stdarg.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <assert.h>#include <math.h>#include <mpi.h>#include <string>#include <vector>#include <ple_coupling.h>#include "bft_error.h"#include "bft_mem.h"#include "bft_printf.h"#include "cs_mesh.h"#include "cs_mesh_connect.h"#include "cs_parall.h"#include "cs_prototypes.h"#include "cs_selector.h"#include "cs_timer.h"#include "cs_coupling.h"#include "fvm_defs.h"#include "fvm_nodal_from_desc.h"#include "cs_medcoupling_utils.hxx"#include "cs_paramedmem_coupling.h"#include <MEDCouplingField.hxx>#include <MEDCouplingFieldDouble.hxx>#include <ParaFIELD.hxx>#include <ParaMESH.hxx>#include <InterpKernelDEC.hxx>
Include dependency graph for cs_paramedmem_coupling.cxx:Functions | |
| cs_paramedmem_coupling_t * | cs_paramedmem_coupling_by_id (int cpl_id) |
| Retrieve coupling struct pointer by id. More... | |
| cs_paramedmem_coupling_t * | cs_paramedmem_coupling_by_name (const char *name) |
| Retrieve coupling struct pointer by name. More... | |
| cs_paramedmem_coupling_t * | cs_paramedmem_coupling_create (const char *app1_name, const char *app2_name, const char *cpl_name) |
| Create a new ParaMEDMEM coupling. More... | |
| void | cs_paramedmem_coupling_destroy (cs_paramedmem_coupling_t *c) |
| Destroy a given ParaMEDMEM coupling structure. More... | |
| void | cs_paramedmem_coupling_all_finalize (void) |
| Destroy all coupling structures. More... | |
| void | cs_paramedmem_add_mesh_from_criteria (cs_paramedmem_coupling_t *c, const char *sel_crit, int elt_dim) |
| Define coupled mesh based on a selection criteria. More... | |
| void | cs_paramedmem_add_mesh_from_zone (cs_paramedmem_coupling_t *c, const cs_zone_t *zone) |
| Define coupled mesh based on a cs_zone_t pointer. More... | |
| int | cs_paramedmem_get_number_of_couplings (void) |
| Get number of defined couplings. More... | |
| cs_lnum_t | cs_paramedmem_mesh_get_n_elts (const cs_paramedmem_coupling_t *coupling) |
| Get number of elements of coupled mesh. More... | |
| const cs_lnum_t * | cs_paramedmem_mesh_get_elt_list (const cs_paramedmem_coupling_t *coupling) |
| Get indirection list for elements in coupled mesh. More... | |
| int | cs_paramedmem_def_coupled_field (cs_paramedmem_coupling_t *c, const char *name, int dim, cs_medcpl_field_nature_t field_nature, cs_medcpl_space_discr_t space_discr, cs_medcpl_time_discr_t time_discr) |
| Define a coupled field. More... | |
| int | cs_paramedmem_def_coupled_field_from_cs_field (cs_paramedmem_coupling_t *c, cs_field_t *f, cs_medcpl_field_nature_t fn, cs_medcpl_time_discr_t td) |
| Define a coupled field based on a cs_field_t pointer. More... | |
| void | cs_paramedmem_field_export (cs_paramedmem_coupling_t *c, const char *name, const double values[]) |
| Write values before sending operation. More... | |
| void | cs_paramedmem_field_import (cs_paramedmem_coupling_t *c, const char *name, double values[]) |
| Read values before sending operation. More... | |
| void | cs_paramedmem_sync_dec (cs_paramedmem_coupling_t *c) |
| Sync the coupling's InterpKernelDEC. More... | |
| void | cs_paramedmem_send_data (cs_paramedmem_coupling_t *c) |
| Send values of field attached to DEC. More... | |
| void | cs_paramedmem_recv_data (cs_paramedmem_coupling_t *c) |
| Recieve values of field attached to DEC. More... | |
| void | cs_paramedmem_attach_field_by_id (cs_paramedmem_coupling_t *c, int field_id) |
| Attach a field to InterpKernelDEC for send operation using its index. More... | |
| void | cs_paramedmem_attach_field_by_name (cs_paramedmem_coupling_t *c, const char *name) |
| Attach a field to InterpKernelDEC for send operation using its name. More... | |
| void | cs_paramedmem_send_field_vals (cs_paramedmem_coupling_t *c, const char *name, const double *vals) |
| Send values of a field. If vals pointer is non-null, values are updated before send. More... | |
| void | cs_paramedmem_recv_field_vals (cs_paramedmem_coupling_t *c, const char *name, double *vals) |
| Recieve values of a field. More... | |
| void | cs_paramedmem_coupling_log_setup (void) |
| Log ParaMEDMEM coupling setup information. More... | |
| void | cs_paramedmem_coupling_all_init (void) |
| initialize couplings based on user functions More... | |
| void | cs_paramedmem_coupling_define_mesh_fields (void) |
| initialize coupled mesh and fields based on user functions More... | |
| void cs_paramedmem_add_mesh_from_criteria | ( | cs_paramedmem_coupling_t * | c, |
| const char * | sel_crit, | ||
| int | elt_dim | ||
| ) |
Define coupled mesh based on a selection criteria.
| [in] | c | pointer to cs_paramedmem_coupling_t struct |
| [in] | sel_crit | geometrical selection criteria (string) |
| [in] | elt_dim | dimension of coupled elements |
| void cs_paramedmem_add_mesh_from_zone | ( | cs_paramedmem_coupling_t * | c, |
| const cs_zone_t * | zone | ||
| ) |
| void cs_paramedmem_attach_field_by_id | ( | cs_paramedmem_coupling_t * | c, |
| int | field_id | ||
| ) |
Attach a field to InterpKernelDEC for send operation using its index.
| [in] | c | pointer to cs_paramedmem_coupling_t structure |
| [in] | field_id | index of field in storing vector |
| void cs_paramedmem_attach_field_by_name | ( | cs_paramedmem_coupling_t * | c, |
| const char * | name | ||
| ) |
Attach a field to InterpKernelDEC for send operation using its name.
| [in] | c | pointer to cs_paramedmem_coupling_t structure |
| [in] | name | name of field (string) |
| void cs_paramedmem_coupling_all_finalize | ( | void | ) |
Destroy all coupling structures.
| void cs_paramedmem_coupling_all_init | ( | void | ) |
initialize couplings based on user functions
| cs_paramedmem_coupling_t* cs_paramedmem_coupling_by_id | ( | int | cpl_id | ) |
Retrieve coupling struct pointer by id.
| [in] | cpl_id | index of the sought coupling |
| cs_paramedmem_coupling_t* cs_paramedmem_coupling_by_name | ( | const char * | name | ) |
Retrieve coupling struct pointer by name.
| [in] | name | name of the coupling |
| cs_paramedmem_coupling_t* cs_paramedmem_coupling_create | ( | const char * | app1_name, |
| const char * | app2_name, | ||
| const char * | cpl_name | ||
| ) |
Create a new ParaMEDMEM coupling.
| [in] | app1_name | Name of app n°1 or NULL if calling app is app1 |
| [in] | app2_name | Name of app n°2 or NULL if calling app is app2 |
| [in] | cpl_name | Name of the coupling. If NULL an automatic name is generated. |
| void cs_paramedmem_coupling_define_mesh_fields | ( | void | ) |
initialize coupled mesh and fields based on user functions
| void cs_paramedmem_coupling_destroy | ( | cs_paramedmem_coupling_t * | c | ) |
Destroy a given ParaMEDMEM coupling structure.
| [in] | c | pointer to cs_paramedmem_coupling_t structure |
| void cs_paramedmem_coupling_log_setup | ( | void | ) |
Log ParaMEDMEM coupling setup information.
| int cs_paramedmem_def_coupled_field | ( | cs_paramedmem_coupling_t * | c, |
| const char * | name, | ||
| int | dim, | ||
| cs_medcpl_field_nature_t | field_nature, | ||
| cs_medcpl_space_discr_t | space_discr, | ||
| cs_medcpl_time_discr_t | time_discr | ||
| ) |
Define a coupled field.
| [in] | c | pointer to cs_paramedmem_coupling_t struct |
| [in] | name | name of field |
| [in] | dim | field dimension |
| [in] | field_nature | field nature flag |
| [in] | space_discr | field space discretisation (nodes or cells) |
| [in] | time_discr | field coupling time discretisation |
| int cs_paramedmem_def_coupled_field_from_cs_field | ( | cs_paramedmem_coupling_t * | c, |
| cs_field_t * | f, | ||
| cs_medcpl_field_nature_t | fn, | ||
| cs_medcpl_time_discr_t | td | ||
| ) |
Define a coupled field based on a cs_field_t pointer.
| [in] | c | pointer to cs_paramedmem_coupling_t struct |
| [in] | f | pointer to cs_field_t struct |
| [in] | fn | field nature flag |
| [in] | time_discr | field coupling time discretisation |
| void cs_paramedmem_field_export | ( | cs_paramedmem_coupling_t * | c, |
| const char * | name, | ||
| const double | values[] | ||
| ) |
Write values before sending operation.
| [in] | c | pointer to cs_paramedmem_coupling_t structure |
| [in] | name | name of field |
| [in] | values | array of values to write |
| void cs_paramedmem_field_import | ( | cs_paramedmem_coupling_t * | c, |
| const char * | name, | ||
| double | values[] | ||
| ) |
Read values before sending operation.
| [in] | c | pointer to cs_paramedmem_coupling_t structure |
| [in] | name | name of field |
| [in] | values | array in which values will be stored |
| int cs_paramedmem_get_number_of_couplings | ( | void | ) |
Get number of defined couplings.
| const cs_lnum_t* cs_paramedmem_mesh_get_elt_list | ( | const cs_paramedmem_coupling_t * | coupling | ) |
Get indirection list for elements in coupled mesh.
| [in] | coupling | pointer to cs_paramedmem_coupling_t struct |
| cs_lnum_t cs_paramedmem_mesh_get_n_elts | ( | const cs_paramedmem_coupling_t * | coupling | ) |
Get number of elements of coupled mesh.
| [in] | coupling | pointer to cs_paramedmem_coupling_t struct |
| void cs_paramedmem_recv_data | ( | cs_paramedmem_coupling_t * | c | ) |
Recieve values of field attached to DEC.
| [in] | c | pointer to cs_paramedmem_coupling_t structure |
| void cs_paramedmem_recv_field_vals | ( | cs_paramedmem_coupling_t * | c, |
| const char * | name, | ||
| double * | vals | ||
| ) |
Recieve values of a field.
| [in] | c | pointer to cs_paramedmem_coupling_t structure |
| [in] | name | name of field |
| [in] | vals | array of values to write |
| void cs_paramedmem_send_data | ( | cs_paramedmem_coupling_t * | c | ) |
Send values of field attached to DEC.
| [in] | c | pointer to cs_paramedmem_coupling_t structure |
| void cs_paramedmem_send_field_vals | ( | cs_paramedmem_coupling_t * | c, |
| const char * | name, | ||
| const double * | vals | ||
| ) |
Send values of a field. If vals pointer is non-null, values are updated before send.
| [in] | c | pointer to cs_paramedmem_coupling_t structure |
| [in] | name | name of field |
| [in] | vals | array of values to write |
| void cs_paramedmem_sync_dec | ( | cs_paramedmem_coupling_t * | c | ) |
Sync the coupling's InterpKernelDEC.
| [in] | c | pointer to cs_paramedmem_coupling_t structure |