Mmg
Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)
tools_2d.c
Go to the documentation of this file.
1/* =============================================================================
2** This file is part of the mmg software package for the tetrahedral
3** mesh modification.
4** Copyright (c) Bx INP/CNRS/Inria/UBordeaux/UPMC, 2004-
5**
6** mmg is free software: you can redistribute it and/or modify it
7** under the terms of the GNU Lesser General Public License as published
8** by the Free Software Foundation, either version 3 of the License, or
9** (at your option) any later version.
10**
11** mmg is distributed in the hope that it will be useful, but WITHOUT
12** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13** FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14** License for more details.
15**
16** You should have received a copy of the GNU Lesser General Public
17** License and of the GNU General Public License along with mmg (in
18** files COPYING.LESSER and COPYING). If not, see
19** <http://www.gnu.org/licenses/>. Please read their terms carefully and
20** use this copy of the mmg distribution only if you accept them.
21** =============================================================================
22*/
34#include "libmmg2d_private.h"
35
46MMG5_int MMG2D_indElt(MMG5_pMesh mesh, MMG5_int kel) {
47 MMG5_pTria pt;
48 MMG5_int ne, k;
49
50 ne = 0;
51 for (k=1; k<=mesh->nt; k++) {
52 pt = &mesh->tria[k];
53 if ( MG_EOK(pt) ) {
54 ne++;
55 if ( k == kel ) return ne;
56 }
57 }
58 return 0;
59}
60
70MMG5_int MMG2D_indPt(MMG5_pMesh mesh, MMG5_int kp) {
71 MMG5_pPoint ppt;
72 MMG5_int np, k;
73
74 np = 0;
75 for (k=1; k<=mesh->np; k++) {
76 ppt = &mesh->point[k];
77 if ( MG_VOK(ppt) ) {
78 np++;
79 if ( k == kp ) return np;
80 }
81 }
82 return 0;
83}
84
93
94 if ( !nsd ) {
95 return;
96 }
97
98 if ( mesh->info.imprim > 4 || mesh->info.ddebug ) {
99 fprintf(stdout,"\n -- ONLY KEEP DOMAIN OF REF %d\n",nsd );
100 }
101
103
105
107
108 return;
109}
MMG5_pMesh * mesh
int MMG2D_delElt(MMG5_pMesh mesh, MMG5_int iel)
Definition: zaldy_2d.c:105
void MMG2D_delPt(MMG5_pMesh mesh, MMG5_int ip)
Definition: zaldy_2d.c:57
#define MG_EOK(pt)
void MMG5_keep_subdomainElts(MMG5_pMesh, int, int(*delElt)(MMG5_pMesh, MMG5_int))
Definition: tools.c:1072
void MMG5_mark_usedVertices(MMG5_pMesh mesh, void(*delPt)(MMG5_pMesh, MMG5_int))
Definition: tools.c:1018
void MMG5_mark_verticesAsUnused(MMG5_pMesh mesh)
Definition: tools.c:994
#define MG_VOK(ppt)
int8_t ddebug
Definition: libmmgtypes.h:532
MMG mesh structure.
Definition: libmmgtypes.h:605
MMG5_Info info
Definition: libmmgtypes.h:651
MMG5_pPoint point
Definition: libmmgtypes.h:641
MMG5_int nt
Definition: libmmgtypes.h:612
MMG5_pTria tria
Definition: libmmgtypes.h:647
MMG5_int np
Definition: libmmgtypes.h:612
Structure to store points of a MMG mesh.
Definition: libmmgtypes.h:270
MMG5_int MMG2D_indPt(MMG5_pMesh mesh, MMG5_int kp)
Definition: tools_2d.c:70
MMG5_int MMG2D_indElt(MMG5_pMesh mesh, MMG5_int kel)
Definition: tools_2d.c:46
void MMG2D_keep_only1Subdomain(MMG5_pMesh mesh, int nsd)
Definition: tools_2d.c:92