Skip to content

Commit 08bebe4

Browse files
authored
Merge pull request #15 from dengwirda/dev
0.9.9 updates: "Skinny" off-centres, arcs on ellipsoid, etc
2 parents 765bd16 + f2aecfa commit 08bebe4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3956
-1194
lines changed

src/geo_load.hpp

Lines changed: 144 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*
3232
--------------------------------------------------------
3333
*
34-
* Last updated: 19 January, 2019
34+
* Last updated: 28 February, 2019
3535
*
3636
* Copyright 2013-2019
3737
* Darren Engwirda
@@ -154,7 +154,17 @@
154154
if (this->_kind ==
155155
jmsh_kind::ellipsoid_mesh)
156156
{
157-
//!! do things here...
157+
typename
158+
geom_data::ellipsoid_mesh_3d
159+
::node_type _ndat ;
160+
_ndat.pval(0) = _pval[0];
161+
_ndat.pval(1) = _pval[1];
162+
_ndat.pval(2) = + 0.0 ;
163+
_ndat.itag () = _itag ;
164+
165+
this->_geom->
166+
_ellipsoid_mesh_3d.
167+
_mesh.push_node(_ndat, false) ;
158168
}
159169
}
160170
/*---------------------------------- parse EDGE2 data */
@@ -201,7 +211,16 @@
201211
if (this->_kind ==
202212
jmsh_kind::ellipsoid_mesh)
203213
{
204-
//!! do things here...
214+
typename
215+
geom_data::ellipsoid_mesh_3d
216+
::edge_type _edat ;
217+
_edat.node(0) = _node[0];
218+
_edat.node(1) = _node[1];
219+
_edat.itag () = _itag ;
220+
221+
this->_geom->
222+
_ellipsoid_mesh_3d.
223+
_mesh.push_edge(_edat, false) ;
205224
}
206225
}
207226
/*---------------------------------- parse TRIA3 data */
@@ -308,7 +327,10 @@
308327
_file, geom_reader(&_geom));
309328
}
310329
else
311-
{
330+
{
331+
_jlog.push(
332+
"**parse error: file not found!\n" ) ;
333+
312334
_errv = __file_not_located ;
313335
}
314336
_file.close ();
@@ -531,6 +553,43 @@
531553
_geom._ellipsoid_mesh_3d.
532554
_radC = _gmsh._radii._data[0] ;
533555
}
556+
557+
for (auto _ipos = (size_t) +0 ;
558+
_ipos != _gmsh._vert3._size ;
559+
++_ipos )
560+
{
561+
typename
562+
geom_data::ellipsoid_mesh_3d
563+
::node_type _ndat ;
564+
_ndat.pval(0) = _gmsh.
565+
_vert3._data[_ipos]._ppos[0];
566+
_ndat.pval(1) = _gmsh.
567+
_vert3._data[_ipos]._ppos[1];
568+
_ndat.pval(2) = + 0.0 ;
569+
_ndat.itag () = _gmsh.
570+
_vert3._data[_ipos]._itag ;
571+
572+
_geom._ellipsoid_mesh_3d.
573+
_mesh.push_node(_ndat , false) ;
574+
}
575+
576+
for (auto _ipos = (size_t) +0 ;
577+
_ipos != _gmsh._edge2._size ;
578+
++_ipos )
579+
{
580+
typename
581+
geom_data::ellipsoid_mesh_3d
582+
::edge_type _edat ;
583+
_edat.node(0) = _gmsh.
584+
_edge2._data[_ipos]._node[0];
585+
_edat.node(1) = _gmsh.
586+
_edge2._data[_ipos]._node[1];
587+
_edat.itag () = _gmsh.
588+
_edge2._data[_ipos]._itag ;
589+
590+
_geom._ellipsoid_mesh_3d.
591+
_mesh.push_edge(_edat , false) ;
592+
}
534593
}
535594

536595
}
@@ -557,26 +616,8 @@
557616
geom_data &_geom
558617
)
559618
{
560-
iptr_type _errv = __no_error ;
561-
562-
std::string _path ;
563-
std::string _name ;
564-
std::string _fext ;
565-
file_part (
566-
_jcfg._geom_file,
567-
_path, _name, _fext ) ;
568-
569-
if (_fext.find("msh") == +0 )
570-
{
571619
return geom_from_jmsh (
572620
_jcfg, _jlog, _geom ) ;
573-
}
574-
else
575-
{
576-
_errv =__file_not_located ;
577-
}
578-
579-
return ( _errv ) ;
580621
}
581622

582623
/*
@@ -869,6 +910,59 @@
869910

870911
_errv = __invalid_argument ;
871912
}
913+
914+
iptr_type _imin =
915+
std::numeric_limits<iptr_type>::max() ;
916+
iptr_type _imax =
917+
std::numeric_limits<iptr_type>::min() ;
918+
919+
iptr_type _nnPT = +0 ;
920+
iptr_type _nnE2 = +0 ;
921+
922+
for (auto _iter = _geom.
923+
_ellipsoid_mesh_3d._mesh._set1.head() ;
924+
_iter != _geom.
925+
_ellipsoid_mesh_3d._mesh._set1.tend() ;
926+
++_iter )
927+
{
928+
if (_iter->mark() < 0) continue;
929+
930+
_nnPT += +1 ;
931+
}
932+
933+
for (auto _iter = _geom.
934+
_ellipsoid_mesh_3d._mesh._set2.head() ;
935+
_iter != _geom.
936+
_ellipsoid_mesh_3d._mesh._set2.tend() ;
937+
++_iter )
938+
{
939+
if (_iter->mark() < 0) continue;
940+
941+
_imin = std::min(
942+
_imin, _iter->node(0)) ;
943+
_imin = std::min(
944+
_imin, _iter->node(1)) ;
945+
_imax = std::max(
946+
_imax, _iter->node(0)) ;
947+
_imax = std::max(
948+
_imax, _iter->node(1)) ;
949+
950+
_nnE2 += +1 ;
951+
952+
if (_imin < +0 ||
953+
_imax >= _nnPT)
954+
{
955+
_errv = __invalid_argument ;
956+
}
957+
}
958+
959+
if (_errv != __no_error)
960+
{
961+
_jlog. push (
962+
"**input error: GEOM. EDGE2 indexing is incorrect.\n") ;
963+
964+
return _errv ;
965+
}
872966
}
873967

874968
return ( _errv ) ;
@@ -1020,7 +1114,34 @@
10201114
_geom._ellipsoid_mesh_3d._radB) ;
10211115

10221116
__dumpREAL("|3-RAD.|",
1023-
_geom._ellipsoid_mesh_3d._radC) ;
1117+
_geom._ellipsoid_mesh_3d._radC) ;
1118+
1119+
_jlog.push("\n") ;
1120+
1121+
iptr_type _nnPT = +0 ;
1122+
iptr_type _nnE2 = +0 ;
1123+
1124+
for (auto _iter = _geom.
1125+
_ellipsoid_mesh_3d._mesh._set1.head() ;
1126+
_iter != _geom.
1127+
_ellipsoid_mesh_3d._mesh._set1.tend() ;
1128+
++_iter )
1129+
{
1130+
if (_iter->mark()>=+0) _nnPT += +1 ;
1131+
}
1132+
1133+
__dumpINTS("|COORD.|", _nnPT)
1134+
1135+
for (auto _iter = _geom.
1136+
_ellipsoid_mesh_3d._mesh._set2.head() ;
1137+
_iter != _geom.
1138+
_ellipsoid_mesh_3d._mesh._set2.tend() ;
1139+
++_iter )
1140+
{
1141+
if (_iter->mark()>=+0) _nnE2 += +1 ;
1142+
}
1143+
1144+
__dumpINTS("|EDGE-2|", _nnE2)
10241145
}
10251146

10261147
_jlog.push("\n") ;

src/hfn_load.hpp

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*
3232
--------------------------------------------------------
3333
*
34-
* Last updated: 19 January, 2019
34+
* Last updated: 02 February, 2019
3535
*
3636
* Copyright 2013-2019
3737
* Darren Engwirda
@@ -372,6 +372,9 @@
372372
}
373373
else
374374
{
375+
_jlog.push(
376+
"**parse error: file not found!\n" ) ;
377+
375378
_errv = __file_not_located ;
376379
}
377380
_file.close ();
@@ -670,26 +673,8 @@
670673
hfun_data &_hfun
671674
)
672675
{
673-
iptr_type _errv = __no_error ;
674-
675-
std::string _path ;
676-
std::string _name ;
677-
std::string _fext ;
678-
file_part (
679-
_jcfg._hfun_file ,
680-
_path, _name, _fext ) ;
681-
682-
if (_fext.find("msh") == +0 )
683-
{
684676
return hfun_from_jmsh (
685677
_jcfg, _jlog, _hfun ) ;
686-
}
687-
else
688-
{
689-
_errv =__file_not_located ;
690-
}
691-
692-
return ( _errv ) ;
693678
}
694679

695680
/*

src/ini_load.hpp

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*
3232
--------------------------------------------------------
3333
*
34-
* Last updated: 19 January, 2019
34+
* Last updated: 02 February, 2019
3535
*
3636
* Copyright 2013-2019
3737
* Darren Engwirda
@@ -287,7 +287,7 @@
287287
jmsh_reader _jmsh ;
288288
std::ifstream _file ;
289289
_file. open(
290-
_jcfg._init_file, std::ifstream::in);
290+
_jcfg._init_file, std::ifstream::in) ;
291291

292292
if (_file.is_open() )
293293
{
@@ -296,6 +296,9 @@
296296
}
297297
else
298298
{
299+
_jlog.push(
300+
"**parse error: file not found!\n" ) ;
301+
299302
_errv = __file_not_located ;
300303
}
301304
_file.close ();
@@ -307,7 +310,7 @@
307310
++_iter )
308311
{
309312
_jlog.push(
310-
"**parse error: " + * _iter + "\n") ;
313+
"**parse error: " + * _iter + "\n" ) ;
311314
}
312315
}
313316
catch (...)
@@ -547,26 +550,8 @@
547550
mesh_data &_init
548551
)
549552
{
550-
iptr_type _errv = __no_error ;
551-
552-
std::string _path ;
553-
std::string _name ;
554-
std::string _fext ;
555-
file_part (
556-
_jcfg._init_file,
557-
_path, _name, _fext ) ;
558-
559-
if (_fext.find("msh") == +0 )
560-
{
561553
return init_from_jmsh (
562554
_jcfg, _jlog, _init ) ;
563-
}
564-
else
565-
{
566-
_errv =__file_not_located ;
567-
}
568-
569-
return ( _errv ) ;
570555
}
571556

572557
/*

src/jig_load.hpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*
3232
--------------------------------------------------------
3333
*
34-
* Last updated: 02 January, 2019
34+
* Last updated: 20 February, 2019
3535
*
3636
* Copyright 2013-2019
3737
* Darren Engwirda
@@ -231,6 +231,13 @@
231231
this->_jjig->
232232
_rdel_opts.iter() = _iter;
233233
}
234+
__normal_call void_type push_mesh_rule (
235+
std::int32_t _rule
236+
)
237+
{
238+
this->_jjig->
239+
_rdel_opts.rule() = _rule;
240+
}
234241
__normal_call void_type push_mesh_siz1 (
235242
double _siz1
236243
)
@@ -391,15 +398,18 @@
391398
jcfg_reader _read;
392399
std::ifstream _file;
393400
_file. open(
394-
_jcfg._jcfg_file, std::ifstream::in);
401+
_jcfg._jcfg_file, std::ifstream::in) ;
395402

396403
if (_file.is_open())
397404
{
398405
_read.read_file (
399406
_file, jcfg_loader(&_jcfg));
400407
}
401408
else
402-
{
409+
{
410+
_jlog.push(
411+
"**parse error: file not found!\n" ) ;
412+
403413
_errv = __file_not_located ;
404414
}
405415
_file.close ();
@@ -411,7 +421,7 @@
411421
++_iter )
412422
{
413423
_jlog.push(
414-
"**parse error: " + * _iter + "\n") ;
424+
"**parse error: " + * _iter + "\n" ) ;
415425
}
416426
}
417427
catch (...)

0 commit comments

Comments
 (0)