7#ifndef ARCGEOSIM_SURFACEUTILS_GEOMETRYKERNELSURFACETOOLS_GEOMETRYKERNELSURFACEINTERNALUTILS_H
8#define ARCGEOSIM_SURFACEUTILS_GEOMETRYKERNELSURFACETOOLS_GEOMETRYKERNELSURFACEINTERNALUTILS_H
13#include <arcane/Item.h>
14#include <arcane/utils/Array.h>
15#include <arcane/utils/Real3.h>
16#include "arcane/VariableTypes.h"
17#include <arcane/ItemGroup.h>
18#include <arcane/IMeshSubMeshTransition.h>
20#include <GeometryKernel/datamodel/micro/surface/triangulation-data-structure.h>
21#include <GeometryKernel/datamodel/geometry/vector.h>
26NUMERICS_BEGIN_NAMESPACE
34 GeometryKernel::TriangulationDataStructurePtr m_triangulation,
38 Real3 & m_mean_normal);
40void saveSurface(
const char * filename, GeometryKernel::TriangulationDataStructure & tr);
42void loadSurface(
const char * filename, GeometryKernel::TriangulationDataStructure & tr);
54 GeometryKernel::TriangulationDataStructure & triangulation)
55 : m_nodes_coordinates(PRIMARYMESH_CAST(
mesh)->nodesCoordinates()),
56 m_node_array(node_array),
57 m_triangulation(triangulation)
62 GeometryKernel::TObjectId getNodeId(
const Node node)
65 std::pair<KnownNodes::iterator,bool> inserter = m_known_nodes.insert(KnownNodes::value_type(inode,NULL_ID));
68 const Real3 coords = m_nodes_coordinates[node];
69 const GeometryKernel::TObjectId new_id = m_triangulation.newVertex(GeometryKernel::Vector(coords.
x,coords.
y,coords.
z));
70 ARCANE_ASSERT(((
Integer)m_node_array.size()==(
Integer)new_id),(
"Non-synchronized GeometryKernel with internal SurfaceImpl [%d vs %d]",new_id,m_node_array.size()));
71 m_node_array.add(node);
72 return (inserter.first->second = new_id);
76 return inserter.first->second;
81 const Real3 node1_coord = m_nodes_coordinates[node1];
82 const Real3 node2_coord = m_nodes_coordinates[node2];
83 const Real3 node3_coord = m_nodes_coordinates[node3];
84 return math::vecMul(node2_coord-node1_coord,node3_coord-node1_coord);
90 GeometryKernel::TriangulationDataStructure & m_triangulation;
92 typedef std::map<Integer,GeometryKernel::TObjectId> KnownNodes;
93 KnownNodes m_known_nodes;
Tableau d'items de types quelconques.
constexpr Int32 localId() const
Identifiant local de l'entité dans le sous-domaine du processeur.
Classe gérant un vecteur de réel de dimension 3.
__host__ __device__ Real3 vecMul(Real3 u, Real3 v)
Produit vectoriel de u par v. dans .
ItemGroupT< Face > FaceGroup
Groupe de faces.
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Grandeur au noeud de type coordonnées.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.
Real3 convertGKVector(const GeometryKernel::Vector &v)
convert GeometryKernel vector to Real3
void loadSurface(const char *filename, GeometryKernel::TriangulationDataStructure &tr)
Load surface utility for debugging purpose (binary format)
void saveSurface(const char *filename, GeometryKernel::TriangulationDataStructure &tr)
Save surface utility for debugging purpose (binary format)
void buildFaceGroupSurface(FaceGroup group, GeometryKernel::TriangulationDataStructurePtr surface, Array< Node > &node_array, Array< Face > &face_array, Array< bool > &face_reorient, Real3 &normal)
Build GK triangulation and additional data from a face group.
Real y
deuxième composante du triplet
Real z
troisième composante du triplet
Real x
première composante du triplet