From 20c1254f73f0f20f8a627f52a254b95f41fba446 Mon Sep 17 00:00:00 2001 From: Amaury Johnan <amjohnen@gmail.com> Date: Tue, 4 May 2010 11:29:32 +0000 Subject: [PATCH] --- Plugin/AnalyseCurvedMesh.cpp | 49 ++++++++++++++++++++++++++++++++++++ Plugin/AnalyseCurvedMesh.h | 33 ++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 Plugin/AnalyseCurvedMesh.cpp create mode 100644 Plugin/AnalyseCurvedMesh.h diff --git a/Plugin/AnalyseCurvedMesh.cpp b/Plugin/AnalyseCurvedMesh.cpp new file mode 100644 index 0000000000..3230647024 --- /dev/null +++ b/Plugin/AnalyseCurvedMesh.cpp @@ -0,0 +1,49 @@ +// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle +// +// See the LICENSE.txt file for license information. Please report all +// bugs and problems to <gmsh@geuz.org>. +// +// Contributed by Matti Pellikka <matti.pellikka@tut.fi>. + +#include <stdlib.h> +#include "Gmsh.h" +#include "MTriangle.h" +#include "GmshConfig.h" +#include "GModel.h" +#include "polynomialBasis.h" +#include "AnalyseCurvedMesh.h" + + +extern "C" +{ + GMSH_Plugin *GMSH_RegisterAnalyseCurvedMeshPlugin() + { + return new GMSH_AnalyseCurvedMeshPlugin(); + } +} + +std::string GMSH_AnalyseCurvedMeshPlugin::getHelp() const +{ + return "Plugin(AnalyseCurvedMesh) computes AnalyseCurvedMeshs to boundaries in " + "a mesh.\n\n" + "Plugin(AnalyseCurvedMesh) creates a bunch of files."; +} + +PView *GMSH_AnalyseCurvedMeshPlugin::execute(PView *v) +{ + Msg::Info("Hello !"); + + GModel *m = GModel::current(); + + for(GModel::fiter it = m->firstFace(); it != m->lastFace(); it++) { + GFace *f = *it; + Msg::Info("Je suis dans la surface %d", f->tag()); + + for(int i = 0; i < (int) f->triangles.size(); i++) { + MTriangle *t = f->triangles[i]; + const polynomialBasis *p = t->getFunctionSpace(); + Msg::Info("Taille de la matrice P : %dx%d", p->monomials.size1(), p->monomials.size2()); + } + } + return 0; +} diff --git a/Plugin/AnalyseCurvedMesh.h b/Plugin/AnalyseCurvedMesh.h new file mode 100644 index 0000000000..a67da0b067 --- /dev/null +++ b/Plugin/AnalyseCurvedMesh.h @@ -0,0 +1,33 @@ +// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle +// +// See the LICENSE.txt file for license information. Please report all +// bugs and problems to <gmsh@geuz.org>. +// +// Contributed by Matti Pellikka <matti.pellikka@tut.fi>. + +#ifndef _ANALYSECURVEDMESH_H_ +#define _ANALYSECURVEDMESH_H_ + +#include <string> +#include "Plugin.h" + +extern "C" +{ + GMSH_Plugin *GMSH_RegisterAnalyseCurvedMeshPlugin(); +} + +class GMSH_AnalyseCurvedMeshPlugin : public GMSH_PostPlugin +{ + public: + GMSH_AnalyseCurvedMeshPlugin(){} + std::string getName() const { return "AnalyseCurvedMesh"; } + std::string getShortHelp() const + { + return "Check that the curved mesh isn't wretched"; + } + std::string getHelp() const; + std::string getAuthor() const { return "Amaury Johnen"; } + PView *execute(PView *); +}; + +#endif -- GitLab