labmec / neopz

An object oriented finite element programming environment
http://www.labmec.org.br
33 stars 11 forks source link

Capability to print a specific geoel to vtk #198

Closed nathanshauer closed 1 year ago

nathanshauer commented 1 year ago

Created a function in TPZGeoEl to print itself in VTK format. It helped me debug and could help others.

Had to move GetVTK_ElType from TPZVTKGeoMesh to TPZGeoEl.

orlandini commented 1 year ago

Nice feature!

What do you think about adding a parameter (possibly with a default value) so that one could choose in which directory to save the file? Something along the lines of

Mesh/pzgeoel.h

    /** @brief Prints the geoel to vtk format with the name geoel_index_#.vtk  */
    void PrintVTK(conts std::string prefix="");

Mesh/pzgeoel.cpp

void TPZGeoEl::PrintVTK(const std::string prefix) {
    std::string filename = prefix+"geoel_index_" + to_string(this->Index()) + ".vtk";

Just an idea, though...

nathanshauer commented 1 year ago

Nice feature!

What do you think about adding a parameter (possibly with a default value) so that one could choose in which directory to save the file? Something along the lines of

Mesh/pzgeoel.h

    /** @brief Prints the geoel to vtk format with the name geoel_index_#.vtk  */
    void PrintVTK(conts std::string prefix="");

Mesh/pzgeoel.cpp

void TPZGeoEl::PrintVTK(const std::string prefix) {
    std::string filename = prefix+"geoel_index_" + to_string(this->Index()) + ".vtk";

Just an idea, though...

I like it! Will implement