// ------------------------------------------------------------------------ // // SPDX-License-Identifier: LGPL-2.1-or-later // Copyright (C) 2023 - 2025 by the deal.II authors // // This file is part of the deal.II library. // // Part of the source code is dual licensed under Apache-2.0 WITH // LLVM-exception OR LGPL-2.1-or-later. Detailed license information // governing the source code and code contributions can be found in // LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II. // // ------------------------------------------------------------------------ #ifndef dealii_vtk_utilities_h #define dealii_vtk_utilities_h #include #include #include #ifdef DEAL_II_WITH_VTK # include DEAL_II_NAMESPACE_OPEN /** * Interface to the Visualization Toolkit (VTK). * * VTK is an open-source, freely available software system for 3D computer * graphics, modeling, image processing, volume rendering, scientific * visualization, and 2D plotting. * It supports a wide variety of visualization algorithms and advanced * modeling techniques, and it takes advantage of both threaded and distributed * memory parallel processing for speed and scalability, respectively. * * You can learn more about the VTK library at https://vtk.org/ */ namespace VTKWrappers { /** * Convert from a deal.II Point to a VTK double array. * * @tparam dim Dimension of the point * @param [in] p An input deal.II Point * @return A VTK smart pointer to the data array. */ template inline vtkSmartPointer dealii_point_to_vtk_array(const dealii::Point &p); # ifndef DOXYGEN // Template implementations template inline vtkSmartPointer dealii_point_to_vtk_array(const dealii::Point &p) { vtkSmartPointer p_vtk = vtkSmartPointer::New(); p_vtk->SetNumberOfComponents(dim); p_vtk->SetNumberOfTuples(1); for (int d = 0; d < dim; ++d) p_vtk->FillComponent(d, p[d]); return p_vtk; } # endif } // namespace VTKWrappers DEAL_II_NAMESPACE_CLOSE #else // Make sure the scripts that create the C++20 module input files have // something to latch on if the preprocessor #ifdef above would // otherwise lead to an empty content of the file. DEAL_II_NAMESPACE_OPEN DEAL_II_NAMESPACE_CLOSE #endif #endif