Skip to content

Commit

Permalink
Merge pull request #15 from dengwirda/dev
Browse files Browse the repository at this point in the history
0.9.9 updates: "Skinny" off-centres, arcs on ellipsoid, etc
  • Loading branch information
dengwirda authored Mar 4, 2019
2 parents 765bd16 + f2aecfa commit 08bebe4
Show file tree
Hide file tree
Showing 49 changed files with 3,956 additions and 1,194 deletions.
167 changes: 144 additions & 23 deletions src/geo_load.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*
--------------------------------------------------------
*
* Last updated: 19 January, 2019
* Last updated: 28 February, 2019
*
* Copyright 2013-2019
* Darren Engwirda
Expand Down Expand Up @@ -154,7 +154,17 @@
if (this->_kind ==
jmsh_kind::ellipsoid_mesh)
{
//!! do things here...
typename
geom_data::ellipsoid_mesh_3d
::node_type _ndat ;
_ndat.pval(0) = _pval[0];
_ndat.pval(1) = _pval[1];
_ndat.pval(2) = + 0.0 ;
_ndat.itag () = _itag ;

this->_geom->
_ellipsoid_mesh_3d.
_mesh.push_node(_ndat, false) ;
}
}
/*---------------------------------- parse EDGE2 data */
Expand Down Expand Up @@ -201,7 +211,16 @@
if (this->_kind ==
jmsh_kind::ellipsoid_mesh)
{
//!! do things here...
typename
geom_data::ellipsoid_mesh_3d
::edge_type _edat ;
_edat.node(0) = _node[0];
_edat.node(1) = _node[1];
_edat.itag () = _itag ;

this->_geom->
_ellipsoid_mesh_3d.
_mesh.push_edge(_edat, false) ;
}
}
/*---------------------------------- parse TRIA3 data */
Expand Down Expand Up @@ -308,7 +327,10 @@
_file, geom_reader(&_geom));
}
else
{
{
_jlog.push(
"**parse error: file not found!\n" ) ;

_errv = __file_not_located ;
}
_file.close ();
Expand Down Expand Up @@ -531,6 +553,43 @@
_geom._ellipsoid_mesh_3d.
_radC = _gmsh._radii._data[0] ;
}

for (auto _ipos = (size_t) +0 ;
_ipos != _gmsh._vert3._size ;
++_ipos )
{
typename
geom_data::ellipsoid_mesh_3d
::node_type _ndat ;
_ndat.pval(0) = _gmsh.
_vert3._data[_ipos]._ppos[0];
_ndat.pval(1) = _gmsh.
_vert3._data[_ipos]._ppos[1];
_ndat.pval(2) = + 0.0 ;
_ndat.itag () = _gmsh.
_vert3._data[_ipos]._itag ;

_geom._ellipsoid_mesh_3d.
_mesh.push_node(_ndat , false) ;
}

for (auto _ipos = (size_t) +0 ;
_ipos != _gmsh._edge2._size ;
++_ipos )
{
typename
geom_data::ellipsoid_mesh_3d
::edge_type _edat ;
_edat.node(0) = _gmsh.
_edge2._data[_ipos]._node[0];
_edat.node(1) = _gmsh.
_edge2._data[_ipos]._node[1];
_edat.itag () = _gmsh.
_edge2._data[_ipos]._itag ;

_geom._ellipsoid_mesh_3d.
_mesh.push_edge(_edat , false) ;
}
}

}
Expand All @@ -557,26 +616,8 @@
geom_data &_geom
)
{
iptr_type _errv = __no_error ;

std::string _path ;
std::string _name ;
std::string _fext ;
file_part (
_jcfg._geom_file,
_path, _name, _fext ) ;

if (_fext.find("msh") == +0 )
{
return geom_from_jmsh (
_jcfg, _jlog, _geom ) ;
}
else
{
_errv =__file_not_located ;
}

return ( _errv ) ;
}

/*
Expand Down Expand Up @@ -869,6 +910,59 @@

_errv = __invalid_argument ;
}

iptr_type _imin =
std::numeric_limits<iptr_type>::max() ;
iptr_type _imax =
std::numeric_limits<iptr_type>::min() ;

iptr_type _nnPT = +0 ;
iptr_type _nnE2 = +0 ;

for (auto _iter = _geom.
_ellipsoid_mesh_3d._mesh._set1.head() ;
_iter != _geom.
_ellipsoid_mesh_3d._mesh._set1.tend() ;
++_iter )
{
if (_iter->mark() < 0) continue;

_nnPT += +1 ;
}

for (auto _iter = _geom.
_ellipsoid_mesh_3d._mesh._set2.head() ;
_iter != _geom.
_ellipsoid_mesh_3d._mesh._set2.tend() ;
++_iter )
{
if (_iter->mark() < 0) continue;

_imin = std::min(
_imin, _iter->node(0)) ;
_imin = std::min(
_imin, _iter->node(1)) ;
_imax = std::max(
_imax, _iter->node(0)) ;
_imax = std::max(
_imax, _iter->node(1)) ;

_nnE2 += +1 ;

if (_imin < +0 ||
_imax >= _nnPT)
{
_errv = __invalid_argument ;
}
}

if (_errv != __no_error)
{
_jlog. push (
"**input error: GEOM. EDGE2 indexing is incorrect.\n") ;

return _errv ;
}
}

return ( _errv ) ;
Expand Down Expand Up @@ -1020,7 +1114,34 @@
_geom._ellipsoid_mesh_3d._radB) ;

__dumpREAL("|3-RAD.|",
_geom._ellipsoid_mesh_3d._radC) ;
_geom._ellipsoid_mesh_3d._radC) ;

_jlog.push("\n") ;

iptr_type _nnPT = +0 ;
iptr_type _nnE2 = +0 ;

for (auto _iter = _geom.
_ellipsoid_mesh_3d._mesh._set1.head() ;
_iter != _geom.
_ellipsoid_mesh_3d._mesh._set1.tend() ;
++_iter )
{
if (_iter->mark()>=+0) _nnPT += +1 ;
}

__dumpINTS("|COORD.|", _nnPT)

for (auto _iter = _geom.
_ellipsoid_mesh_3d._mesh._set2.head() ;
_iter != _geom.
_ellipsoid_mesh_3d._mesh._set2.tend() ;
++_iter )
{
if (_iter->mark()>=+0) _nnE2 += +1 ;
}

__dumpINTS("|EDGE-2|", _nnE2)
}

_jlog.push("\n") ;
Expand Down
23 changes: 4 additions & 19 deletions src/hfn_load.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*
--------------------------------------------------------
*
* Last updated: 19 January, 2019
* Last updated: 02 February, 2019
*
* Copyright 2013-2019
* Darren Engwirda
Expand Down Expand Up @@ -372,6 +372,9 @@
}
else
{
_jlog.push(
"**parse error: file not found!\n" ) ;

_errv = __file_not_located ;
}
_file.close ();
Expand Down Expand Up @@ -670,26 +673,8 @@
hfun_data &_hfun
)
{
iptr_type _errv = __no_error ;

std::string _path ;
std::string _name ;
std::string _fext ;
file_part (
_jcfg._hfun_file ,
_path, _name, _fext ) ;

if (_fext.find("msh") == +0 )
{
return hfun_from_jmsh (
_jcfg, _jlog, _hfun ) ;
}
else
{
_errv =__file_not_located ;
}

return ( _errv ) ;
}

/*
Expand Down
27 changes: 6 additions & 21 deletions src/ini_load.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*
--------------------------------------------------------
*
* Last updated: 19 January, 2019
* Last updated: 02 February, 2019
*
* Copyright 2013-2019
* Darren Engwirda
Expand Down Expand Up @@ -287,7 +287,7 @@
jmsh_reader _jmsh ;
std::ifstream _file ;
_file. open(
_jcfg._init_file, std::ifstream::in);
_jcfg._init_file, std::ifstream::in) ;

if (_file.is_open() )
{
Expand All @@ -296,6 +296,9 @@
}
else
{
_jlog.push(
"**parse error: file not found!\n" ) ;

_errv = __file_not_located ;
}
_file.close ();
Expand All @@ -307,7 +310,7 @@
++_iter )
{
_jlog.push(
"**parse error: " + * _iter + "\n") ;
"**parse error: " + * _iter + "\n" ) ;
}
}
catch (...)
Expand Down Expand Up @@ -547,26 +550,8 @@
mesh_data &_init
)
{
iptr_type _errv = __no_error ;

std::string _path ;
std::string _name ;
std::string _fext ;
file_part (
_jcfg._init_file,
_path, _name, _fext ) ;

if (_fext.find("msh") == +0 )
{
return init_from_jmsh (
_jcfg, _jlog, _init ) ;
}
else
{
_errv =__file_not_located ;
}

return ( _errv ) ;
}

/*
Expand Down
18 changes: 14 additions & 4 deletions src/jig_load.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*
--------------------------------------------------------
*
* Last updated: 02 January, 2019
* Last updated: 20 February, 2019
*
* Copyright 2013-2019
* Darren Engwirda
Expand Down Expand Up @@ -231,6 +231,13 @@
this->_jjig->
_rdel_opts.iter() = _iter;
}
__normal_call void_type push_mesh_rule (
std::int32_t _rule
)
{
this->_jjig->
_rdel_opts.rule() = _rule;
}
__normal_call void_type push_mesh_siz1 (
double _siz1
)
Expand Down Expand Up @@ -391,15 +398,18 @@
jcfg_reader _read;
std::ifstream _file;
_file. open(
_jcfg._jcfg_file, std::ifstream::in);
_jcfg._jcfg_file, std::ifstream::in) ;

if (_file.is_open())
{
_read.read_file (
_file, jcfg_loader(&_jcfg));
}
else
{
{
_jlog.push(
"**parse error: file not found!\n" ) ;

_errv = __file_not_located ;
}
_file.close ();
Expand All @@ -411,7 +421,7 @@
++_iter )
{
_jlog.push(
"**parse error: " + * _iter + "\n") ;
"**parse error: " + * _iter + "\n" ) ;
}
}
catch (...)
Expand Down
Loading

0 comments on commit 08bebe4

Please sign in to comment.