forked from dengwirda/jigsaw
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun_tria.hpp
More file actions
205 lines (176 loc) · 5.84 KB
/
run_tria.hpp
File metadata and controls
205 lines (176 loc) · 5.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/*
--------------------------------------------------------
* RUN-TRIA: do the restricted tessellation step.
--------------------------------------------------------
*
* This program may be freely redistributed under the
* condition that the copyright notices (including this
* entire header) are not removed, and no compensation
* is received through use of the software. Private,
* research, and institutional use is free. You may
* distribute modified versions of this code UNDER THE
* CONDITION THAT THIS CODE AND ANY MODIFICATIONS MADE
* TO IT IN THE SAME FILE REMAIN UNDER COPYRIGHT OF THE
* ORIGINAL AUTHOR, BOTH SOURCE AND OBJECT CODE ARE
* MADE FREELY AVAILABLE WITHOUT CHARGE, AND CLEAR
* NOTICE IS GIVEN OF THE MODIFICATIONS. Distribution
* of this code as part of a commercial system is
* permissible ONLY BY DIRECT ARRANGEMENT WITH THE
* AUTHOR. (If you are not directly supplying this
* code to a customer, and you are instead telling them
* how they can obtain it for free, then you are not
* required to make any arrangement with me.)
*
* Disclaimer: Neither I nor: Columbia University, The
* Massachusetts Institute of Technology, The
* University of Sydney, nor The National Aeronautics
* and Space Administration warrant this code in any
* way whatsoever. This code is provided "as-is" to be
* used at your own risk.
*
--------------------------------------------------------
*
* Last updated: 28 December, 2018
*
* Copyright 2013-2018
* Darren Engwirda
* de2363@columbia.edu
* https://github.com/dengwirda/
*
--------------------------------------------------------
*/
# pragma once
# ifndef __RUN_TRIA__
# define __RUN_TRIA__
/*
--------------------------------------------------------
* Call the 2-dimensional tessellator.
--------------------------------------------------------
*/
template <
typename geom_type ,
typename init_type ,
typename rdel_type ,
typename jlog_data
>
__normal_call void_type rdel_euclidean_2d (
geom_type &_geom,
init_type &_init,
rdel_type &_rdel,
jcfg_data &_args,
jlog_data &_jlog
)
{
/*------------------------------ call rDEL kernel */
typedef mesh::rdel_make_2d <
rdel_type ,
geom_type > rdel_func ;
typedef
jcfg_data::rdel_opts rdel_opts ;
rdel_opts *_opts =
&_args._rdel_opts ;
rdel_func::rdel_make (
_geom, _init ,
_rdel, *_opts , _jlog ) ;
}
/*
--------------------------------------------------------
* Call the 3-dimensional tessellator.
--------------------------------------------------------
*/
template <
typename geom_type ,
typename init_type ,
typename rdel_type ,
typename jlog_data
>
__normal_call void_type rdel_euclidean_3d (
geom_type &_geom,
init_type &_init,
rdel_type &_rdel,
jcfg_data &_args,
jlog_data &_jlog
)
{
/*------------------------------ call rDEL kernel */
typedef mesh::rdel_make_3d <
rdel_type ,
geom_type > rdel_func ;
typedef
jcfg_data::rdel_opts rdel_opts ;
rdel_opts *_opts =
&_args._rdel_opts ;
rdel_func::rdel_make (
_geom, _init ,
_rdel, *_opts , _jlog ) ;
}
/*
--------------------------------------------------------
* MAKE-RDEL: call the tessellator.
--------------------------------------------------------
*/
template <
typename jlog_data
>
__normal_call iptr_type make_rdel (
jcfg_data &_args,
jlog_data &_jlog,
mesh_data &_init,
geom_data &_geom,
rdel_data &_rdel
)
{
iptr_type _errv = __no_error ;
try
{
if (_geom._ndim == +2 &&
_geom._kind ==
jmsh_kind::euclidean_mesh)
{
/*----------- have euclidean-mesh GEOM kernel */
_rdel._kind =
jmsh_kind::euclidean_mesh;
_rdel._ndim = +2 ;
rdel_euclidean_2d (
_geom._euclidean_mesh_2d,
_init._euclidean_mesh_2d,
_rdel._euclidean_rdel_2d,
_args, _jlog) ;
}
else
if (_geom._ndim == +3 &&
_geom._kind ==
jmsh_kind::euclidean_mesh)
{
/*----------- have euclidean-mesh GEOM kernel */
_rdel._kind =
jmsh_kind::euclidean_mesh;
_rdel._ndim = +3 ;
rdel_euclidean_3d (
_geom._euclidean_mesh_3d,
_init._euclidean_mesh_3d,
_rdel._euclidean_rdel_3d,
_args, _jlog) ;
}
else
if (_geom._kind ==
jmsh_kind::ellipsoid_mesh)
{
/*----------- have ellipsoid-mesh GEOM kernel */
_rdel._kind =
jmsh_kind::euclidean_mesh;
_rdel._ndim = +3 ;
rdel_euclidean_3d (
_geom._ellipsoid_mesh_3d,
_init._euclidean_mesh_3d,
_rdel._euclidean_rdel_3d,
_args, _jlog) ;
}
}
catch (...)
{
_errv = __unknown_error ;
}
return ( _errv ) ;
}
# endif // __RUN_TRIA__