#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_mesh.hxx"#include "cs_medcoupling_intersector.h"#include <MEDCoupling_version.h>#include <MEDFileMesh.hxx>#include <MEDLoader.hxx>#include <MEDCouplingNormalizedUnstructuredMesh.txx>#include "Interpolation3D.hxx"#include "Interpolation3DSurf.hxx"#include "Interpolation2D3D.hxx"
Include dependency graph for cs_medcoupling_intersector.cxx:Functions | |
| static cs_medcoupling_intersector_t * | _create_intersector (void) |
| create a cs_medcoupling_intersector_t object More... | |
| void | _allocate_intersector_external_mesh (cs_medcoupling_intersector_t *mi, const cs_lnum_t n_vtx, const cs_lnum_t dim) |
| Allocate and fill arrays needed for fvm writers. More... | |
| void | _allocate_intersector (cs_medcoupling_intersector_t *mi, const char *name, const char *medfile_path, const char *interp_method, const char *select_criteria, cs_medcpl_intersect_type_t type) |
| Initialize a cs_medcoupling_intersector with given parameters. More... | |
| void | _add_intersector (const char *name, const char *medfile_path, const char *interp_method, const char *select_criteria, cs_medcpl_intersect_type_t type) |
| Add a MEDCoupling intersector. More... | |
| static void | _transform_coord_from_init (cs_real_t matrix[3][4], cs_real_t vector[3], cs_real_t res[3]) |
| Compute a matrix/vector product to apply a transformation to a vector. More... | |
| static void | _transform_coord (cs_real_t matrix[3][4], cs_real_t vector[3]) |
| Compute a matrix/vector product to apply a transformation to a vector. More... | |
| static void | _assign_vertex_coords (MEDCouplingUMesh *med_mesh, cs_coord_3_t *coords) |
| assign vertex coordinates to a medcoupling mesh structure More... | |
| void | _destroy_intersector (cs_medcoupling_intersector_t *mi) |
| destroy a given intersector More... | |
| void | _compute_intersection_surfaces (cs_medcoupling_intersector_t *mi) |
| Compute surface intersection matrix and update the intersection array. More... | |
| void | _compute_intersection_volumes (cs_medcoupling_intersector_t *mi) |
| Compute intersection matrix and update the intersection array. More... | |
| void | _compute_intersection_volume_surfaces (cs_medcoupling_intersector_t *mi) |
| Compute volume to surface 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_vol (const char *name, const char *medfile_path, const char *interp_method, const char *select_criteria) |
| Add a volume MEDCoupling intersector. More... | |
| void | cs_medcoupling_intersector_add_surf (const char *name, const char *medfile_path, const char *interp_method, const char *select_criteria) |
| Add a surface MEDCoupling intersector. More... | |
| void | cs_medcoupling_intersector_add_vol_surf (const char *name, const char *medfile_path, const char *interp_method, const char *select_criteria) |
| Add a surface in volume 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_t * | cs_medcoupling_intersect_volumes (cs_medcoupling_intersector_t *mi) |
| Compute the intersection volumes between the source mesh and code mesh. More... | |
| cs_real_t * | cs_medcoupling_intersect_surfaces (cs_medcoupling_intersector_t *mi) |
| Compute the intersection surfaces between the source mesh and code mesh. More... | |
| cs_real_t * | cs_medcoupling_intersect_volume_and_surfaces (cs_medcoupling_intersector_t *mi) |
| Compute the intersection surfaces 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... | |
Variables | |
| static int | _n_intersects = 0 |
| static int | _writer_id = 0 |
| static cs_medcoupling_intersector_t ** | _intersects = NULL |
| void _add_intersector | ( | const char * | name, |
| const char * | medfile_path, | ||
| const char * | interp_method, | ||
| const char * | select_criteria, | ||
| cs_medcpl_intersect_type_t | type | ||
| ) |
Add a MEDCoupling intersector.
| [in] | name | name of the intersector |
| [in] | medfile_path | path to the MED file |
| [in] | interp_method | interpolation method (P0P0, P1P0, ..) |
| [in] | select_criteria | selection criteria |
| [in] | type | intersection type (volume or surface) |
| void _allocate_intersector | ( | cs_medcoupling_intersector_t * | mi, |
| const char * | name, | ||
| const char * | medfile_path, | ||
| const char * | interp_method, | ||
| const char * | select_criteria, | ||
| cs_medcpl_intersect_type_t | type | ||
| ) |
Initialize a cs_medcoupling_intersector with given parameters.
| [in] | mi | pointer to the cs_medcoupling_intersector_t struct |
| [in] | name | name of the intersector |
| [in] | medfile_path | path to the MED file |
| [in] | interp_method | interpolation method (P0P0, P1P0, ..) |
| [in] | select_criteria | selection criteria |
| [in] | type | intersection type (volume or surface) |
| void _allocate_intersector_external_mesh | ( | cs_medcoupling_intersector_t * | mi, |
| const cs_lnum_t | n_vtx, | ||
| const cs_lnum_t | dim | ||
| ) |
Allocate and fill arrays needed for fvm writers.
| [in] | mi | pointer to the cs_medcoupling_intersector_t struct |
| [in] | n_vtx | number of vertices in the mesh |
| [in] | dim | mesh dimension |
|
static |
assign vertex coordinates to a medcoupling mesh structure
| [in] | med_mesh | pointer to MEDCouplingUMesh to which we copy the coordinates |
| [in] | coords | pointer to the coordinates to assign to the MEDCouplingUMesh |
| void _compute_intersection_surfaces | ( | cs_medcoupling_intersector_t * | mi | ) |
Compute surface intersection matrix and update the intersection array.
| [in] | mi | pointer to the cs_medcoupling_intersector_t struct |
| void _compute_intersection_volume_surfaces | ( | cs_medcoupling_intersector_t * | mi | ) |
Compute volume to surface intersection matrix and update the intersection array.
| [in] | mi | pointer to the cs_medcoupling_intersector_t struct |
| void _compute_intersection_volumes | ( | cs_medcoupling_intersector_t * | mi | ) |
Compute intersection matrix and update the intersection array.
| [in] | mi | pointer to the cs_medcoupling_intersector_t struct |
|
static |
create a cs_medcoupling_intersector_t object
| void _destroy_intersector | ( | cs_medcoupling_intersector_t * | mi | ) |
destroy a given intersector
| [in] | mi | pointer to the cs_medcoupling_intersector_t struct |
| void _dump_medcoupling_mesh | ( | MEDCouplingUMesh * | m, |
| const char * | prefix, | ||
| const char * | filename | ||
| ) |
dump a medcoupling mesh
| [in] | m | MEDCouplingUMesh to dump |
| [in] | prefix | folder where the file is to be written |
| [in] | filename | name of the file to write |
Compute a matrix/vector product to apply a transformation to a vector.
| [in] | matrix | matrix |
| [in] | vector | vector |
|
inlinestatic |
Compute a matrix/vector product to apply a transformation to a vector.
Results is stored in an output array.
| [in] | matrix | matrix |
| [in] | vector | vector |
| [out] | res | resulting vector |
| cs_real_t* cs_medcoupling_intersect_surfaces | ( | cs_medcoupling_intersector_t * | mi | ) |
Compute the intersection surfaces between the source mesh and code mesh.
| [in] | mi | pointer to the cs_medcoupling_intersector_t struct |
| cs_real_t* cs_medcoupling_intersect_volume_and_surfaces | ( | cs_medcoupling_intersector_t * | mi | ) |
Compute the intersection surfaces between the source mesh and code mesh.
| [in] | mi | pointer to the cs_medcoupling_intersector_t struct |
| cs_real_t* cs_medcoupling_intersect_volumes | ( | cs_medcoupling_intersector_t * | mi | ) |
Compute the intersection volumes between the source mesh and code mesh.
| [in] | mi | pointer to the cs_medcoupling_intersector_t struct |
| void cs_medcoupling_intersector_add_surf | ( | const char * | name, |
| const char * | medfile_path, | ||
| const char * | interp_method, | ||
| const char * | select_criteria | ||
| ) |
Add a surface MEDCoupling intersector.
| [in] | name | name of the intersector |
| [in] | medfile_path | path to the MED file |
| [in] | interp_method | interpolation method (P0P0, P1P0, ..) |
| [in] | select_criteria | selection criteria |
| void cs_medcoupling_intersector_add_vol | ( | const char * | name, |
| const char * | medfile_path, | ||
| const char * | interp_method, | ||
| const char * | select_criteria | ||
| ) |
Add a volume MEDCoupling intersector.
| [in] | name | name of the intersector |
| [in] | medfile_path | path to the MED file |
| [in] | interp_method | interpolation method (P0P0, P1P0, ..) |
| [in] | select_criteria | selection criteria |
| void cs_medcoupling_intersector_add_vol_surf | ( | const char * | name, |
| const char * | medfile_path, | ||
| const char * | interp_method, | ||
| const char * | select_criteria | ||
| ) |
Add a surface in volume MEDCoupling intersector.
| [in] | name | name of the intersector |
| [in] | medfile_path | path to the MED file |
| [in] | interp_method | interpolation method (P0P0, P1P0, ..) |
| [in] | select_criteria | selection criteria |
| cs_medcoupling_intersector_t* cs_medcoupling_intersector_by_id | ( | int | id | ) |
Get a MEDCoupling intersector using its id.
| [in] | id | id of the intersector |
| cs_medcoupling_intersector_t* cs_medcoupling_intersector_by_name | ( | const char * | name | ) |
Get an intersector by name.
Get a MEDCoupling intersector by name.
| [in] | name | name of the intersector |
| void cs_medcoupling_intersector_destroy | ( | cs_medcoupling_intersector_t * | mi | ) |
Destroy a given MEDCoupling intersector.
| [in] | mi | pointer to the cs_medcoupling_intersector_t struct |
| void cs_medcoupling_intersector_destroy_all | ( | void | ) |
Free all allocated intersectors.
| 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
| [in] | mi | pointer to the cs_medcoupling_intersector_t struct |
| [in] | prefix | subdir prefix |
| 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
| [in] | mi | pointer to the cs_medcoupling_intersector_t struct |
| [in] | invariant | Invariant point |
| [in] | axis | Rotation axis |
| [in] | angle | angle (in radians) |
| 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.
| [in] | mi | pointer to the cs_medcoupling_intersector_t struct |
| [in] | factor | scaling factor (cs_real_t) |
| 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.
| [in] | mi | pointer to the cs_medcoupling_intersector_t struct |
| [in] | matrix | transformation matrix |
| void cs_medcoupling_intersector_translate | ( | cs_medcoupling_intersector_t * | mi, |
| cs_real_t | translation[3] | ||
| ) |
translate the mesh using a given vector
| [in] | mi | pointer to the cs_medcoupling_intersector_t struct |
| [in] | translation | translation vector |
| void cs_mi_post_add_mesh | ( | cs_medcoupling_intersector_t * | mi | ) |
Associate a Medcoupling mesh to the default writer.
| [in] | mi | pointer to the associated MedCoupling intersector structure |
| int cs_mi_post_get_writer_id | ( | void | ) |
Return writer id used for medcoupling meshes, 0 means unused.
| 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..
| [in] | time_dep | > 1 if the writer is transient, else writer is fixed |
|
static |
|
static |
|
static |