1#ifndef CS_PARAMEDMEM_UTILS_HXX
2#define CS_PARAMEDMEM_UTILS_HXX
35#if defined(HAVE_PARAMEDMEM)
40#include <MEDCouplingField.hxx>
41#include <MEDCouplingFieldDouble.hxx>
44#if defined(HAVE_PARAMEDMEM_CFEMDEC)
47#if defined(HAVE_PARAMEDMEM_IKDECWO)
48#include <InterpKernelDECWithOverlap.hxx>
50#include <InterpKernelDEC.hxx>
52#include <ParaFIELD.hxx>
53#include <ParaMESH.hxx>
55using namespace MEDCoupling;
77#if defined(HAVE_PARAMEDMEM)
83#if defined(HAVE_PARAMEDMEM_IKDECWO)
84 InterpKernelDECWithOverlap *
dec;
88#if defined(HAVE_PARAMEDMEM_CFEMDEC)
92 std::vector<ParaFIELD *>
fields;
95 const ParaFIELD *_curr_field;
117 _error_without_paramedmem()
const
119#if !defined(HAVE_PARAMEDMEM)
124 _(
"Error: %s cannot be called without "
125 "MEDCoupling MPI support."),
130#if defined(HAVE_PARAMEDMEM)
140 _computeGlobalNodeIds(
const cs_mesh_t *parent_mesh)
const;
150 _creare_paraMesh(
const cs_mesh_t *parent_mesh);
160 _attachLocalField(
const ParaFIELD *
field);
172 MEDCouplingFieldDouble *
173 _get_field(
const char *name)
const;
185 _generate_coupling_mesh(
const char *select_criteria,
int elt_dim);
198 _generate_coupling_mesh_from_ids(
cs_lnum_t n_elts,
268#if !defined(HAVE_PARAMEDMEM)
270 this->_error_without_paramedmem();
274 retval = this->mesh->
n_elts;
294#if !defined(HAVE_PARAMEDMEM)
296 this->_error_without_paramedmem();
320#if !defined(HAVE_PARAMEDMEM)
322 this->_error_without_paramedmem();
346#if !defined(HAVE_PARAMEDMEM)
348 this->_error_without_paramedmem();
413 const double values[],
414 const bool use_list_elt =
true);
432 const bool use_list_elt =
true)
const;
459 const bool use_list_elt =
true);
483 recv_data(
const char *name,
double *vals,
const bool use_list_elt =
true);
void bft_error(const char *const file_name, const int line_num, const int sys_error_code, const char *const format,...)
Calls the error handler (set by bft_error_handler_set() or default).
Definition: bft_error.cpp:187
Field descriptor.
Definition: cs_field.h:275
#define DISABLE_WARNING_PUSH
Definition: cs_defs.h:168
#define _(String)
Definition: cs_defs.h:61
#define DISABLE_WARNING_LLVM(warningName)
Definition: cs_defs.h:171
#define DISABLE_WARNING_POP
Definition: cs_defs.h:170
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
cs_lnum_t cs_medcoupling_mesh_get_n_vertices(cs_medcoupling_mesh_t *m)
Return a cs_medcoupling_mesh_t structure's number of vertices.
Definition: cs_medcoupling_mesh.cxx:1099
cs_medcpl_field_nature_t
Definition: cs_paramedmem_coupling.h:68
cs_medcpl_time_discr_t
Definition: cs_paramedmem_coupling.h:62
cs_medcpl_space_discr_t
Definition: cs_paramedmem_coupling.h:56
Definition: cs_paramedmem_coupling_utils.h:68
void recv_data()
Recieve values of field attached to DEC.
Definition: cs_paramedmem_coupling.cxx:1531
void set_values(const char *name, const double values[], const bool use_list_elt=true)
Assign values based on parent mesh location to associated ParaFIELD objects.
Definition: cs_paramedmem_coupling.cxx:1258
void add_mesh_from_ids(cs_lnum_t n_elts, const cs_lnum_t elt_ids[], int elt_dim)
Define coupled mesh based on a cs_zone_t pointer.
Definition: cs_paramedmem_coupling.cxx:1011
const cs_lnum_t * get_elt_list() const
Get indirection list for elements in coupled mesh.
Definition: cs_paramedmem_coupling_utils.h:290
ple_coupling_mpi_set_info_t apps[2]
Definition: cs_paramedmem_coupling_utils.h:74
void * dec
Definition: cs_paramedmem_coupling_utils.h:100
void get_values(const char *name, double values[], const bool use_list_elt=true) const
Copy values from associated ParaFIELD object to array defined parent mesh location.
Definition: cs_paramedmem_coupling.cxx:1318
bool dec_synced
Definition: cs_paramedmem_coupling_utils.h:113
void attach_field_by_id(int field_id)
Attach a field to the DEC for send operation using its index.
Definition: cs_paramedmem_coupling.cxx:1622
void log() const
Log ParaMEDMEM coupling setup information.
Definition: cs_paramedmem_coupling.cxx:1684
void * fields
Definition: cs_paramedmem_coupling_utils.h:101
const cs_lnum_t * get_vertex_list() const
Get indirection list for vertices in coupled mesh.
Definition: cs_paramedmem_coupling_utils.h:342
int add_field(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)
Add a coupled field.
Definition: cs_paramedmem_coupling.cxx:1047
void add_mesh_from_zone(const cs_zone_t *zone)
Define coupled mesh based on a cs_zone_t pointer.
Definition: cs_paramedmem_coupling.cxx:966
void add_mesh_from_criteria(const char *sel_crit, int elt_dim)
Define coupled mesh based on a selection criteria.
Definition: cs_paramedmem_coupling.cxx:943
std::string getName() const
Get name of the coupling.
Definition: cs_paramedmem_coupling_utils.h:250
void * para_mesh
Definition: cs_paramedmem_coupling_utils.h:99
void sync_dec()
Sync the coupling's the DEC.
Definition: cs_paramedmem_coupling.cxx:1396
std::string _name
Definition: cs_paramedmem_coupling_utils.h:70
MPI_Comm comm
Definition: cs_paramedmem_coupling_utils.h:108
void send_data() const
Send values of field attached to DEC.
Definition: cs_paramedmem_coupling.cxx:1443
cs_lnum_t get_n_elts() const
Get number of elements of coupled mesh.
Definition: cs_paramedmem_coupling_utils.h:264
cs_lnum_t get_n_vertices() const
Get number of vertices of coupled mesh.
Definition: cs_paramedmem_coupling_utils.h:316
void attach_field_by_name(const char *name)
Attach a field to the DEC for send operation using its name.
Definition: cs_paramedmem_coupling.cxx:1645
Definition: cs_medcoupling_mesh.hxx:67
cs_lnum_t n_elts
Definition: cs_medcoupling_mesh.hxx:74
cs_lnum_t * vtx_list
Definition: cs_medcoupling_mesh.hxx:79
cs_lnum_t * elt_list
Definition: cs_medcoupling_mesh.hxx:75