7.1
general documentation
cs_medcoupling_intersector.cxx File Reference
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include "bft_error.h"
#include "bft_mem.h"
#include "bft_printf.h"
#include "cs_file.h"
#include "cs_mesh.h"
#include "cs_mesh_connect.h"
#include "cs_parall.h"
#include "cs_post.h"
#include "cs_prototypes.h"
#include "cs_rotation.h"
#include "cs_selector.h"
#include "cs_timer.h"
#include "fvm_writer.h"
#include "fvm_nodal.h"
#include "fvm_nodal_append.h"
#include "cs_medcoupling_utils.hxx"
#include "cs_medcoupling_intersector.h"
#include <MEDCoupling_version.h>
#include <MEDFileMesh.hxx>
#include <MEDCouplingUMesh.hxx>
#include <MEDFileField1TS.hxx>
#include <MEDCouplingField.hxx>
#include <MEDCouplingFieldFloat.hxx>
#include <MEDCouplingFieldDouble.hxx>
#include <MEDFileFieldMultiTS.hxx>
#include <MEDCouplingRemapper.hxx>
#include <MEDLoader.hxx>
#include <MEDCouplingNormalizedUnstructuredMesh.txx>
#include "Interpolation3D.hxx"
+ Include dependency graph for cs_medcoupling_intersector.cxx:

Functions

void _allocate_intersector (cs_medcoupling_intersector_t *mi, const char *name, const char *medfile_path, const char *interp_method, const char *select_criteria)
 Initialize a cs_medcoupling_intersector with given parameters. More...
 
void _destroy_intersector (cs_medcoupling_intersector_t *mi)
 destroy a given intersector More...
 
void _compute_intersection_volumes (cs_medcoupling_intersector_t *mi)
 Compute intersection matrix and update the intersection array. More...
 
void _dump_medcoupling_mesh (MEDCouplingUMesh *m, const char *prefix, const char *filename)
 dump a medcoupling mesh More...
 
void cs_medcoupling_intersector_add (const char *name, const char *medfile_path, const char *interp_method, const char *select_criteria)
 Add a MEDCoupling intersector. More...
 
void cs_medcoupling_intersector_destroy (cs_medcoupling_intersector_t *mi)
 Destroy a given MEDCoupling intersector. More...
 
void cs_medcoupling_intersector_destroy_all (void)
 Free all allocated intersectors. More...
 
cs_medcoupling_intersector_t * cs_medcoupling_intersector_by_id (int id)
 Get a MEDCoupling intersector using its id. More...
 
cs_medcoupling_intersector_t * cs_medcoupling_intersector_by_name (const char *name)
 Get an intersector by name. More...
 
cs_real_tcs_medcoupling_intersect_volumes (cs_medcoupling_intersector_t *mi)
 Compute the intersection volumes between the source mesh and code mesh. More...
 
void cs_medcoupling_intersector_translate (cs_medcoupling_intersector_t *mi, cs_real_t translation[3])
 translate the mesh using a given vector More...
 
void cs_medcoupling_intersector_rotate (cs_medcoupling_intersector_t *mi, cs_real_t invariant[3], cs_real_t axis[3], cs_real_t angle)
 rotate the mesh More...
 
void cs_medcoupling_intersector_scale_auto (cs_medcoupling_intersector_t *mi, cs_real_t factor)
 Scale a mesh using a factor based on the current mesh center position. More...
 
void cs_medcoupling_intersector_transform_from_init (cs_medcoupling_intersector_t *mi, cs_real_t matrix[3][4])
 Transform a mesh, but takes as input the initial position of the mesh. More...
 
void cs_medcoupling_intersector_dump_mesh (cs_medcoupling_intersector_t *mi, const char *prefix)
 dump the mesh of a cs_medcoupling_intersector_t structure More...
 
int cs_mi_post_get_writer_id (void)
 Return writer id used for medcoupling meshes, 0 means unused. More...
 
void cs_mi_post_init_writer (const char *case_name, const char *dir_name, const char *fmt_name, const char *fmt_opts, fvm_writer_time_dep_t time_dep, bool output_at_start, bool output_at_end, int frequency_n, double frequency_t)
 Create a new writer that will contains the boundary MED mesh added. More...
 
void cs_mi_post_add_mesh (cs_medcoupling_intersector_t *mi)
 Associate a Medcoupling mesh to the default writer. More...
 

Function Documentation

◆ _allocate_intersector()

void _allocate_intersector ( cs_medcoupling_intersector_t *  mi,
const char *  name,
const char *  medfile_path,
const char *  interp_method,
const char *  select_criteria 
)

Initialize a cs_medcoupling_intersector with given parameters.

Parameters
[in]mipointer to the cs_medcoupling_intersector_t struct
[in]namename of the intersector
[in]medfile_pathpath to the MED file
[in]interp_methodinterpolation method (P0P0, P1P0, ..)
[in]select_criteriaselection criteria

◆ _compute_intersection_volumes()

void _compute_intersection_volumes ( cs_medcoupling_intersector_t *  mi)

Compute intersection matrix and update the intersection array.

Parameters
[in]mipointer to the cs_medcoupling_intersector_t struct

◆ _destroy_intersector()

void _destroy_intersector ( cs_medcoupling_intersector_t *  mi)

destroy a given intersector

Parameters
[in]mipointer to the cs_medcoupling_intersector_t struct

◆ _dump_medcoupling_mesh()

void _dump_medcoupling_mesh ( MEDCouplingUMesh *  m,
const char *  prefix,
const char *  filename 
)

dump a medcoupling mesh

Parameters
[in]mMEDCouplingUMesh to dump
[in]prefixfolder where the file is to be written
[in]filenamename of the file to write

◆ cs_medcoupling_intersect_volumes()

cs_real_t* cs_medcoupling_intersect_volumes ( cs_medcoupling_intersector_t *  mi)

Compute the intersection volumes between the source mesh and code mesh.

Parameters
[in]mipointer to the cs_medcoupling_intersector_t struct
Returns
a pointer to the array containing the intersected volume of each cell

◆ cs_medcoupling_intersector_add()

void cs_medcoupling_intersector_add ( const char *  name,
const char *  medfile_path,
const char *  interp_method,
const char *  select_criteria 
)

Add a MEDCoupling intersector.

Parameters
[in]namename of the intersector
[in]medfile_pathpath to the MED file
[in]interp_methodinterpolation method (P0P0, P1P0, ..)
[in]select_criteriaselection criteria

◆ cs_medcoupling_intersector_by_id()

cs_medcoupling_intersector_t* cs_medcoupling_intersector_by_id ( int  id)

Get a MEDCoupling intersector using its id.

Parameters
[in]idid of the intersector
Returns
pointer to the cs_medcoupling_intersector_t or NULL if not found

◆ cs_medcoupling_intersector_by_name()

cs_medcoupling_intersector_t* cs_medcoupling_intersector_by_name ( const char *  name)

Get an intersector by name.

Get a MEDCoupling intersector by name.

Parameters
[in]namename of the intersector
Returns
pointer to the cs_medcoupling_intersector_t or NULL if not found

◆ cs_medcoupling_intersector_destroy()

void cs_medcoupling_intersector_destroy ( cs_medcoupling_intersector_t *  mi)

Destroy a given MEDCoupling intersector.

Parameters
[in]mipointer to the cs_medcoupling_intersector_t struct

◆ cs_medcoupling_intersector_destroy_all()

void cs_medcoupling_intersector_destroy_all ( void  )

Free all allocated intersectors.

◆ cs_medcoupling_intersector_dump_mesh()

void cs_medcoupling_intersector_dump_mesh ( cs_medcoupling_intersector_t *  mi,
const char *  prefix 
)

dump the mesh of a cs_medcoupling_intersector_t structure

translate the mesh using a given vector

Parameters
[in]mipointer to the cs_medcoupling_intersector_t struct
[in]prefixsubdir prefix

◆ cs_medcoupling_intersector_rotate()

void cs_medcoupling_intersector_rotate ( cs_medcoupling_intersector_t *  mi,
cs_real_t  invariant[3],
cs_real_t  axis[3],
cs_real_t  angle 
)

rotate the mesh

Parameters
[in]mipointer to the cs_medcoupling_intersector_t struct
[in]invariantInvariant point
[in]axisRotation axis
[in]angleangle (in radians)

◆ cs_medcoupling_intersector_scale_auto()

void cs_medcoupling_intersector_scale_auto ( cs_medcoupling_intersector_t *  mi,
cs_real_t  factor 
)

Scale a mesh using a factor based on the current mesh center position.

Parameters
[in]mipointer to the cs_medcoupling_intersector_t struct
[in]factorscaling factor (cs_real_t)

◆ cs_medcoupling_intersector_transform_from_init()

void cs_medcoupling_intersector_transform_from_init ( cs_medcoupling_intersector_t *  mi,
cs_real_t  matrix[3][4] 
)

Transform a mesh, but takes as input the initial position of the mesh.

Transformation is thus applied on the initial coordiantes and the mesh is modified accordingly.

Parameters
[in]mipointer to the cs_medcoupling_intersector_t struct
[in]matrixtransformation matrix

◆ cs_medcoupling_intersector_translate()

void cs_medcoupling_intersector_translate ( cs_medcoupling_intersector_t *  mi,
cs_real_t  translation[3] 
)

translate the mesh using a given vector

Parameters
[in]mipointer to the cs_medcoupling_intersector_t struct
[in]translationtranslation vector

◆ cs_mi_post_add_mesh()

void cs_mi_post_add_mesh ( cs_medcoupling_intersector_t *  mi)

Associate a Medcoupling mesh to the default writer.

Parameters
[in]mipointer to the associated MedCoupling intersector structure

◆ cs_mi_post_get_writer_id()

int cs_mi_post_get_writer_id ( void  )

Return writer id used for medcoupling meshes, 0 means unused.

◆ cs_mi_post_init_writer()

void cs_mi_post_init_writer ( const char *  case_name,
const char *  dir_name,
const char *  fmt_name,
const char *  fmt_opts,
fvm_writer_time_dep_t  time_dep,
bool  output_at_start,
bool  output_at_end,
int  frequency_n,
double  frequency_t 
)

Create a new writer that will contains the boundary MED mesh added.

by the user. The writer_id is stored locally..

Parameters
[in]time_dep> 1 if the writer is transient, else writer is fixed