Skip to content

Commit

Permalink
created common base clase for surface projection implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
ogloth committed Jul 11, 2012
1 parent 2ec9aa0 commit 1a26da5
Show file tree
Hide file tree
Showing 14 changed files with 611 additions and 543 deletions.
2 changes: 0 additions & 2 deletions src/libengrid/booleangeometryoperation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,6 @@ double BooleanGeometryOperation::smoothJunction_mesher()
swap();
int deleted_nodes = SurfaceAlgorithm::deleteNodes();
for (int i = 0; i < 2; ++i) {
SurfaceProjection::Nfull = 0;
SurfaceProjection::Nhalf = 0;
smooth(1, true);
swap();
}
Expand Down
6 changes: 3 additions & 3 deletions src/libengrid/booleangeometryoperation.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
class BooleanGeometryOperation;

#include "surfacealgorithm.h"
#include "surfaceprojection.h"
#include "trisurfaceprojection.h"

class BooleanGeometryOperation : public SurfaceAlgorithm
{
Expand Down Expand Up @@ -61,8 +61,8 @@ class BooleanGeometryOperation : public SurfaceAlgorithm

vtkUnstructuredGrid *m_ShapeGrid1;
vtkUnstructuredGrid *m_ShapeGrid2;
SurfaceProjection m_Proj1;
SurfaceProjection m_Proj2;
TriSurfaceProjection m_Proj1;
TriSurfaceProjection m_Proj2;
MeshPartition m_Part1;
MeshPartition m_Part2;
int m_Side1;
Expand Down
1 change: 1 addition & 0 deletions src/libengrid/gridsmoother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "elements.h"
#include "optimisenormalvector.h"
#include "pointfinder.h"
#include "trisurfaceprojection.h"

#include <QTime>

Expand Down
7 changes: 4 additions & 3 deletions src/libengrid/guimainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "guieditboundaryconditions.h"
#include "laplacesmoother.h"
#include "swaptriangles.h"
#include "trisurfaceprojection.h"

#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
Expand Down Expand Up @@ -1942,7 +1943,7 @@ void GuiMainWindow::configure()
try {
GridSmoother tmp01;
GuiCreateBoundaryLayer tmp02;
SurfaceProjection tmp03;
TriSurfaceProjection tmp03;
SurfaceMesher tmp04;
UpdateDesiredMeshDensity tmp05;
InsertPoints tmp06;
Expand Down Expand Up @@ -2113,7 +2114,7 @@ void GuiMainWindow::storeSurfaceProjection(bool nosave)
try {
resetSurfaceProjection();
foreach (int bc, m_AllBoundaryCodes) {
SurfaceProjection *proj = new SurfaceProjection();
TriSurfaceProjection *proj = new TriSurfaceProjection();
m_SurfProj[bc] = proj;
QSet<int> bcs;
bcs.insert(bc);
Expand Down Expand Up @@ -2141,7 +2142,7 @@ void GuiMainWindow::resetSurfaceProjection()
for (vtkIdType id_node = 0; id_node < m_Grid->GetNumberOfPoints(); ++id_node) {
pindex->SetValue(id_node, -1);
}
SurfaceProjection::resetPindex();
TriSurfaceProjection::resetPindex();
} catch (Error) {
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/libengrid/guimainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@
#include "volumedefinition.h"
#include "physicalboundarycondition.h"
#include "checksurfaceintegrity.h"

#include "surfaceprojection.h"

#include "openfoamcase.h"
#include "guitransform.h"
#include "openfoamtools.h"
Expand Down
2 changes: 0 additions & 2 deletions src/libengrid/laplacesmoother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,6 @@ void LaplaceSmoother::operate()
for (int i_iter = 0; i_iter < m_NumberOfIterations; ++i_iter) {
m_Success = true;
computeNormals();
SurfaceProjection::Nfull = 0;
SurfaceProjection::Nhalf = 0;
for (int i_nodes = 0; i_nodes < nodes.size(); ++i_nodes) {
vtkIdType id_node = nodes[i_nodes];
if (!m_Fixed[id_node] && !blocked[i_nodes]) {
Expand Down
2 changes: 2 additions & 0 deletions src/libengrid/libengrid.pro
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ HEADERS = boundarycondition.h \
checksurfaceintegrity.h \
surfaceoperation.h \
surfaceprojection.h \
trisurfaceprojection.h \
octree.h \
filetemplate.h \
openfoamcase.h \
Expand Down Expand Up @@ -268,6 +269,7 @@ SOURCES = boundarycondition.cpp \
checksurfaceintegrity.cpp \
surfaceoperation.cpp \
surfaceprojection.cpp \
trisurfaceprojection.cpp \
octree.cpp \
filetemplate.cpp \
openfoamcase.cpp \
Expand Down
1 change: 1 addition & 0 deletions src/libengrid/orthogonalityoptimiser.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "orthogonalityoptimiser.h"
#include "surfaceprojection.h"
#include "guimainwindow.h"

OrthogonalityOptimiser::OrthogonalityOptimiser()
{
Expand Down
6 changes: 1 addition & 5 deletions src/libengrid/reducesurfacetriangulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//

#include "reducesurfacetriangulation.h"
#include "surfaceprojection.h"
#include "trisurfaceprojection.h"

ReduceSurfaceTriangulation::ReduceSurfaceTriangulation()
{
Expand Down Expand Up @@ -55,11 +55,7 @@ void ReduceSurfaceTriangulation::pass1()
cout << "deleted nodes : " << num_deleted << endl;
for (int i = 0; i < m_NumSmoothSteps; ++i) {
cout << " smoothing : " << i+1 << "/" << m_NumSmoothSteps << endl;
SurfaceProjection::Nfull = 0;
SurfaceProjection::Nhalf = 0;
smooth(1);
cout << " " << SurfaceProjection::Nfull << " full searches" << endl;
cout << " " << SurfaceProjection::Nhalf << " half searches" << endl;
swap();
}
done = num_deleted <= max(num_initial_nodes/100, num_del_max/100);
Expand Down
2 changes: 0 additions & 2 deletions src/libengrid/surfacemesher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ void SurfaceMesher::operate()
cout << " deleted nodes : " << num_deleted << endl;
//computeMeshDensity(); // !!
for (int i = 0; i < m_NumSmoothSteps; ++i) {
SurfaceProjection::Nfull = 0;
SurfaceProjection::Nhalf = 0;
smooth(1, m_CorrectCurvature);
swap();
}
Expand Down
Loading

0 comments on commit 1a26da5

Please sign in to comment.