From dd42b4b4138ea8332e23b3a630c05cc3a0eea320 Mon Sep 17 00:00:00 2001 From: ogloth Date: Thu, 22 Jan 2009 17:32:35 +0000 Subject: [PATCH] change licence dates, fixed in/out side colours, started symbolic bcs --- deletepickedcell.cpp => boundarycondition.cpp | 15 ++- error.h => boundarycondition.h | 29 +++-- celllayeriterator.cpp | 22 ++++ celllayeriterator.h | 2 +- cellneighbouriterator.cpp | 2 +- cellneighbouriterator.h | 2 +- containertricks.h | 2 +- correctsurfaceorientation.cpp | 2 +- correctsurfaceorientation.h | 2 +- createsurfacemesh.cpp | 2 +- createsurfacemesh.h | 2 +- createvolumemesh.cpp | 2 +- createvolumemesh.h | 2 +- deletecells.cpp | 2 +- deletecells.h | 2 +- deletepickedcell.cpp | 2 +- deletepickedcell.h | 2 +- deletetetras.cpp | 2 +- deletetetras.h | 2 +- deletevolumegrid.cpp | 2 +- deletevolumegrid.h | 2 +- dialogoperation.h | 2 +- egvtkobject.cpp | 2 +- egvtkobject.h | 2 +- elements.cpp | 2 +- elements.h | 2 +- engrid.h | 4 +- engrid.kdevelop | 8 +- engrid.pro | 84 ++++++++------- error.cpp | 2 +- error.h | 2 +- fixstl.cpp | 2 +- fixstl.h | 2 +- layeriterator.cpp => fluentreader.cpp | 9 +- fluentreader.h | 2 +- deletepickedcell.cpp => foamreader.cpp | 20 +++- foamreader.h | 2 +- foamwriter.cpp | 2 +- foamwriter.h | 2 +- geometrytools.cpp | 2 +- geometrytools.h | 2 +- gmshiooperation.cpp | 2 +- gmshiooperation.h | 2 +- gmshreader.cpp | 2 +- gmshreader.h | 2 +- gmshwriter.cpp | 2 +- gmshwriter.h | 2 +- gridsmoother.cpp | 35 +++--- gridsmoother.h | 2 +- guicreateboundarylayer.cpp | 2 +- guicreateboundarylayer.h | 2 +- guideletebadaspecttris.cpp | 2 +- guideletebadaspecttris.h | 2 +- guidivideboundarylayer.cpp | 2 +- guidivideboundarylayer.h | 2 +- iterator.cpp => guieditboundaryconditions.cpp | 50 +++++---- ...tboundarycodes.h => guieditboundaryconditions.h | 30 +++--- guieditboundaryconditions.ui | 118 +++++++++++++++++++++ guiimproveaspectratio.cpp | 2 +- guiimproveaspectratio.h | 2 +- guimainwindow.cpp | 94 ++++++++++++---- guimainwindow.h | 15 ++- guimainwindow.ui | 6 ++ guinormalextrusion.cpp | 2 +- guinormalextrusion.h | 2 +- guiselectboundarycodes.cpp | 2 +- guiselectboundarycodes.h | 2 +- guisetboundarycode.cpp | 2 +- guisetboundarycode.h | 2 +- guismoothsurface.cpp | 2 +- guismoothsurface.h | 2 +- iooperation.cpp | 2 +- iooperation.h | 2 +- iterator.cpp | 2 +- iterator.h | 2 +- layeriterator.cpp | 2 +- layeriterator.h | 2 +- neutralwriter.cpp | 2 +- neutralwriter.h | 2 +- nodelayeriterator.cpp | 2 +- nodelayeriterator.h | 2 +- operation.cpp | 2 +- operation.h | 2 +- optimisation.cpp | 2 +- optimisation.h | 2 +- stlwriter.cpp => polydatareader.cpp | 42 ++++---- polydatareader.h | 2 +- polymesh.cpp | 2 +- polymesh.h | 4 +- seedsimpleprismaticlayer.cpp | 2 +- seedsimpleprismaticlayer.h | 2 +- setboundarycode.cpp | 2 +- setboundarycode.h | 2 +- sortablevector.h | 4 +- std_connections.h | 2 +- std_includes.h | 2 +- stlreader.cpp | 2 +- stlreader.h | 2 +- stlwriter.cpp | 2 +- stlwriter.h | 2 +- swaptriangles.cpp | 2 +- swaptriangles.h | 2 +- tvtkoperation.h | 2 +- uniquevector.h | 4 +- vtkEgBoundaryCodesFilter.h | 2 +- vtkEgEliminateShortEdges.h | 2 +- vtkEgExtractVolumeCells.h | 2 +- vtkEgGridFilter.h | 2 +- vtkEgNormalExtrusion.h | 2 +- vtkEgPolyDataToUnstructuredGridFilter.h | 2 +- std_includes.h => vtkreader.cpp | 42 +++++--- vtkreader.h | 2 +- 112 files changed, 528 insertions(+), 291 deletions(-) copy deletepickedcell.cpp => boundarycondition.cpp (83%) copy error.h => boundarycondition.h (81%) copy layeriterator.cpp => fluentreader.cpp (90%) copy deletepickedcell.cpp => foamreader.cpp (82%) copy iterator.cpp => guieditboundaryconditions.cpp (55%) copy guiselectboundarycodes.h => guieditboundaryconditions.h (76%) create mode 100644 guieditboundaryconditions.ui copy stlwriter.cpp => polydatareader.cpp (62%) copy std_includes.h => vtkreader.cpp (69%) diff --git a/deletepickedcell.cpp b/boundarycondition.cpp similarity index 83% copy from deletepickedcell.cpp copy to boundarycondition.cpp index 1dc53c8..9db0772 100644 --- a/deletepickedcell.cpp +++ b/boundarycondition.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + @@ -20,11 +20,16 @@ // + + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +#include "boundarycondition.h" -#include "deletepickedcell.h" +BoundaryCondition::BoundaryCondition() +{ + name = "unknown"; + type = "patch"; +}; -void DeletePickedCell::operate() +BoundaryCondition::BoundaryCondition(QString a_name, QString a_type) { - EG_VTKSP(vtkUnstructuredGrid, new_grid); - makeCopy(new_grid, grid); + name = a_name; + type = a_type; }; diff --git a/error.h b/boundarycondition.h similarity index 81% copy from error.h copy to boundarycondition.h index 6a271af..215aa3a 100644 --- a/error.h +++ b/boundarycondition.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + @@ -20,31 +20,28 @@ // + + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // -#ifndef error_H -#define error_H +#ifndef boundarycondition_H +#define boundarycondition_H -class Error; +class BoundaryCondition; #include -class Error +class BoundaryCondition { -public: // types - - enum error_t { ExitProgram, ExitOperation, CancelOperation }; +private: // attributes + + QString name; + QString type; public: // methods - Error(); - void setType(error_t a_type); - void setText(QString a_text); - void display(); + BoundaryCondition(); + BoundaryCondition(QString a_name, QString a_type); -private: // attributes - - error_t type; - QString text; + QString getName() { return name; }; + QString getType() { return type; }; }; diff --git a/celllayeriterator.cpp b/celllayeriterator.cpp index 3944cae..f4e88f5 100644 --- a/celllayeriterator.cpp +++ b/celllayeriterator.cpp @@ -1,3 +1,25 @@ +// +// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// + + +// + This file is part of enGrid. + +// + + +// + Copyright 2008,2009 Oliver Gloth + +// + + +// + enGrid is free software: you can redistribute it and/or modify + +// + it under the terms of the GNU General Public License as published by + +// + the Free Software Foundation, either version 3 of the License, or + +// + (at your option) any later version. + +// + + +// + enGrid is distributed in the hope that it will be useful, + +// + but WITHOUT ANY WARRANTY; without even the implied warranty of + +// + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + +// + GNU General Public License for more details. + +// + + +// + You should have received a copy of the GNU General Public License + +// + along with enGrid. If not, see . + +// + + +// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// // // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/celllayeriterator.h b/celllayeriterator.h index 9f1c156..abe2e3b 100644 --- a/celllayeriterator.h +++ b/celllayeriterator.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/cellneighbouriterator.cpp b/cellneighbouriterator.cpp index 72504f1..c09fc19 100644 --- a/cellneighbouriterator.cpp +++ b/cellneighbouriterator.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/cellneighbouriterator.h b/cellneighbouriterator.h index 33ea4b6..b3a3112 100644 --- a/cellneighbouriterator.h +++ b/cellneighbouriterator.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/containertricks.h b/containertricks.h index cd7f2c4..f578f25 100644 --- a/containertricks.h +++ b/containertricks.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/correctsurfaceorientation.cpp b/correctsurfaceorientation.cpp index b6ece02..a7ccd37 100644 --- a/correctsurfaceorientation.cpp +++ b/correctsurfaceorientation.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/correctsurfaceorientation.h b/correctsurfaceorientation.h index 11f049b..ba9bd10 100644 --- a/correctsurfaceorientation.h +++ b/correctsurfaceorientation.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/createsurfacemesh.cpp b/createsurfacemesh.cpp index 91c27f2..4cd7926 100644 --- a/createsurfacemesh.cpp +++ b/createsurfacemesh.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/createsurfacemesh.h b/createsurfacemesh.h index 9a2af12..8924b56 100644 --- a/createsurfacemesh.h +++ b/createsurfacemesh.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/createvolumemesh.cpp b/createvolumemesh.cpp index 525dd3c..16c5327 100644 --- a/createvolumemesh.cpp +++ b/createvolumemesh.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/createvolumemesh.h b/createvolumemesh.h index f627e61..6fd4e8a 100644 --- a/createvolumemesh.h +++ b/createvolumemesh.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/deletecells.cpp b/deletecells.cpp index ada64dd..52d7380 100644 --- a/deletecells.cpp +++ b/deletecells.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/deletecells.h b/deletecells.h index 31b27e8..0868dfc 100644 --- a/deletecells.h +++ b/deletecells.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/deletepickedcell.cpp b/deletepickedcell.cpp index 1dc53c8..af095c9 100644 --- a/deletepickedcell.cpp +++ b/deletepickedcell.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/deletepickedcell.h b/deletepickedcell.h index 355a1f0..73bdaf4 100644 --- a/deletepickedcell.h +++ b/deletepickedcell.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/deletetetras.cpp b/deletetetras.cpp index 4db9aab..cdc3312 100644 --- a/deletetetras.cpp +++ b/deletetetras.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/deletetetras.h b/deletetetras.h index 8a49ef9..2af1dca 100644 --- a/deletetetras.h +++ b/deletetetras.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/deletevolumegrid.cpp b/deletevolumegrid.cpp index fd0f97e..7e94664 100644 --- a/deletevolumegrid.cpp +++ b/deletevolumegrid.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/deletevolumegrid.h b/deletevolumegrid.h index 1336c13..b9511e6 100644 --- a/deletevolumegrid.h +++ b/deletevolumegrid.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/dialogoperation.h b/dialogoperation.h index 79355d6..ff5cdc4 100644 --- a/dialogoperation.h +++ b/dialogoperation.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/egvtkobject.cpp b/egvtkobject.cpp index 838184d..74d9cdc 100644 --- a/egvtkobject.cpp +++ b/egvtkobject.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/egvtkobject.h b/egvtkobject.h index 1ba1c86..0dc93a5 100644 --- a/egvtkobject.h +++ b/egvtkobject.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/elements.cpp b/elements.cpp index 7a5272b..975758f 100644 --- a/elements.cpp +++ b/elements.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/elements.h b/elements.h index f233e27..0016ff3 100644 --- a/elements.h +++ b/elements.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/engrid.h b/engrid.h index 7267109..7278974 100644 --- a/engrid.h +++ b/engrid.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + @@ -207,4 +207,6 @@ inline double sqr(double x) { return x*x; }; #define LINE "========================================================================" << endl; +#define USE(X) X=X + #endif diff --git a/engrid.kdevelop b/engrid.kdevelop index 99e123e..f1e1078 100644 --- a/engrid.kdevelop +++ b/engrid.kdevelop @@ -78,6 +78,7 @@ true false false + false false @@ -165,8 +166,8 @@ true - false - 1 + true + 2 false 0 @@ -181,6 +182,9 @@ 2 false true + false + true + true diff --git a/engrid.pro b/engrid.pro index b9c93e8..baad11a 100644 --- a/engrid.pro +++ b/engrid.pro @@ -1,8 +1,8 @@ -TEMPLATE = app -LANGUAGE = C++ +TEMPLATE = app +LANGUAGE = C++ -CONFIG += qt release thread -#CONFIG += qt debug thread +#CONFIG += qt release thread +CONFIG += qt debug thread QT += xml network opengl LIBS += -lvtkCommon @@ -17,41 +17,41 @@ LIBS += -lng #DEFINES += QT_NO_DEBUG !win32 { - LIBS += -L./netgen_svn - LIBS += -L$(VTKDIR)/lib/$(VTKVERSION) - LIBS += -L$(VTKDIR)/lib/vtk-5.2 - LIBS += -Wl,-rpath - QMAKE_CXXFLAGS += -Wno-deprecated - INCLUDEPATH += $(VTKDIR)/include/$(VTKVERSION) - INCLUDEPATH += ./netgen_svn/netgen-mesher/netgen/nglib - INCLUDEPATH += ./netgen_svn/netgen-mesher/netgen/libsrc/general + LIBS += -L./netgen_svn + LIBS += -L$(VTKDIR)/lib/$(VTKVERSION) + LIBS += -L$(VTKDIR)/lib/vtk-5.2 + LIBS += -Wl,-rpath + QMAKE_CXXFLAGS += -Wno-deprecated + INCLUDEPATH += $(VTKDIR)/include/$(VTKVERSION) + INCLUDEPATH += ./netgen_svn/netgen-mesher/netgen/nglib + INCLUDEPATH += ./netgen_svn/netgen-mesher/netgen/libsrc/general } win32 { - VTK_DIR = C:\VTK - VTK_SRCDIR = C:\VTK\5.0.4 - LIBS += -L$$VTK_DIR\bin\release - LIBS += -lvtkRendering - LIBS += -lvtkFiltering - LIBS += -lvtkIO - LIBS += -lvtkfreetype - LIBS += -lvtkftgl - LIBS += -lvtkexpat - LIBS += -lvtkzlib - INCLUDEPATH += $$VTK_SRCDIR\COMMON - INCLUDEPATH += $$VTK_SRCDIR\FILTER~1 - INCLUDEPATH += $$VTK_SRCDIR\GUISUP~1\QT - INCLUDEPATH += $$VTK_SRCDIR\GENERI~1 - INCLUDEPATH += $$VTK_SRCDIR\GRAPHICS - INCLUDEPATH += $$VTK_SRCDIR\HYBRID - INCLUDEPATH += $$VTK_SRCDIR\IMAGING - INCLUDEPATH += $$VTK_SRCDIR\IO - INCLUDEPATH += $$VTK_SRCDIR\RENDER~1 - INCLUDEPATH += $$VTK_DIR - INCLUDEPATH += netgen_cvs\netgen\libsrc\interface - INCLUDEPATH += netgen_cvs\netgen\libsrc\general - LIBS += -Lnetgen_cvs\release - DEFINES += _USE_MATH_DEFINES + VTK_DIR = C:\VTK + VTK_SRCDIR = C:\VTK\5.0.4 + LIBS += -L$$VTK_DIR\bin\release + LIBS += -lvtkRendering + LIBS += -lvtkFiltering + LIBS += -lvtkIO + LIBS += -lvtkfreetype + LIBS += -lvtkftgl + LIBS += -lvtkexpat + LIBS += -lvtkzlib + INCLUDEPATH += $$VTK_SRCDIR\COMMON + INCLUDEPATH += $$VTK_SRCDIR\FILTER~1 + INCLUDEPATH += $$VTK_SRCDIR\GUISUP~1\QT + INCLUDEPATH += $$VTK_SRCDIR\GENERI~1 + INCLUDEPATH += $$VTK_SRCDIR\GRAPHICS + INCLUDEPATH += $$VTK_SRCDIR\HYBRID + INCLUDEPATH += $$VTK_SRCDIR\IMAGING + INCLUDEPATH += $$VTK_SRCDIR\IO + INCLUDEPATH += $$VTK_SRCDIR\RENDER~1 + INCLUDEPATH += $$VTK_DIR + INCLUDEPATH += netgen_cvs\netgen\libsrc\interface + INCLUDEPATH += netgen_cvs\netgen\libsrc\general + LIBS += -Lnetgen_cvs\release + DEFINES += _USE_MATH_DEFINES } @@ -62,6 +62,7 @@ INCLUDEPATH += ./nglib HEADERS = \ \ +boundarycondition.h \ celllayeriterator.h \ cellneighbouriterator.h \ containertricks.h \ @@ -121,11 +122,13 @@ guinormalextrusion.h \ guiselectboundarycodes.h \ guisetboundarycode.h \ guismoothsurface.h \ + \ + guieditboundaryconditions.h - -SOURCES = \ +SOURCES = \ main.cpp \ \ +boundarycondition.cpp \ celllayeriterator.cpp \ cellneighbouriterator.cpp \ correctsurfaceorientation.cpp \ @@ -177,12 +180,14 @@ guinormalextrusion.cpp \ guiselectboundarycodes.cpp \ guisetboundarycode.cpp \ guismoothsurface.cpp \ - + \ + guieditboundaryconditions.cpp FORMS = \ guicreateboundarylayer.ui \ guideletebadaspecttris.ui \ guidivideboundarylayer.ui \ +guieditboundaryconditions.ui \ guimainwindow.ui \ guiimproveaspectratio.ui \ guinormalextrusion.ui \ @@ -193,4 +198,3 @@ guismoothsurface.ui \ - diff --git a/error.cpp b/error.cpp index dbfb126..39e743b 100644 --- a/error.cpp +++ b/error.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/error.h b/error.h index 6a271af..30ec347 100644 --- a/error.h +++ b/error.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/fixstl.cpp b/fixstl.cpp index 2407f70..511b4eb 100755 --- a/fixstl.cpp +++ b/fixstl.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/fixstl.h b/fixstl.h index d08d61f..1f16c9f 100755 --- a/fixstl.h +++ b/fixstl.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/layeriterator.cpp b/fluentreader.cpp similarity index 90% copy from layeriterator.cpp copy to fluentreader.cpp index 3325016..9691044 100644 --- a/layeriterator.cpp +++ b/fluentreader.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + @@ -20,11 +20,8 @@ // + + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // -#include "layeriterator.h" +#include "fluentreader.h" -LayerIterator::LayerIterator() +void FluentReader::operate() { - volume_iteration = true; }; - - diff --git a/fluentreader.h b/fluentreader.h index cea8ed0..7cc85cf 100644 --- a/fluentreader.h +++ b/fluentreader.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/deletepickedcell.cpp b/foamreader.cpp similarity index 82% copy from deletepickedcell.cpp copy to foamreader.cpp index 1dc53c8..acbbe93 100644 --- a/deletepickedcell.cpp +++ b/foamreader.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + @@ -20,11 +20,21 @@ // + + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +#include "foamreader.h" -#include "deletepickedcell.h" +FoamReader::FoamReader() +{ + setFormat("Foam boundary files(boundary)"); + setExtension(""); +}; -void DeletePickedCell::operate() +void FoamReader::operate() { - EG_VTKSP(vtkUnstructuredGrid, new_grid); - makeCopy(new_grid, grid); + try { + readInputFileName(); + if (isValid()) { + }; + } catch (Error err) { + err.display(); + }; }; diff --git a/foamreader.h b/foamreader.h index a969f66..193a0fd 100644 --- a/foamreader.h +++ b/foamreader.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/foamwriter.cpp b/foamwriter.cpp index 38136e9..1438ba8 100644 --- a/foamwriter.cpp +++ b/foamwriter.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/foamwriter.h b/foamwriter.h index 737f9d8..c824a4a 100644 --- a/foamwriter.h +++ b/foamwriter.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/geometrytools.cpp b/geometrytools.cpp index d5394d0..de6c547 100644 --- a/geometrytools.cpp +++ b/geometrytools.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/geometrytools.h b/geometrytools.h index ca40831..b21a8f6 100644 --- a/geometrytools.h +++ b/geometrytools.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/gmshiooperation.cpp b/gmshiooperation.cpp index 099c7b6..c21a8a3 100644 --- a/gmshiooperation.cpp +++ b/gmshiooperation.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/gmshiooperation.h b/gmshiooperation.h index 45b39f3..de4bb3b 100644 --- a/gmshiooperation.h +++ b/gmshiooperation.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/gmshreader.cpp b/gmshreader.cpp index 5585317..af4d2a3 100644 --- a/gmshreader.cpp +++ b/gmshreader.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/gmshreader.h b/gmshreader.h index 508bf93..ec7c0dd 100644 --- a/gmshreader.h +++ b/gmshreader.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/gmshwriter.cpp b/gmshwriter.cpp index b1ab0d1..c03b06f 100644 --- a/gmshwriter.cpp +++ b/gmshwriter.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/gmshwriter.h b/gmshwriter.h index aef5e98..079d96a 100644 --- a/gmshwriter.h +++ b/gmshwriter.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/gridsmoother.cpp b/gridsmoother.cpp index 9639479..15901a8 100644 --- a/gridsmoother.cpp +++ b/gridsmoother.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + @@ -47,11 +47,11 @@ GridSmoother::GridSmoother() w_A = 5.0; w_skew = 0.0; w_orth = 0.0; - w_sharp1 = 4.0;// 0.5 points + w_sharp1 = 8.0;//4// 0.5 points e_sharp1 = 1.3; w_sharp2 = 3.0; e_sharp2 = 1.3; - H = 2.5; + H = 1.5;//2.5 }; void GridSmoother::markNodes() @@ -252,7 +252,6 @@ double GridSmoother::func(vec3_t x) double f = 0; double f13 = 1.0/3.0; double f14 = 0.25; - double sr2 = sqrt(2.0); vec3_t n_node(1,0,0); QList n_pri; @@ -334,22 +333,23 @@ double GridSmoother::func(vec3_t x) double h0 = v0*n_face[0]; double h1 = v1*n_face[0]; double h2 = v2*n_face[0]; - if (h0 > 0.0*L) h0 = max(v0.abs(),h0); - if (h1 > 0.0*L) h1 = max(v1.abs(),h1); - if (h2 > 0.0*L) h2 = max(v2.abs(),h2); - /* - double h0 = v0.abs(); - double h1 = v1.abs(); - double h2 = v2.abs(); - */ + if (h0 > 0.5*L) h0 = max(v0.abs(),h0); + if (h1 > 0.5*L) h1 = max(v1.abs(),h1); + if (h2 > 0.5*L) h2 = max(v2.abs(),h2); + { + double e1 = errThickness(h0/L); double e2 = errThickness(h1/L); double e3 = errThickness(h2/L); - f += w_h*f13*e1; - f += w_h*f13*e2; - f += w_h*f13*e3; - err_pria->SetValue(id_cell,f13*(e1+e2+e3)); + double e = max(e1,max(e2,e3)); + //f += w_h*f13*e1; + //f += w_h*f13*e2; + //f += w_h*f13*e3; + //err_pria->SetValue(id_cell,f13*(e1+e2+e3)); + + f += w_h*e; + err_pria->SetValue(id_cell,0); }; if ((h0 > 0.01*L) && (h1 > 0.01*L) && (h2 > 0.01*L)) { v0.normalise(); @@ -424,7 +424,6 @@ double GridSmoother::func(vec3_t x) grid->GetPoints()->SetPoint(nodes[i_nodes_opt], x_old.data()); n_node.normalise(); { - double w = w_sharp1/n_pri.size(); double f_sharp1 = 0; foreach (vec3_t n, n_pri) { f_sharp1 += pow(fabs(1-n_node*n), e_sharp1); @@ -655,4 +654,4 @@ double GridSmoother::improvement() { double f_old = max(1e-10,F_old); return 1-F_new/f_old; -}; \ No newline at end of file +}; diff --git a/gridsmoother.h b/gridsmoother.h index 6ea8e25..83e9f37 100644 --- a/gridsmoother.h +++ b/gridsmoother.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/guicreateboundarylayer.cpp b/guicreateboundarylayer.cpp index 3380f21..9654489 100644 --- a/guicreateboundarylayer.cpp +++ b/guicreateboundarylayer.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/guicreateboundarylayer.h b/guicreateboundarylayer.h index aa755db..01df8ee 100644 --- a/guicreateboundarylayer.h +++ b/guicreateboundarylayer.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/guideletebadaspecttris.cpp b/guideletebadaspecttris.cpp index c539bde..2c0e00b 100644 --- a/guideletebadaspecttris.cpp +++ b/guideletebadaspecttris.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/guideletebadaspecttris.h b/guideletebadaspecttris.h index ad8f308..614af95 100644 --- a/guideletebadaspecttris.h +++ b/guideletebadaspecttris.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/guidivideboundarylayer.cpp b/guidivideboundarylayer.cpp index d60d8dd..8fe6eb0 100644 --- a/guidivideboundarylayer.cpp +++ b/guidivideboundarylayer.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/guidivideboundarylayer.h b/guidivideboundarylayer.h index 112fc11..c8dcea2 100644 --- a/guidivideboundarylayer.h +++ b/guidivideboundarylayer.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/iterator.cpp b/guieditboundaryconditions.cpp similarity index 55% copy from iterator.cpp copy to guieditboundaryconditions.cpp index 6db0ffd..9fcc8b2 100644 --- a/iterator.cpp +++ b/guieditboundaryconditions.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + @@ -20,36 +20,42 @@ // + + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // -#include "iterator.h" +#include "guieditboundaryconditions.h" -Iterator::Iterator() +GuiEditBoundaryConditions::GuiEditBoundaryConditions() { - custom_iteration = false; - volume_iteration = false; + bcmap = NULL; }; -void Iterator::pass1() +void GuiEditBoundaryConditions::before() { - for (int i = 0; i < pair.size(); ++i) { - pair[i].terminate = false; + if (!bcmap) EG_BUG; + while (ui.T->rowCount()) ui.T->removeRow(0); + foreach (int i, boundary_codes) { + BoundaryCondition bc = (*bcmap)[i]; + ui.T->insertRow(ui.T->rowCount()); + int r = ui.T->rowCount()-1; + ui.T->setItem(r,0,new QTableWidgetItem()); + ui.T->item(r,0)->setFlags(ui.T->item(r,0)->flags() & (~Qt::ItemIsSelectable)); + ui.T->item(r,0)->setFlags(ui.T->item(r,0)->flags() & (~Qt::ItemIsEditable)); + ui.T->setItem(r,1,new QTableWidgetItem()); + ui.T->setItem(r,2,new QTableWidgetItem()); + QString idx; + idx.setNum(i); + ui.T->item(r,0)->setText(idx); + QString name = bc.getName(); + if (name == "unknown") name = QString("BC") + idx; + ui.T->item(r,1)->setText(name); + ui.T->item(r,2)->setText(bc.getType()); }; + }; -void Iterator::getCells() +void GuiEditBoundaryConditions::operate() { - if (!custom_iteration) { - if (volume_iteration) { - getAllVolumeCells(cells, grid); - } else { - getAllSurfaceCells(cells, grid); - }; + for (int i = 0; i < ui.T->rowCount(); ++i) { + BoundaryCondition bc(ui.T->item(i,1)->text(),ui.T->item(i,2)->text()); + (*bcmap)[ui.T->item(i,0)->text().toInt()] = bc; }; - getNodesFromCells(cells, nodes, grid); - createCellMapping(cells, _cells, grid); - createNodeMapping(nodes, _nodes, grid); - createNodeToCell(cells, nodes, _nodes, n2c, grid); - createNodeToNode(cells, nodes, _nodes, n2n, grid); - createCellToCell(cells, c2c, grid); }; - diff --git a/guiselectboundarycodes.h b/guieditboundaryconditions.h similarity index 76% copy from guiselectboundarycodes.h copy to guieditboundaryconditions.h index 98a4030..48b45c9 100644 --- a/guiselectboundarycodes.h +++ b/guieditboundaryconditions.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + @@ -20,36 +20,34 @@ // + + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // -#ifndef guiselectboundarycodes_H -#define guiselectboundarycodes_H +#ifndef guieditboundaryconditions_H +#define guieditboundaryconditions_H -#include "ui_guiselectboundarycodes.h" +class GuiEditBoundaryConditions; + +#include "boundarycondition.h" #include "dialogoperation.h" +#include "ui_guieditboundaryconditions.h" -class GuiSelectBoundaryCodes : public DialogOperation +class GuiEditBoundaryConditions : public DialogOperation { Q_OBJECT; private: // attributes - QSet display_boundary_codes; - -private slots: - - void selectAll(); - void deselectAll(); + QMap *bcmap; protected: // methods - virtual void before(); virtual void operate(); -public: +public: // methods + + GuiEditBoundaryConditions(); - GuiSelectBoundaryCodes(); - void setDisplayBoundaryCodes(const QSet &bcs); - void getSelectedBoundaryCodes(QSet &bcs); + virtual void before(); + void setMap(QMap *a_bcmap) { bcmap = a_bcmap; }; }; diff --git a/guieditboundaryconditions.ui b/guieditboundaryconditions.ui new file mode 100644 index 0000000..790e207 --- /dev/null +++ b/guieditboundaryconditions.ui @@ -0,0 +1,118 @@ + + GuiEditBoundaryConditions + + + Qt::NonModal + + + + 0 + 0 + 577 + 457 + + + + edit boundary conditions + + + + :/icons/resources/icons/G.png:/icons/resources/icons/G.png + + + + + + + BC-index + + + + + BC-name + + + + + BC-type + + + + + + + + 6 + + + 0 + + + + + Qt::Horizontal + + + + 131 + 31 + + + + + + + + OK + + + + + + + Cancel + + + + + + + + + + + + + okButton + clicked() + GuiEditBoundaryConditions + accept() + + + 278 + 253 + + + 96 + 254 + + + + + cancelButton + clicked() + GuiEditBoundaryConditions + reject() + + + 369 + 253 + + + 179 + 282 + + + + + diff --git a/guiimproveaspectratio.cpp b/guiimproveaspectratio.cpp index 16eed17..60e08fd 100644 --- a/guiimproveaspectratio.cpp +++ b/guiimproveaspectratio.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/guiimproveaspectratio.h b/guiimproveaspectratio.h index 5feef92..5fa3b0e 100644 --- a/guiimproveaspectratio.h +++ b/guiimproveaspectratio.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/guimainwindow.cpp b/guimainwindow.cpp index 6427165..8488947 100644 --- a/guimainwindow.cpp +++ b/guimainwindow.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + @@ -33,6 +33,7 @@ #include "neutralwriter.h" #include "stlwriter.h" #include "correctsurfaceorientation.h" +#include "guieditboundaryconditions.h" #include #include @@ -66,27 +67,28 @@ GuiMainWindow::GuiMainWindow() : QMainWindow(NULL) addDockWidget(Qt::LeftDockWidgetArea, dock_widget); ui.menuView->addAction(dock_widget->toggleViewAction()); - connect(ui.actionImportSTL, SIGNAL(activated()), this, SLOT(importSTL())); - connect(ui.actionImportGmsh1Ascii, SIGNAL(activated()), this, SLOT(importGmsh1Ascii())); - connect(ui.actionImportGmsh2Ascii, SIGNAL(activated()), this, SLOT(importGmsh2Ascii())); - connect(ui.actionExportGmsh1Ascii, SIGNAL(activated()), this, SLOT(exportGmsh1Ascii())); - connect(ui.actionExportGmsh2Ascii, SIGNAL(activated()), this, SLOT(exportGmsh2Ascii())); - connect(ui.actionExportNeutral, SIGNAL(activated()), this, SLOT(exportNeutral())); - connect(ui.actionExportAsciiStl, SIGNAL(activated()), this, SLOT(exportAsciiStl())); - connect(ui.actionExportBinaryStl, SIGNAL(activated()), this, SLOT(exportBinaryStl())); - connect(ui.actionExit, SIGNAL(activated()), this, SLOT(exit())); - connect(ui.actionZoomAll, SIGNAL(activated()), this, SLOT(zoomAll())); - connect(ui.actionOpen, SIGNAL(activated()), this, SLOT(open())); - connect(ui.actionSave, SIGNAL(activated()), this, SLOT(save())); - connect(ui.actionSaveAs, SIGNAL(activated()), this, SLOT(saveAs())); - connect(ui.actionBoundaryCodes, SIGNAL(activated()), this, SLOT(selectBoundaryCodes())); - connect(ui.actionNormalExtrusion, SIGNAL(activated()), this, SLOT(normalExtrusion())); - connect(ui.actionViewAxes, SIGNAL(changed()), this, SLOT(setAxesVisibility())); - connect(ui.actionChangeOrientation, SIGNAL(activated()), this, SLOT(changeSurfaceOrientation())); - connect(ui.actionCheckOrientation, SIGNAL(activated()), this, SLOT(checkSurfaceOrientation())); - connect(ui.actionImproveAspectRatio, SIGNAL(activated()), this, SLOT(improveAspectRatio())); - connect(ui.actionRedraw, SIGNAL(activated()), this, SLOT(updateActors())); - connect(ui.actionClearOutputWindow, SIGNAL(activated()), this, SLOT(clearOutput())); + connect(ui.actionImportSTL, SIGNAL(activated()), this, SLOT(importSTL())); + connect(ui.actionImportGmsh1Ascii, SIGNAL(activated()), this, SLOT(importGmsh1Ascii())); + connect(ui.actionImportGmsh2Ascii, SIGNAL(activated()), this, SLOT(importGmsh2Ascii())); + connect(ui.actionExportGmsh1Ascii, SIGNAL(activated()), this, SLOT(exportGmsh1Ascii())); + connect(ui.actionExportGmsh2Ascii, SIGNAL(activated()), this, SLOT(exportGmsh2Ascii())); + connect(ui.actionExportNeutral, SIGNAL(activated()), this, SLOT(exportNeutral())); + connect(ui.actionExportAsciiStl, SIGNAL(activated()), this, SLOT(exportAsciiStl())); + connect(ui.actionExportBinaryStl, SIGNAL(activated()), this, SLOT(exportBinaryStl())); + connect(ui.actionExit, SIGNAL(activated()), this, SLOT(exit())); + connect(ui.actionZoomAll, SIGNAL(activated()), this, SLOT(zoomAll())); + connect(ui.actionOpen, SIGNAL(activated()), this, SLOT(open())); + connect(ui.actionSave, SIGNAL(activated()), this, SLOT(save())); + connect(ui.actionSaveAs, SIGNAL(activated()), this, SLOT(saveAs())); + connect(ui.actionBoundaryCodes, SIGNAL(activated()), this, SLOT(selectBoundaryCodes())); + connect(ui.actionNormalExtrusion, SIGNAL(activated()), this, SLOT(normalExtrusion())); + connect(ui.actionViewAxes, SIGNAL(changed()), this, SLOT(setAxesVisibility())); + connect(ui.actionChangeOrientation, SIGNAL(activated()), this, SLOT(changeSurfaceOrientation())); + connect(ui.actionCheckOrientation, SIGNAL(activated()), this, SLOT(checkSurfaceOrientation())); + connect(ui.actionImproveAspectRatio, SIGNAL(activated()), this, SLOT(improveAspectRatio())); + connect(ui.actionRedraw, SIGNAL(activated()), this, SLOT(updateActors())); + connect(ui.actionClearOutputWindow, SIGNAL(activated()), this, SLOT(clearOutput())); + connect(ui.actionEditBoundaryConditions, SIGNAL(activated()), this, SLOT(editBoundaryConditions())); connect(ui.actionViewXP, SIGNAL(activated()), this, SLOT(viewXP())); connect(ui.actionViewXM, SIGNAL(activated()), this, SLOT(viewXM())); @@ -114,6 +116,8 @@ GuiMainWindow::GuiMainWindow() : QMainWindow(NULL) surface_mapper = vtkPolyDataMapper::New(); surface_wire_mapper = vtkPolyDataMapper::New(); + backface_property = vtkProperty::New(); + tetra_actor = NULL; pyramid_actor = NULL; wedge_actor = NULL; @@ -342,9 +346,13 @@ void GuiMainWindow::updateActors() surface_mapper->SetInput(boundary_pd); surface_wire_mapper->SetInput(boundary_pd); surface_actor = vtkActor::New(); + surface_actor->GetProperty()->SetRepresentationToSurface(); + surface_actor->GetProperty()->SetColor(0,1,0); + surface_actor->SetBackfaceProperty(backface_property); + surface_actor->GetBackfaceProperty()->SetColor(1,0,0); surface_wire_actor = vtkActor::New(); surface_wire_actor->GetProperty()->SetRepresentationToWireframe(); - surface_wire_actor->GetProperty()->SetColor(1,0,0); + surface_wire_actor->GetProperty()->SetColor(0,0,1); surface_actor->SetMapper(surface_mapper); surface_wire_actor->SetMapper(surface_wire_mapper); getRenderer()->AddActor(surface_actor); @@ -572,6 +580,7 @@ void GuiMainWindow::open() grid->DeepCopy(vtu->GetOutput()); createBasicFields(grid, grid->GetNumberOfCells(), grid->GetNumberOfPoints(), false); setWindowTitle(current_filename + " - enGrid"); + openBC(); updateBoundaryCodes(true); updateActors(); updateStatusBar(); @@ -587,6 +596,35 @@ void GuiMainWindow::redo() { }; +void GuiMainWindow::openBC() +{ + QString bc_file = current_filename + ".bcs"; + QFile file(bc_file); + bcmap.clear(); + if (file.exists()) { + file.open(QIODevice::ReadOnly | QIODevice::Text); + QTextStream f(&file); + while (!f.atEnd()) { + QString name, type; + int i; + f >> i >> name >> type; + bcmap[i] = BoundaryCondition(name,type); + }; + }; +}; + +void GuiMainWindow::saveBC() +{ + QString bc_file = current_filename + ".bcs"; + QFile file(bc_file); + file.open(QIODevice::WriteOnly | QIODevice::Text); + QTextStream f(&file); + foreach(int i, all_boundary_codes) { + BoundaryCondition bc = bcmap[i]; + f << i << " " << bc.getName() << " " << bc.getType() << "\n"; + }; +}; + void GuiMainWindow::save() { cout << current_filename.toAscii().data() << endl; @@ -604,6 +642,7 @@ void GuiMainWindow::save() vtu->SetDataModeToBinary(); vtu->SetInput(grid); vtu->Write(); + saveBC(); }; }; @@ -634,6 +673,7 @@ void GuiMainWindow::saveAs() vtu->SetDataModeToBinary(); vtu->SetInput(grid); vtu->Write(); + saveBC(); setWindowTitle(current_filename + " - enGrid"); }; }; @@ -943,3 +983,11 @@ void GuiMainWindow::callFixSTL() updateBoundaryCodes(false); updateActors(); }; + +void GuiMainWindow::editBoundaryConditions() +{ + GuiEditBoundaryConditions editbcs; + editbcs.setBoundaryCodes(all_boundary_codes); + editbcs.setMap(&bcmap); + editbcs(); +}; diff --git a/guimainwindow.h b/guimainwindow.h index 20fa944..1a4093a 100644 --- a/guimainwindow.h +++ b/guimainwindow.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + @@ -47,6 +47,7 @@ class GuiMainWindow; #include "vtkEgBoundaryCodesFilter.h" #include "vtkEgExtractVolumeCells.h" #include "egvtkobject.h" +#include "boundarycondition.h" #include "std_includes.h" @@ -104,6 +105,7 @@ private: // attributes vtkActor *pyramid_actor; vtkActor *hexa_actor; vtkActor *volume_wire_actor; + vtkProperty *backface_property; vtkPolyDataMapper *surface_mapper; vtkPolyDataMapper *surface_wire_mapper; @@ -155,7 +157,7 @@ private: // attributes /** A QList with all boundary codes. */ QSet all_boundary_codes; -/** VTK filter to extract boundary elements with certain codes */ + /** VTK filter to extract boundary elements with certain codes */ vtkEgBoundaryCodesFilter *bcodes_filter; /** VTK picker to pick cells for various user interactions */ @@ -177,6 +179,9 @@ private: // attributes GuiOutputWindow *output_window; QDockWidget *dock_widget; + /** mapping between numerical and symbolic boundary codes */ + QMap bcmap; + private: // static attributes /** @@ -306,6 +311,9 @@ public slots: /** Open an existing grid */ void open(); + void openBC(); + void saveBC(); + void undo(); void redo(); @@ -345,6 +353,9 @@ public slots: /** Write surface elements to a binary STL file. */ void exportBinaryStl(); + /** Edit boundary conditions (names and types) */ + void editBoundaryConditions(); + void viewXP(); void viewXM(); void viewYP(); diff --git a/guimainwindow.ui b/guimainwindow.ui index 0a28168..61d9992 100644 --- a/guimainwindow.ui +++ b/guimainwindow.ui @@ -423,6 +423,7 @@ + @@ -824,6 +825,11 @@ fix surface triangulation + + + edit boundary conditions + + diff --git a/guinormalextrusion.cpp b/guinormalextrusion.cpp index 1d8e343..d058018 100644 --- a/guinormalextrusion.cpp +++ b/guinormalextrusion.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/guinormalextrusion.h b/guinormalextrusion.h index 8fe32f3..1f0955d 100644 --- a/guinormalextrusion.h +++ b/guinormalextrusion.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/guiselectboundarycodes.cpp b/guiselectboundarycodes.cpp index 0ebe402..0513248 100644 --- a/guiselectboundarycodes.cpp +++ b/guiselectboundarycodes.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/guiselectboundarycodes.h b/guiselectboundarycodes.h index 98a4030..2fed390 100644 --- a/guiselectboundarycodes.h +++ b/guiselectboundarycodes.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/guisetboundarycode.cpp b/guisetboundarycode.cpp index a60f977..8e04238 100644 --- a/guisetboundarycode.cpp +++ b/guisetboundarycode.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/guisetboundarycode.h b/guisetboundarycode.h index 6f5bed8..7edb0c7 100644 --- a/guisetboundarycode.h +++ b/guisetboundarycode.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/guismoothsurface.cpp b/guismoothsurface.cpp index 4a28b8a..33c2611 100644 --- a/guismoothsurface.cpp +++ b/guismoothsurface.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/guismoothsurface.h b/guismoothsurface.h index 65dd867..8e38914 100644 --- a/guismoothsurface.h +++ b/guismoothsurface.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/iooperation.cpp b/iooperation.cpp index 577cc55..92f824f 100644 --- a/iooperation.cpp +++ b/iooperation.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/iooperation.h b/iooperation.h index 1a955e4..fecc77a 100644 --- a/iooperation.h +++ b/iooperation.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/iterator.cpp b/iterator.cpp index 6db0ffd..e997ae7 100644 --- a/iterator.cpp +++ b/iterator.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/iterator.h b/iterator.h index c22c71e..ad546ab 100644 --- a/iterator.h +++ b/iterator.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/layeriterator.cpp b/layeriterator.cpp index 3325016..232f17e 100644 --- a/layeriterator.cpp +++ b/layeriterator.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/layeriterator.h b/layeriterator.h index e0a81c0..efd404b 100644 --- a/layeriterator.h +++ b/layeriterator.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/neutralwriter.cpp b/neutralwriter.cpp index faa65a5..32a8a94 100644 --- a/neutralwriter.cpp +++ b/neutralwriter.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/neutralwriter.h b/neutralwriter.h index ff43463..d7be91d 100644 --- a/neutralwriter.h +++ b/neutralwriter.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/nodelayeriterator.cpp b/nodelayeriterator.cpp index 3d5b53c..99178c8 100644 --- a/nodelayeriterator.cpp +++ b/nodelayeriterator.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/nodelayeriterator.h b/nodelayeriterator.h index 31162a7..1675254 100644 --- a/nodelayeriterator.h +++ b/nodelayeriterator.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/operation.cpp b/operation.cpp index 4545ca4..24bbb21 100644 --- a/operation.cpp +++ b/operation.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/operation.h b/operation.h index f20ce77..266e1d1 100644 --- a/operation.h +++ b/operation.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/optimisation.cpp b/optimisation.cpp index 7d6a39c..4f4aa86 100644 --- a/optimisation.cpp +++ b/optimisation.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/optimisation.h b/optimisation.h index bd92226..37f7aab 100644 --- a/optimisation.h +++ b/optimisation.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/stlwriter.cpp b/polydatareader.cpp similarity index 62% copy from stlwriter.cpp copy to polydatareader.cpp index eda2543..6248c22 100644 --- a/stlwriter.cpp +++ b/polydatareader.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + @@ -20,35 +20,37 @@ // + + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // -#include "stlwriter.h" +#include "polydatareader.h" +#include "vtkEgPolyDataToUnstructuredGridFilter.h" -#include -#include -#include +#include -StlWriter::StlWriter() +PolyDataReader::PolyDataReader() { - setFormat("stereolithography files (*.stl *.STL)"); + setFormat("VTK poly data files(*.vtp)"); + setExtension(".vtp"); }; -void StlWriter::operate() +void PolyDataReader::operate() { try { - readOutputFileName(); + readInputFileName(); if (isValid()) { - EG_VTKSP(vtkGeometryFilter, geometry); - geometry->SetInput(grid); - EG_VTKSP(vtkTriangleFilter, triangle); - triangle->SetInput(geometry->GetOutput()); - EG_VTKSP(vtkSTLWriter, write_stl); - write_stl->SetInput(triangle->GetOutput()); - write_stl->SetFileName(getFileName().toAscii().data()); - write_stl->SetFileTypeToASCII(); - write_stl->Write(); + EG_VTKSP(vtkXMLPolyDataReader,vtp); + EG_VTKSP(vtkEgPolyDataToUnstructuredGridFilter,pd2ug); + vtp->SetFileName(getFileName().toAscii().data()); + pd2ug->SetInput(vtp->GetOutput()); + pd2ug->Update(); + grid->DeepCopy(pd2ug->GetOutput()); + createBasicFields(grid, grid->GetNumberOfCells(), grid->GetNumberOfPoints(), false); + UpdateNodeIndex(grid); + UpdateCellIndex(grid); + EG_VTKDCC(vtkIntArray, bc, grid, "cell_code"); + for (vtkIdType id_cell = 0; id_cell < grid->GetNumberOfPoints(); ++id_cell) { + bc->SetValue(id_cell,99); + }; }; } catch (Error err) { err.display(); }; }; - - diff --git a/polydatareader.h b/polydatareader.h index 694ea32..fe553c5 100644 --- a/polydatareader.h +++ b/polydatareader.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/polymesh.cpp b/polymesh.cpp index 5bb3bf9..adfe0bf 100644 --- a/polymesh.cpp +++ b/polymesh.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/polymesh.h b/polymesh.h index 1442df5..cea09c8 100644 --- a/polymesh.h +++ b/polymesh.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + @@ -116,4 +116,4 @@ public: // methods uint qHash(PolyMesh::node_t N); -#endif \ No newline at end of file +#endif diff --git a/seedsimpleprismaticlayer.cpp b/seedsimpleprismaticlayer.cpp index a32abc5..475b59c 100644 --- a/seedsimpleprismaticlayer.cpp +++ b/seedsimpleprismaticlayer.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/seedsimpleprismaticlayer.h b/seedsimpleprismaticlayer.h index f201366..b794da4 100644 --- a/seedsimpleprismaticlayer.h +++ b/seedsimpleprismaticlayer.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/setboundarycode.cpp b/setboundarycode.cpp index da1f8de..bf8968e 100644 --- a/setboundarycode.cpp +++ b/setboundarycode.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/setboundarycode.h b/setboundarycode.h index 6b60e06..1ab1b96 100644 --- a/setboundarycode.h +++ b/setboundarycode.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/sortablevector.h b/sortablevector.h index b949a5a..77571dc 100755 --- a/sortablevector.h +++ b/sortablevector.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + @@ -48,4 +48,4 @@ bool SortableVector::operator<(const SortableVector &V) const EG_BUG; }; -#endif \ No newline at end of file +#endif diff --git a/std_connections.h b/std_connections.h index 8853e91..5d524bb 100644 --- a/std_connections.h +++ b/std_connections.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/std_includes.h b/std_includes.h index 67234ac..a21d0aa 100644 --- a/std_includes.h +++ b/std_includes.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/stlreader.cpp b/stlreader.cpp index 956c73d..a28015c 100644 --- a/stlreader.cpp +++ b/stlreader.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/stlreader.h b/stlreader.h index a5ba2b2..30bba92 100644 --- a/stlreader.h +++ b/stlreader.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/stlwriter.cpp b/stlwriter.cpp index eda2543..ad0ffb2 100644 --- a/stlwriter.cpp +++ b/stlwriter.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/stlwriter.h b/stlwriter.h index c7b506f..6e673ca 100644 --- a/stlwriter.h +++ b/stlwriter.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/swaptriangles.cpp b/swaptriangles.cpp index 30262a0..cd3eefe 100644 --- a/swaptriangles.cpp +++ b/swaptriangles.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/swaptriangles.h b/swaptriangles.h index 4ce19de..a6351d2 100644 --- a/swaptriangles.h +++ b/swaptriangles.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/tvtkoperation.h b/tvtkoperation.h index e66cbff..ee7c743 100644 --- a/tvtkoperation.h +++ b/tvtkoperation.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/uniquevector.h b/uniquevector.h index ca39476..996da30 100755 --- a/uniquevector.h +++ b/uniquevector.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + @@ -60,4 +60,4 @@ bool UniqueVector::operator==(const UniqueVector &V) const return N == QVector::size(); }; -#endif \ No newline at end of file +#endif diff --git a/vtkEgBoundaryCodesFilter.h b/vtkEgBoundaryCodesFilter.h index cde6f6c..6e3ecab 100644 --- a/vtkEgBoundaryCodesFilter.h +++ b/vtkEgBoundaryCodesFilter.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/vtkEgEliminateShortEdges.h b/vtkEgEliminateShortEdges.h index 0ed6af6..4bfdf32 100644 --- a/vtkEgEliminateShortEdges.h +++ b/vtkEgEliminateShortEdges.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/vtkEgExtractVolumeCells.h b/vtkEgExtractVolumeCells.h index 0b7fbfa..6cb10d3 100644 --- a/vtkEgExtractVolumeCells.h +++ b/vtkEgExtractVolumeCells.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/vtkEgGridFilter.h b/vtkEgGridFilter.h index 4266372..3704229 100644 --- a/vtkEgGridFilter.h +++ b/vtkEgGridFilter.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/vtkEgNormalExtrusion.h b/vtkEgNormalExtrusion.h index 6e0fbf3..5d78731 100644 --- a/vtkEgNormalExtrusion.h +++ b/vtkEgNormalExtrusion.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/vtkEgPolyDataToUnstructuredGridFilter.h b/vtkEgPolyDataToUnstructuredGridFilter.h index 5edb515..ec2db4e 100644 --- a/vtkEgPolyDataToUnstructuredGridFilter.h +++ b/vtkEgPolyDataToUnstructuredGridFilter.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + diff --git a/std_includes.h b/vtkreader.cpp similarity index 69% copy from std_includes.h copy to vtkreader.cpp index 67234ac..5c705d6 100644 --- a/std_includes.h +++ b/vtkreader.cpp @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + @@ -20,22 +20,30 @@ // + + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +#include "vtkreader.h" -#include "guismoothsurface.h" -#include "guicreateboundarylayer.h" -#include "guidivideboundarylayer.h" -#include "guisetboundarycode.h" -#include "guideletebadaspecttris.h" +#include -#include "deletevolumegrid.h" -#include "deletetetras.h" -#include "createvolumemesh.h" -#include "gridsmoother.h" -#include "foamreader.h" -#include "vtkreader.h" -#include "polydatareader.h" -#include "foamwriter.h" -#include "deletepickedcell.h" -#include "fixstl.h" +VtkReader::VtkReader() +{ + setFormat("legacy VTK files(*.vtk)"); + setExtension(".vtk"); +}; -// ------------------------------------------- +void VtkReader::operate() +{ + try { + readInputFileName(); + if (isValid()) { + EG_VTKSP(vtkUnstructuredGridReader,vtk); + vtk->SetFileName(getFileName().toAscii().data()); + vtk->Update(); + grid->DeepCopy(vtk->GetOutput()); + createBasicFields(grid, grid->GetNumberOfCells(), grid->GetNumberOfPoints(), false); + UpdateNodeIndex(grid); + UpdateCellIndex(grid); + }; + } catch (Error err) { + err.display(); + }; +}; diff --git a/vtkreader.h b/vtkreader.h index d8d3703..d36b8dc 100644 --- a/vtkreader.h +++ b/vtkreader.h @@ -3,7 +3,7 @@ // + + // + This file is part of enGrid. + // + + -// + Copyright 2008 Oliver Gloth + +// + Copyright 2008,2009 Oliver Gloth + // + + // + enGrid is free software: you can redistribute it and/or modify + // + it under the terms of the GNU General Public License as published by + -- 2.11.4.GIT