Mmg
Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)
intmet_s.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*/
23
36#include "libmmgs_private.h"
37
38extern int8_t ddb;
39
40
41
42
57int intregmet(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int k,int8_t i,double s,double mr[6]) {
58 MMG5_pTria pt;
59
60 pt = &mesh->tria[k];
61
62 return MMG5_interpreg_ani(mesh,met,pt,i,s,mr);
63}
64
77int intmet_iso(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int k,int8_t i,MMG5_int ip,double s) {
78 MMG5_pTria pt;
79 MMG5_int ip1,ip2;
80 int8_t i1,i2;
81
82 pt = &mesh->tria[k];
83 i1 = MMG5_inxt2[i];
84 i2 = MMG5_iprv2[i];
85 ip1 = pt->v[i1];
86 ip2 = pt->v[i2];
87 met->m[ip] = s * (met->m[ip1] + met->m[ip2]);
88 return 1;
89}
90
104int intmet_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int k,int8_t i,MMG5_int ip,double s) {
105 MMG5_pTria pt;
106 MMG5_pPoint ppt;
107 MMG5_pxPoint go;
108 double *m;
109 int i1, i2;
110 MMG5_int ip1, ip2;
111
112 pt = &mesh->tria[k];
113 i1 = MMG5_inxt2[i];
114 i2 = MMG5_iprv2[i];
115 ip1 = pt->v[i1];
116 ip2 = pt->v[i2];
117
118 m = &met->m[6*ip];
119 if ( pt->tag[i] & MG_GEO ) {
120 ppt = &mesh->point[ip];
121 assert(ppt->xp);
122 go = &mesh->xpoint[ppt->xp];
123 return MMG5_intridmet(mesh,met,ip1,ip2,s,go->n1,m);
124 }
125 else {
126 return intregmet(mesh,met,k,i,s,m);
127 }
128 return 1;
129}
130
144int MMGS_intmet33_ani(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int k,int8_t i,MMG5_int ip,double s) {
145 MMG5_pTria pt;
146 double *mr,*m,*n;
147 int i1, i2;
148 MMG5_int ip1, ip2;
149
150 pt = &mesh->tria[k];
151 i1 = MMG5_inxt2[i];
152 i2 = MMG5_iprv2[i];
153 ip1 = pt->v[i1];
154 ip2 = pt->v[i2];
155
156 m = &met->m[6*ip1];
157 n = &met->m[6*ip2];
158 mr = &met->m[6*ip];
159
160 return MMG5_mmgIntmet33_ani(m,n,mr,s);
161}
MMG5_pMesh * mesh
int MMG5_mmgIntmet33_ani(double *m, double *n, double *mr, double s)
Definition: intmet.c:50
int MMG5_interpreg_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt, int8_t i, double s, double mr[6])
Definition: intmet.c:504
int MMG5_intridmet(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int ip1, MMG5_int ip2, double s, double v[3], double mr[6])
Definition: intmet.c:163
int intmet_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t i, MMG5_int ip, double s)
Definition: intmet_s.c:104
int MMGS_intmet33_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t i, MMG5_int ip, double s)
Definition: intmet_s.c:144
int intmet_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t i, MMG5_int ip, double s)
Definition: intmet_s.c:77
int8_t ddb
Definition: mmg3d1_delone.c:42
int intregmet(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t i, double s, double mr[6])
Definition: intmet_s.c:57
#define MG_GEO
static const uint8_t MMG5_iprv2[3]
static const uint8_t MMG5_inxt2[6]
MMG mesh structure.
Definition: libmmgtypes.h:605
MMG5_pPoint point
Definition: libmmgtypes.h:641
MMG5_pxPoint xpoint
Definition: libmmgtypes.h:642
MMG5_pTria tria
Definition: libmmgtypes.h:647
Structure to store points of a MMG mesh.
Definition: libmmgtypes.h:270
MMG5_int xp
Definition: libmmgtypes.h:279
double * m
Definition: libmmgtypes.h:671
int16_t tag[3]
Definition: libmmgtypes.h:342
MMG5_int v[3]
Definition: libmmgtypes.h:334
Structure to store surface points of a MMG mesh.
Definition: libmmgtypes.h:294
double n1[3]
Definition: libmmgtypes.h:295