Skip to content

Commit

Permalink
398 restructure the smoothy module for calling smoothing algorithms (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
franck-ledoux authored Jul 29, 2024
1 parent b2ed772 commit b0ab553
Show file tree
Hide file tree
Showing 32 changed files with 908 additions and 606 deletions.
27 changes: 16 additions & 11 deletions blockMesher/src/main_blockmesher.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/*----------------------------------------------------------------------------*/
#include <gmds/cad/GeomCurve.h>
#include <gmds/cad/GeomPoint.h>
#include <gmds/cad/GeomSurface.h>
#include <gmds/cadfac/FACManager.h>
#include <gmds/ig/Mesh.h>
#include <gmds/ig/MeshDoctor.h>
#include <gmds/io/IGMeshIOService.h>
#include <gmds/io/VTKReader.h>
#include <gmds/io/VTKWriter.h>
#include <gmds/cadfac/FACManager.h>
#include <gmds/cad/GeomPoint.h>
#include <gmds/cad/GeomCurve.h>
#include <gmds/cad/GeomSurface.h>
#include <gmds/smoothy/AngleBasedQuadSmoother.h>
#include <gmds/smoothy/LaplacianSmoother.h>
#include <gmds/smoothy/LaplacianSmoother3C.h>
/*----------------------------------------------------------------------------*/
#include <iostream>
#include <gmds/igalgo/BoundaryOperator.h>
Expand Down Expand Up @@ -449,15 +449,18 @@ int main(int argc, char* argv[])
// PERFORM THE BLOCK SMOOTHING NOW
//==================================================================
std::cout<<"> Start block smoothing"<<std::endl;
smoothy::LaplacianSmoother smoother(&linker);
smoothy::LaplacianSmoother3C smoother(&blocking, &linker);
if(!smoother.isValid())
{
std::cout<<"INVALID MODEL"<<std::endl;
exit(1);
}
std::cout<<" - start smoothing ("<<nb_curve_smooth_iterations<<" iterations)"<<std::endl;
smoother.smoothCurves(nb_curve_smooth_iterations);
smoother.smoothSurfaces(nb_surface_smooth_iterations);
smoother.setNodesAll();
smoother.setNbIterations(nb_curve_smooth_iterations);
smoother.smoothCurves();
smoother.setNbIterations(nb_surface_smooth_iterations);
smoother.smoothSurfaces();
// std::cout<<" - start volume smoothing ("<<nb_volume_smooth_iterations<<" iterations)"<<std::endl;
// smoother.smoothVolumes(nb_volume_smooth_iterations);

Expand Down Expand Up @@ -516,15 +519,17 @@ int main(int argc, char* argv[])
if(info.second.dim==2)
linker_final.linkFaceToSurface(f.id(),info.second.id);
}
smoothy::LaplacianSmoother smoother_final(&linker_final);
smoothy::LaplacianSmoother3C smoother_final(bm.mesh(),&linker_final);
if(!smoother_final.isValid())
{
std::cout<<"INVALID MODEL"<<std::endl;
exit(1);
}
std::cout<<" - start smoothing ("<<nb_curve_smooth_iterations<<" iterations)"<<std::endl;
smoother_final.smoothCurves(nb_curve_smooth_iterations);
smoother_final.smoothSurfaces(nb_surface_smooth_iterations);
smoother_final.setNbIterations(nb_curve_smooth_iterations);
smoother_final.smoothCurves();
smoother_final.setNbIterations(nb_surface_smooth_iterations);
smoother_final.smoothSurfaces();
std::cout<<"> Start final mesh writing"<<std::endl;
IGMeshIOService ioService_mesh(bm.mesh());
VTKWriter vtkWriter_mesh(&ioService_mesh);
Expand Down
2 changes: 1 addition & 1 deletion docs/doxygen/annotated.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
<tr id="row_2_6_" style="display:none;"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_2_6_" class="arrow" onclick="toggleFolder('2_6_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><b>smoothy</b></td><td class="desc"></td></tr>
<tr id="row_2_6_0_" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html" target="_self">AbstractSmoother</a></td><td class="desc"><a class="el" href="class_this.html">This</a> class provides attributes and methods that are shared by smoothing algorithms as child classes. It is abstract and so cannot be instanciated </td></tr>
<tr id="row_2_6_1_" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classgmds_1_1smoothy_1_1_angle_based_quad_smoother.html" target="_self">AngleBasedQuadSmoother</a></td><td class="desc"></td></tr>
<tr id="row_2_6_2_" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html" target="_self">LaplacianSmoother</a></td><td class="desc"><a class="el" href="class_this.html">This</a> class provides a straightforward implementation of a Laplacian smoother for meshes classifiend on geometric models. Curves, surfaces and volumes are smoothed individually </td></tr>
<tr id="row_2_6_2_" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html" target="_self">LaplacianSmoother3C</a></td><td class="desc"><a class="el" href="class_this.html">This</a> class provides a straightforward implementation of a Laplacian smoother for meshes classifiend on geometric models. Curves, surfaces and volumes are smoothed individually </td></tr>
<tr id="row_2_7_" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classgmds_1_1_abstract_data.html" target="_self">AbstractData</a></td><td class="desc">Any data that we provide to a service must extend this abstract class </td></tr>
<tr id="row_2_8_" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classgmds_1_1_abstract_service.html" target="_self">AbstractService</a></td><td class="desc">Defines the minimal interface of each service implemented in GMDS </td></tr>
<tr id="row_2_9_" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classgmds_1_1_array2_d.html" target="_self">Array2D</a></td><td class="desc">Class implementing a 2D array made of T type objects </td></tr>
Expand Down
2 changes: 1 addition & 1 deletion docs/doxygen/classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
</tr>
<tr><td valign="top"><a class="el" href="classgmds_1_1_cell_group.html">CellGroup</a> (<a class="el" href="namespacegmds.html">gmds</a>)&#160;&#160;&#160;</td>
<td valign="top"><a class="el" href="classgmds_1_1_field_solver_strategy_itf.html">FieldSolverStrategyItf</a> (<a class="el" href="namespacegmds.html">gmds</a>)&#160;&#160;&#160;</td>
<td valign="top"><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">LaplacianSmoother</a> (gmds::smoothy)&#160;&#160;&#160;</td>
<td valign="top"><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">LaplacianSmoother3C</a> (gmds::smoothy)&#160;&#160;&#160;</td>
<td valign="top"><a class="el" href="classgmds_1_1math_1_1_plane.html">Plane</a> (gmds::math)&#160;&#160;&#160;</td>
<td valign="top"><a class="el" href="struct_s_point_data.html">SPointData</a>&#160;&#160;&#160;</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<img src="classgmds_1_1smoothy_1_1_abstract_smoother.png" usemap="#gmds::smoothy::AbstractSmoother_map" alt=""/>
<map id="gmds::smoothy::AbstractSmoother_map" name="gmds::smoothy::AbstractSmoother_map">
<area href="classgmds_1_1smoothy_1_1_angle_based_quad_smoother.html" alt="gmds::smoothy::AngleBasedQuadSmoother" shape="rect" coords="0,56,251,80"/>
<area href="classgmds_1_1smoothy_1_1_laplacian_smoother.html" title="This class provides a straightforward implementation of a Laplacian smoother for meshes classifiend o..." alt="gmds::smoothy::LaplacianSmoother" shape="rect" coords="261,56,512,80"/>
<area href="classgmds_1_1smoothy_1_1_laplacian_smoother.html" title="This class provides a straightforward implementation of a Laplacian smoother for meshes classifiend o..." alt="gmds::smoothy::LaplacianSmoother3C" shape="rect" coords="261,56,512,80"/>
</map>
</div></div>
<table class="memberdecls">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,29 @@

<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacegmds.html">gmds</a></li><li class="navelem"><b>smoothy</b></li><li class="navelem"><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">LaplacianSmoother</a></li> </ul>
<li class="navelem"><a class="el" href="namespacegmds.html">gmds</a></li><li class="navelem"><b>smoothy</b></li><li class="navelem"><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">LaplacianSmoother3C</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">gmds::smoothy::LaplacianSmoother Member List</div> </div>
<div class="title">gmds::smoothy::LaplacianSmoother3C Member List</div> </div>
</div><!--header-->
<div class="contents">

<p>This is the complete list of members for <a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother</a>, including all inherited members.</p>
<p>This is the complete list of members for <a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother3C</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html#a21a88a68c317e14a020c9f9fc4372f62">AbstractSmoother</a>(cad::GeomMeshLinker *ALinker)</td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html">gmds::smoothy::AbstractSmoother</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html#a96277624266200de671d01255252d9b9">init</a>()</td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html">gmds::smoothy::AbstractSmoother</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html#a43eac155fc29e078267dcc1436a05055">isValid</a>() const</td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html">gmds::smoothy::AbstractSmoother</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>LaplacianSmoother</b>(cad::GeomMeshLinker *ALinker) (defined in <a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother</a>)</td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>LaplacianSmoother3C</b>(cad::GeomMeshLinker *ALinker) (defined in <a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother3C</a>)</td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother3C</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html#ac3c42e789b5814f9e22e2a5090332305">m_c2n</a></td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html">gmds::smoothy::AbstractSmoother</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html#acf9021bab0ce42ff92eac418f5a79d8e">m_linker</a></td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html">gmds::smoothy::AbstractSmoother</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html#a0a1b605c97dc94bef91396dfdd6deef6">m_n2n</a></td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html">gmds::smoothy::AbstractSmoother</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html#a36df8386cf4ded44a27b097d36be5c9d">m_s2n</a></td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html">gmds::smoothy::AbstractSmoother</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html#a248d6a8a0ceb10cc937cd09e3ff654d7">m_v2n</a></td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_abstract_smoother.html">gmds::smoothy::AbstractSmoother</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>smoothCurves</b>(const int ANbIterations=1) (defined in <a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother</a>)</td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>smoothSurfaces</b>(const int ANbIterations=1) (defined in <a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother</a>)</td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>smoothVolumes</b>(const int ANbIterations=1) (defined in <a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother</a>)</td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>smoothCurves</b>(const int ANbIterations=1) (defined in <a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother3C</a>)</td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother3C</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>smoothSurfaces</b>(const int ANbIterations=1) (defined in <a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother3C</a>)</td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother3C</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>smoothVolumes</b>(const int ANbIterations=1) (defined in <a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother3C</a>)</td><td class="entry"><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">gmds::smoothy::LaplacianSmoother3C</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Expand Down
16 changes: 8 additions & 8 deletions docs/doxygen/classgmds_1_1smoothy_1_1_laplacian_smoother.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>gmds: gmds::smoothy::LaplacianSmoother Class Reference</title>
<title>gmds: gmds::smoothy::LaplacianSmoother3C Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
Expand Down Expand Up @@ -62,24 +62,24 @@

<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacegmds.html">gmds</a></li><li class="navelem"><b>smoothy</b></li><li class="navelem"><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">LaplacianSmoother</a></li> </ul>
<li class="navelem"><a class="el" href="namespacegmds.html">gmds</a></li><li class="navelem"><b>smoothy</b></li><li class="navelem"><a class="el" href="classgmds_1_1smoothy_1_1_laplacian_smoother.html">LaplacianSmoother3C</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classgmds_1_1smoothy_1_1_laplacian_smoother-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">gmds::smoothy::LaplacianSmoother Class Reference</div> </div>
<div class="title">gmds::smoothy::LaplacianSmoother3C Class Reference</div> </div>
</div><!--header-->
<div class="contents">

<p><a class="el" href="class_this.html">This</a> class provides a straightforward implementation of a Laplacian smoother for meshes classifiend on geometric models. Curves, surfaces and volumes are smoothed individually.
<a href="classgmds_1_1smoothy_1_1_laplacian_smoother.html#details">More...</a></p>

<p><code>#include &lt;LaplacianSmoother.h&gt;</code></p>
<p><code>#include &lt;LaplacianSmoother3C.h&gt;</code></p>
<div class="dynheader">
Inheritance diagram for gmds::smoothy::LaplacianSmoother:</div>
Inheritance diagram for gmds::smoothy::LaplacianSmoother3C:</div>
<div class="dyncontent">
<div class="center">
<img src="classgmds_1_1smoothy_1_1_laplacian_smoother.png" usemap="#gmds::smoothy::LaplacianSmoother_map" alt=""/>
Expand All @@ -91,7 +91,7 @@
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a205815df1bf525404fa9824edfe631fc"><td class="memItemLeft" align="right" valign="top"><a id="a205815df1bf525404fa9824edfe631fc"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>LaplacianSmoother</b> (<a class="el" href="classgmds_1_1cad_1_1_geom_mesh_linker.html">cad::GeomMeshLinker</a> *ALinker)</td></tr>
&#160;</td><td class="memItemRight" valign="bottom"><b>LaplacianSmoother3C</b> (<a class="el" href="classgmds_1_1cad_1_1_geom_mesh_linker.html">cad::GeomMeshLinker</a> *ALinker)</td></tr>
<tr class="separator:a205815df1bf525404fa9824edfe631fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d8375ff9d8cfb12679b3d54cef369b4"><td class="memItemLeft" align="right" valign="top"><a id="a0d8375ff9d8cfb12679b3d54cef369b4"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>smoothCurves</b> (const int ANbIterations=1)</td></tr>
Expand Down Expand Up @@ -132,8 +132,8 @@
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="class_this.html">This</a> class provides a straightforward implementation of a Laplacian smoother for meshes classifiend on geometric models. Curves, surfaces and volumes are smoothed individually. </p>
</div><hr/>The documentation for this class was generated from the following files:<ul>
<li>/home/runner/work/gmds/gmds/smoothy/inc/gmds/smoothy/LaplacianSmoother.h</li>
<li>/home/runner/work/gmds/gmds/smoothy/src/LaplacianSmoother.cpp</li>
<li>/home/runner/work/gmds/gmds/smoothy/inc/gmds/smoothy/LaplacianSmoother3C.h</li>
<li>/home/runner/work/gmds/gmds/smoothy/src/LaplacianSmoother3C.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
Expand Down
Loading

0 comments on commit b0ab553

Please sign in to comment.