LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
|
Mesh input (from file) and output (in various formats) facilities. More...
Namespaces | |
namespace | test_utils |
Classes | |
struct | GMshFileV2 |
A representation of a .msh file (V2) in a c++ data structure. More... | |
struct | GMshFileV4 |
A representation of a .msh file (V4) in a c++ data structure. More... | |
class | GmshReader |
Reads a Gmsh *.msh file into a mesh::MeshFactory and provides a link between mesh::Entity objects and the gmsh's physical entities. More... | |
class | VtkFile |
Representation of a VTK file (only relevant) features (advanced usage) More... | |
class | VtkWriter |
Write a mesh along with mesh data into a vtk file. More... | |
Enumerations | |
enum class | TikzOutputCtrl : unsigned int { RenderCells = 1 , CellNumbering = 2 , VerticeNumbering = 4 , NodeNumbering = 8 , EdgeNumbering = 16 , ArrowTips = 32 , WithPreamble = 64 } |
Enum flags: TikzOutputCtrl for output control of mesh drawn in TikZ. More... | |
Functions | |
std::ostream & | operator<< (std::ostream &stream, GMshFileV2::ElementType et) |
Output the element type onto the console: More... | |
std::ostream & | operator<< (std::ostream &stream, const GMshFileV2 &mf) |
For debugging purposes: Write the MshFile into a stream. More... | |
size_type | NumNodes (GMshFileV2::ElementType et) |
Number of nodes that this element type has. More... | |
base::RefEl | RefElOf (GMshFileV2::ElementType et) |
Reference element type of a GmshElementType. More... | |
int | DimOf (GMshFileV2::ElementType et) |
Dimension of the GmshElement type. More... | |
GMshFileV2 | readGmshFileV2 (std::string::const_iterator begin, std::string::const_iterator end, const std::string &version, bool is_binary, int size_t_size, int one, const std::string &filename) |
Read a *.msh file from disk and copy it's contents into the MshFile Datastructure. More... | |
std::ostream & | operator<< (std::ostream &stream, GMshFileV4::ElementType et) |
Output the element type onto a stream: More... | |
int | NumNodes (GMshFileV4::ElementType et) |
Number of nodes that this element type has. More... | |
base::RefEl | RefElOf (GMshFileV4::ElementType et) |
Get the Reference Element type of a GmshElement. More... | |
int | DimOf (GMshFileV4::ElementType et) |
Dimension of the GmshElement type. More... | |
GMshFileV4 | ReadGmshFileV4 (std::string::const_iterator begin, std::string::const_iterator end, const std::string &version, bool is_binary, int size_t_size, int one, const std::string &filename) |
Read a GmshFile with format 4 and return it as an in-memory struct. More... | |
std::variant< GMshFileV2, GMshFileV4 > | ReadGmshFile (const std::string &filename) |
std::ostream & | operator<< (std::ostream &stream, const VtkFile::Format &f) |
void | WriteToFile (const VtkFile &vtk_file, const std::string &filename) |
void | writeMatlab (const lf::mesh::Mesh &mesh, std::string filename) |
Writes affine triangulation data to file in MATLAB format. More... | |
void | writeMatplotlib (const lf::mesh::Mesh &mesh, std::string filename) |
Write affine triangulation data to file in matplotlib format. More... | |
TikzOutputCtrl | operator| (const TikzOutputCtrl &lhs, const TikzOutputCtrl &rhs) |
TikzOutputCtrl | operator& (const TikzOutputCtrl &lhs, const TikzOutputCtrl &rhs) |
bool | writeTikZ (const lf::mesh::Mesh &mesh, const std::string &filename, std::function< bool(const lf::mesh::Entity &)> &&selector, TikzOutputCtrl output_ctrl=TikzOutputCtrl::RenderCells) |
Writes mesh to file in TikZ Graphics format. File as input in LaTeX will draw the mesh. More... | |
bool | writeTikZ (const lf::mesh::Mesh &mesh, const std::string &filename, TikzOutputCtrl output_ctrl=TikzOutputCtrl::RenderCells) |
TikZ output of all entities. More... | |
Mesh input (from file) and output (in various formats) facilities.
|
strong |
Enum flags: TikzOutputCtrl for output control of mesh drawn in TikZ.
Enumerator | |
---|---|
RenderCells | |
CellNumbering | |
VerticeNumbering | |
NodeNumbering | |
EdgeNumbering | |
ArrowTips | |
WithPreamble |
Definition at line 24 of file write_tikz.h.
int lf::io::DimOf | ( | GMshFileV2::ElementType | et | ) |
Dimension of the GmshElement type.
Definition at line 314 of file gmsh_file_v2.cc.
References lf::io::GMshFileV2::EDGE2, lf::io::GMshFileV2::EDGE3, lf::io::GMshFileV2::EDGE4, lf::io::GMshFileV2::EDGE5, lf::io::GMshFileV2::EDGE6, lf::io::GMshFileV2::HEX125, lf::io::GMshFileV2::HEX20, lf::io::GMshFileV2::HEX27, lf::io::GMshFileV2::HEX64, lf::io::GMshFileV2::HEX8, lf::io::GMshFileV2::POINT, lf::io::GMshFileV2::PRISM15, lf::io::GMshFileV2::PRISM18, lf::io::GMshFileV2::PRISM6, lf::io::GMshFileV2::PYRAMID13, lf::io::GMshFileV2::PYRAMID14, lf::io::GMshFileV2::PYRAMID5, lf::io::GMshFileV2::QUAD4, lf::io::GMshFileV2::QUAD8, lf::io::GMshFileV2::QUAD9, lf::io::GMshFileV2::TET10, lf::io::GMshFileV2::TET20, lf::io::GMshFileV2::TET35, lf::io::GMshFileV2::TET4, lf::io::GMshFileV2::TET56, lf::io::GMshFileV2::TRIA10, lf::io::GMshFileV2::TRIA12, lf::io::GMshFileV2::TRIA15, lf::io::GMshFileV2::TRIA15_5, lf::io::GMshFileV2::TRIA21, lf::io::GMshFileV2::TRIA3, lf::io::GMshFileV2::TRIA6, and lf::io::GMshFileV2::TRIA9.
Referenced by lf::io::GmshReader::InitGmshFile().
int lf::io::DimOf | ( | GMshFileV4::ElementType | et | ) |
Dimension of the GmshElement type.
Definition at line 246 of file gmsh_file_v4.cc.
References lf::io::GMshFileV4::EDGE2, lf::io::GMshFileV4::EDGE3, lf::io::GMshFileV4::EDGE4, lf::io::GMshFileV4::EDGE5, lf::io::GMshFileV4::EDGE6, lf::io::GMshFileV4::HEX125, lf::io::GMshFileV4::HEX20, lf::io::GMshFileV4::HEX27, lf::io::GMshFileV4::HEX64, lf::io::GMshFileV4::HEX8, lf::io::GMshFileV4::POINT, lf::io::GMshFileV4::PRISM15, lf::io::GMshFileV4::PRISM18, lf::io::GMshFileV4::PRISM6, lf::io::GMshFileV4::PYRAMID13, lf::io::GMshFileV4::PYRAMID14, lf::io::GMshFileV4::PYRAMID5, lf::io::GMshFileV4::QUAD4, lf::io::GMshFileV4::QUAD8, lf::io::GMshFileV4::QUAD9, lf::io::GMshFileV4::TET10, lf::io::GMshFileV4::TET20, lf::io::GMshFileV4::TET35, lf::io::GMshFileV4::TET4, lf::io::GMshFileV4::TET56, lf::io::GMshFileV4::TRIA10, lf::io::GMshFileV4::TRIA12, lf::io::GMshFileV4::TRIA15, lf::io::GMshFileV4::TRIA15_5, lf::io::GMshFileV4::TRIA21, lf::io::GMshFileV4::TRIA3, lf::io::GMshFileV4::TRIA6, and lf::io::GMshFileV4::TRIA9.
unsigned int lf::io::NumNodes | ( | GMshFileV2::ElementType | et | ) |
Number of nodes that this element type has.
Definition at line 190 of file gmsh_file_v2.cc.
References lf::io::GMshFileV2::EDGE2, lf::io::GMshFileV2::EDGE3, lf::io::GMshFileV2::EDGE4, lf::io::GMshFileV2::EDGE5, lf::io::GMshFileV2::EDGE6, lf::io::GMshFileV2::HEX125, lf::io::GMshFileV2::HEX20, lf::io::GMshFileV2::HEX27, lf::io::GMshFileV2::HEX64, lf::io::GMshFileV2::HEX8, lf::io::GMshFileV2::POINT, lf::io::GMshFileV2::PRISM15, lf::io::GMshFileV2::PRISM18, lf::io::GMshFileV2::PRISM6, lf::io::GMshFileV2::PYRAMID13, lf::io::GMshFileV2::PYRAMID14, lf::io::GMshFileV2::PYRAMID5, lf::io::GMshFileV2::QUAD4, lf::io::GMshFileV2::QUAD8, lf::io::GMshFileV2::QUAD9, lf::io::GMshFileV2::TET10, lf::io::GMshFileV2::TET20, lf::io::GMshFileV2::TET35, lf::io::GMshFileV2::TET4, lf::io::GMshFileV2::TET56, lf::io::GMshFileV2::TRIA10, lf::io::GMshFileV2::TRIA12, lf::io::GMshFileV2::TRIA15, lf::io::GMshFileV2::TRIA15_5, lf::io::GMshFileV2::TRIA21, lf::io::GMshFileV2::TRIA3, lf::io::GMshFileV2::TRIA6, and lf::io::GMshFileV2::TRIA9.
int lf::io::NumNodes | ( | GMshFileV4::ElementType | et | ) |
Number of nodes that this element type has.
Definition at line 122 of file gmsh_file_v4.cc.
References lf::io::GMshFileV4::EDGE2, lf::io::GMshFileV4::EDGE3, lf::io::GMshFileV4::EDGE4, lf::io::GMshFileV4::EDGE5, lf::io::GMshFileV4::EDGE6, lf::io::GMshFileV4::HEX125, lf::io::GMshFileV4::HEX20, lf::io::GMshFileV4::HEX27, lf::io::GMshFileV4::HEX64, lf::io::GMshFileV4::HEX8, lf::io::GMshFileV4::POINT, lf::io::GMshFileV4::PRISM15, lf::io::GMshFileV4::PRISM18, lf::io::GMshFileV4::PRISM6, lf::io::GMshFileV4::PYRAMID13, lf::io::GMshFileV4::PYRAMID14, lf::io::GMshFileV4::PYRAMID5, lf::io::GMshFileV4::QUAD4, lf::io::GMshFileV4::QUAD8, lf::io::GMshFileV4::QUAD9, lf::io::GMshFileV4::TET10, lf::io::GMshFileV4::TET20, lf::io::GMshFileV4::TET35, lf::io::GMshFileV4::TET4, lf::io::GMshFileV4::TET56, lf::io::GMshFileV4::TRIA10, lf::io::GMshFileV4::TRIA12, lf::io::GMshFileV4::TRIA15, lf::io::GMshFileV4::TRIA15_5, lf::io::GMshFileV4::TRIA21, lf::io::GMshFileV4::TRIA3, lf::io::GMshFileV4::TRIA6, and lf::io::GMshFileV4::TRIA9.
TikzOutputCtrl lf::io::operator& | ( | const TikzOutputCtrl & | lhs, |
const TikzOutputCtrl & | rhs | ||
) |
Definition at line 18 of file write_tikz.cc.
std::ostream & lf::io::operator<< | ( | std::ostream & | stream, |
const GMshFileV2 & | mf | ||
) |
For debugging purposes: Write the MshFile into a stream.
Definition at line 146 of file gmsh_file_v2.cc.
References lf::io::GMshFileV2::DoubleSize, lf::io::GMshFileV2::Elements, lf::io::GMshFileV2::IsBinary, lf::io::GMshFileV2::Nodes, lf::io::GMshFileV2::Periodic, lf::io::GMshFileV2::PhysicalEntities, and lf::io::GMshFileV2::VersionNumber.
std::ostream & lf::io::operator<< | ( | std::ostream & | stream, |
const VtkFile::Format & | f | ||
) |
Definition at line 105 of file vtk_writer.cc.
References lf::io::VtkFile::ASCII, and lf::io::VtkFile::BINARY.
std::ostream & lf::io::operator<< | ( | std::ostream & | stream, |
GMshFileV2::ElementType | et | ||
) |
Output the element type onto the console:
Definition at line 38 of file gmsh_file_v2.cc.
References lf::io::GMshFileV2::EDGE2, lf::io::GMshFileV2::EDGE3, lf::io::GMshFileV2::EDGE4, lf::io::GMshFileV2::EDGE5, lf::io::GMshFileV2::EDGE6, lf::io::GMshFileV2::HEX125, lf::io::GMshFileV2::HEX20, lf::io::GMshFileV2::HEX27, lf::io::GMshFileV2::HEX64, lf::io::GMshFileV2::HEX8, lf::io::GMshFileV2::POINT, lf::io::GMshFileV2::PRISM15, lf::io::GMshFileV2::PRISM18, lf::io::GMshFileV2::PRISM6, lf::io::GMshFileV2::PYRAMID13, lf::io::GMshFileV2::PYRAMID14, lf::io::GMshFileV2::PYRAMID5, lf::io::GMshFileV2::QUAD4, lf::io::GMshFileV2::QUAD8, lf::io::GMshFileV2::QUAD9, lf::io::GMshFileV2::TET10, lf::io::GMshFileV2::TET20, lf::io::GMshFileV2::TET35, lf::io::GMshFileV2::TET4, lf::io::GMshFileV2::TET56, lf::io::GMshFileV2::TRIA10, lf::io::GMshFileV2::TRIA12, lf::io::GMshFileV2::TRIA15, lf::io::GMshFileV2::TRIA15_5, lf::io::GMshFileV2::TRIA21, lf::io::GMshFileV2::TRIA3, lf::io::GMshFileV2::TRIA6, and lf::io::GMshFileV2::TRIA9.
std::ostream & lf::io::operator<< | ( | std::ostream & | stream, |
GMshFileV4::ElementType | et | ||
) |
Output the element type onto a stream:
Definition at line 14 of file gmsh_file_v4.cc.
References lf::io::GMshFileV4::EDGE2, lf::io::GMshFileV4::EDGE3, lf::io::GMshFileV4::EDGE4, lf::io::GMshFileV4::EDGE5, lf::io::GMshFileV4::EDGE6, lf::io::GMshFileV4::HEX125, lf::io::GMshFileV4::HEX20, lf::io::GMshFileV4::HEX27, lf::io::GMshFileV4::HEX64, lf::io::GMshFileV4::HEX8, lf::io::GMshFileV4::POINT, lf::io::GMshFileV4::PRISM15, lf::io::GMshFileV4::PRISM18, lf::io::GMshFileV4::PRISM6, lf::io::GMshFileV4::PYRAMID13, lf::io::GMshFileV4::PYRAMID14, lf::io::GMshFileV4::PYRAMID5, lf::io::GMshFileV4::QUAD4, lf::io::GMshFileV4::QUAD8, lf::io::GMshFileV4::QUAD9, lf::io::GMshFileV4::TET10, lf::io::GMshFileV4::TET20, lf::io::GMshFileV4::TET35, lf::io::GMshFileV4::TET4, lf::io::GMshFileV4::TET56, lf::io::GMshFileV4::TRIA10, lf::io::GMshFileV4::TRIA12, lf::io::GMshFileV4::TRIA15, lf::io::GMshFileV4::TRIA15_5, lf::io::GMshFileV4::TRIA21, lf::io::GMshFileV4::TRIA3, lf::io::GMshFileV4::TRIA6, and lf::io::GMshFileV4::TRIA9.
TikzOutputCtrl lf::io::operator| | ( | const TikzOutputCtrl & | lhs, |
const TikzOutputCtrl & | rhs | ||
) |
Definition at line 13 of file write_tikz.cc.
std::variant< GMshFileV2, GMshFileV4 > lf::io::ReadGmshFile | ( | const std::string & | filename | ) |
Definition at line 642 of file gmsh_reader.cc.
References readGmshFileV2(), and ReadGmshFileV4().
GMshFileV2 lf::io::readGmshFileV2 | ( | std::string::const_iterator | begin, |
std::string::const_iterator | end, | ||
const std::string & | version, | ||
bool | is_binary, | ||
int | size_t_size, | ||
int | one, | ||
const std::string & | filename | ||
) |
Read a *.msh file from disk and copy it's contents into the MshFile Datastructure.
So far the following sections of the .msh file are read:
$MeshFormat
PhysicalNames
$Nodes
$Elements
$Periodic
All other sections are ignored.
Name the elements for better error parsing:
Definition at line 609 of file gmsh_file_v2.cc.
References lf::io::GMshFileV2::DoubleSize, lf::io::GMshFileV2::IsBinary, and lf::io::GMshFileV2::VersionNumber.
Referenced by ReadGmshFile().
GMshFileV4 lf::io::ReadGmshFileV4 | ( | std::string::const_iterator | begin, |
std::string::const_iterator | end, | ||
const std::string & | version, | ||
bool | is_binary, | ||
int | size_t_size, | ||
int | one, | ||
const std::string & | filename | ||
) |
Read a GmshFile with format 4 and return it as an in-memory struct.
begin | beginning of the file to parse (without header) |
end | end of the file to parse |
version | the exact version of the file, should be >=4 |
is_binary | Is the file in binary format? (from header) |
size_t_size | sizeof(std::size_t) (from header) |
one | Representation of the number one if is_binary==true (from header) |
filename | The name of the file that is being parsed (for better diagnostics) |
Definition at line 304 of file gmsh_file_v4.cc.
References lf::io::GMshFileV4::is_binary, lf::io::GMshFileV4::periodic_links, lf::io::GMshFileV4::size_t_size, and lf::io::GMshFileV4::version_number.
Referenced by ReadGmshFile().
base::RefEl lf::io::RefElOf | ( | GMshFileV2::ElementType | et | ) |
Reference element type of a GmshElementType.
Definition at line 264 of file gmsh_file_v2.cc.
References lf::io::GMshFileV2::EDGE2, lf::io::GMshFileV2::EDGE3, lf::io::GMshFileV2::EDGE4, lf::io::GMshFileV2::EDGE5, lf::io::GMshFileV2::EDGE6, lf::io::GMshFileV2::HEX125, lf::io::GMshFileV2::HEX20, lf::io::GMshFileV2::HEX27, lf::io::GMshFileV2::HEX64, lf::io::GMshFileV2::HEX8, lf::base::RefEl::kPoint(), lf::base::RefEl::kQuad(), lf::base::RefEl::kSegment(), lf::base::RefEl::kTria(), lf::io::GMshFileV2::POINT, lf::io::GMshFileV2::PRISM15, lf::io::GMshFileV2::PRISM18, lf::io::GMshFileV2::PRISM6, lf::io::GMshFileV2::PYRAMID13, lf::io::GMshFileV2::PYRAMID14, lf::io::GMshFileV2::PYRAMID5, lf::io::GMshFileV2::QUAD4, lf::io::GMshFileV2::QUAD8, lf::io::GMshFileV2::QUAD9, lf::io::GMshFileV2::TET10, lf::io::GMshFileV2::TET20, lf::io::GMshFileV2::TET35, lf::io::GMshFileV2::TET4, lf::io::GMshFileV2::TET56, lf::io::GMshFileV2::TRIA10, lf::io::GMshFileV2::TRIA12, lf::io::GMshFileV2::TRIA15, lf::io::GMshFileV2::TRIA15_5, lf::io::GMshFileV2::TRIA21, lf::io::GMshFileV2::TRIA3, lf::io::GMshFileV2::TRIA6, and lf::io::GMshFileV2::TRIA9.
Referenced by lf::io::GmshReader::InitGmshFile().
base::RefEl lf::io::RefElOf | ( | GMshFileV4::ElementType | et | ) |
Get the Reference Element type of a GmshElement.
et | The GmshFile element type |
Definition at line 196 of file gmsh_file_v4.cc.
References lf::io::GMshFileV4::EDGE2, lf::io::GMshFileV4::EDGE3, lf::io::GMshFileV4::EDGE4, lf::io::GMshFileV4::EDGE5, lf::io::GMshFileV4::EDGE6, lf::io::GMshFileV4::HEX125, lf::io::GMshFileV4::HEX20, lf::io::GMshFileV4::HEX27, lf::io::GMshFileV4::HEX64, lf::io::GMshFileV4::HEX8, lf::base::RefEl::kPoint(), lf::base::RefEl::kQuad(), lf::base::RefEl::kSegment(), lf::base::RefEl::kTria(), lf::io::GMshFileV4::POINT, lf::io::GMshFileV4::PRISM15, lf::io::GMshFileV4::PRISM18, lf::io::GMshFileV4::PRISM6, lf::io::GMshFileV4::PYRAMID13, lf::io::GMshFileV4::PYRAMID14, lf::io::GMshFileV4::PYRAMID5, lf::io::GMshFileV4::QUAD4, lf::io::GMshFileV4::QUAD8, lf::io::GMshFileV4::QUAD9, lf::io::GMshFileV4::TET10, lf::io::GMshFileV4::TET20, lf::io::GMshFileV4::TET35, lf::io::GMshFileV4::TET4, lf::io::GMshFileV4::TET56, lf::io::GMshFileV4::TRIA10, lf::io::GMshFileV4::TRIA12, lf::io::GMshFileV4::TRIA15, lf::io::GMshFileV4::TRIA15_5, lf::io::GMshFileV4::TRIA21, lf::io::GMshFileV4::TRIA3, lf::io::GMshFileV4::TRIA6, and lf::io::GMshFileV4::TRIA9.
void lf::io::writeMatlab | ( | const lf::mesh::Mesh & | mesh, |
std::string | filename | ||
) |
Writes affine triangulation data to file in MATLAB format.
mesh | the mesh to be stored to file |
filename | name of output file: .m will be appended unless present |
This function creates a .m-file containing a MATLAB function of the same name
function [x,y,TRI,EDS] = filename()
that initializes four variables
The data returned by this function can be visualized by the MATLAB function plot_lf_mesh(), which is also provided with LehrFEM++.
Definition at line 9 of file write_matlab.cc.
References lf::mesh::Mesh::DimMesh(), lf::mesh::Mesh::Entities(), lf::geometry::Geometry::Geometry(), lf::geometry::Geometry::Global(), lf::mesh::Mesh::Index(), lf::base::RefEl::kQuad(), lf::base::RefEl::kSegment(), lf::base::RefEl::kTria(), lf::mesh::Mesh::NumEntities(), and lf::base::RefEl::RefEl().
Referenced by lf::refinement::WriteMatlab().
void lf::io::writeMatplotlib | ( | const lf::mesh::Mesh & | mesh, |
std::string | filename | ||
) |
Write affine triangulation data to file in matplotlib format.
mesh | the mesh to be stored to file |
filename | name of output file: .csv appended unless present |
This function creates a .csv file containing all relevant information about the given mesh in the following format:
Points: codim, index, x_coord, y_coord
Segments: codim, index, point1_idx, point2_idx
Triangles/Quadrilaterals: codim, index, segment1_idx, segment2_idx, ...
The .csv file can be read by plot_mesh.py to visualize the mesh
Definition at line 16 of file write_matplotlib.cc.
References lf::mesh::Mesh::DimMesh(), lf::mesh::Mesh::Entities(), lf::geometry::Geometry::Geometry(), lf::geometry::Geometry::Global(), lf::mesh::Mesh::Index(), lf::base::RefEl::kPoint(), lf::base::RefEl::kQuad(), lf::base::RefEl::kSegment(), lf::base::RefEl::kTria(), lf::base::RefEl::NodeCoords(), lf::base::RefEl::RefEl(), and lf::base::RefEl::ToString().
bool lf::io::writeTikZ | ( | const lf::mesh::Mesh & | mesh, |
const std::string & | filename, | ||
std::function< bool(const lf::mesh::Entity &)> && | selector, | ||
TikzOutputCtrl | output_ctrl = TikzOutputCtrl::RenderCells |
||
) |
Writes mesh to file in TikZ Graphics format. File as input in LaTeX will draw the mesh.
mesh | the mesh to be stored to file |
filename | name of output file. |
selector | function which chooses what entities to print |
output_ctrl | enum flags controlling amount of output |
This function writes a file of code, which included in LaTeX draws a mesh using TikZ Graphics. In particular, edges, cells and nodes in the mesh can be written to file and visualized. Numbering of the aforementioned and local vertice numbering of cells can be enabled by using enum flags. Combine the flags by using the binary or (|) operator to get a more detailed visualization of the mesh.
Another option is to pass the corresponding integer value directly as an argument. See the enum definition for correct value.
The selector function goes through all entities and returns either true
or false
. An entity is printed iff selector returns true
. For instance, selector can check and return true
if an entity is a point. Then only nodes in the mesh are printed. See example below.
In the LaTeX document, remember to include "\usepackage{tikz}". Use "\input{}" to include the code file and visualize the mesh.
// Enum flag for node numbering writeTikZ(*mesh, "filename.txt", TikzOutputCtrl::NodeNumbering); // Combining enum flags, enabling more detailed output // The two examples are equivalent: writeTikZ(*mesh, "filename.txt", TikzOutputCtrl::RenderCells|TikzOutputCtrl::EdgeNumbering|TikzOutputCtrl::VerticeNumbering); writeTikZ(*mesh, "filename.txt", 21); // Note that ::VerticeNumbering only works because ::RenderCells is activated. // Without flags writeTikZ(*mesh, "filename.txt",0); // Without specifying last argument writeTikZ(*mesh, "filename.txt"); is equivalent to writeTikZ(*mesh, "filename.txt", 7); *
\documentclass{article} \usepackage{tikz} \begin{document} \input{"filename.txt"} \end{document} *
// Example of selector function auto desiredEntities = [&](const lf::mesh::Entity& entity) { // Nodes only return (entity.RefEl() == lf::base::RefEl::kPoint()); }; *
Definition at line 23 of file write_tikz.cc.
References ArrowTips, CellNumbering, lf::mesh::Mesh::DimMesh(), EdgeNumbering, lf::mesh::Mesh::Entities(), lf::geometry::Geometry::Geometry(), lf::geometry::Geometry::Global(), lf::mesh::Mesh::Index(), lf::base::RefEl::kPoint(), lf::base::RefEl::kQuad(), lf::base::RefEl::kSegment(), lf::base::RefEl::kTria(), lf::base::RefEl::NodeCoords(), NodeNumbering, lf::mesh::Mesh::NumEntities(), lf::base::RefEl::NumNodes(), lf::base::RefEl::RefEl(), RenderCells, VerticeNumbering, and WithPreamble.
Referenced by writeTikZ().
bool lf::io::writeTikZ | ( | const lf::mesh::Mesh & | mesh, |
const std::string & | filename, | ||
TikzOutputCtrl | output_ctrl = TikzOutputCtrl::RenderCells |
||
) |
TikZ output of all entities.
Calls the general implementation with a selector that returns true
throughout.
Definition at line 253 of file write_tikz.cc.
References writeTikZ().
void lf::io::WriteToFile | ( | const VtkFile & | vtk_file, |
const std::string & | filename | ||
) |
Definition at line 550 of file vtk_writer.cc.
References lf::io::VtkFile::BINARY, and lf::io::VtkFile::format.
Referenced by lf::io::VtkWriter::~VtkWriter().