swh:1:snp:6088ab52ef49920e01e3f334cdf4d5d6c8a822b9
Raw File
Tip revision: 238939d1f0adab2f8c35e3e838b27908076d3f62 authored by Wenqing Wang on 19 October 2021, 14:34:09 UTC
[Test/GMSH2OGS] Added a test to test the conversion of linear elements
Tip revision: 238939d
GenerateFaceSetMeshes.cpp
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 */

#include "GenerateFaceSetMeshes.h"

#include "MeshLib/Elements/Quad.h"
#include "MeshLib/IO/writeMeshToFile.h"

namespace FileIO
{
namespace Gocad
{
void generateFaceSets(GocadSGridReader const& reader, std::string const& path)
{
    for (std::size_t l(0); l < 128; l++)
    {
        std::unique_ptr<MeshLib::Mesh> face_set(reader.getFaceSetMesh(l));

        if (!face_set)
        {
            continue;
        }
        INFO("Face set mesh created. #nodes: {:d}, #elements: {:d}",
             face_set->getNumberOfNodes(),
             face_set->getNumberOfElements());

        std::string const mesh_out_fname(path + face_set->getName() + ".vtu");
        INFO("Writing face set mesh to '{:s}'.", mesh_out_fname);
        MeshLib::IO::writeMeshToFile(*face_set, mesh_out_fname);
    }
}

}  //  namespace Gocad
}  //  namespace FileIO
back to top