LCOV - code coverage report
Current view: top level - include/mfem/vectorpostprocessors - MFEMSamplerBase.h (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 329044 Lines: 1 1 100.0 %
Date: 2026-08-03 21:12:22 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #ifdef MOOSE_MFEM_ENABLED
      11             : 
      12             : #pragma once
      13             : 
      14             : #include "MFEMVectorPostprocessor.h"
      15             : 
      16             : /**
      17             :  * Abstract base class for sampling MFEM quantities at points.
      18             :  *
      19             :  * Handles GSLIB point finding and coordinate output independently of the
      20             :  * quantity being sampled. Derived classes evaluate and output their quantity.
      21             :  */
      22             : class MFEMSamplerBase : public MFEMVectorPostprocessor
      23             : {
      24             : public:
      25             :   static InputParameters validParams();
      26             : 
      27             :   /// Checks that all query points were found.
      28             :   void initialSetup() override;
      29             : 
      30        1070 :   void initialize() override {}
      31             : 
      32             :   /// Outputs coordinates then delegates value output to finalizeValues().
      33             :   void finalize() override;
      34             : 
      35             : protected:
      36             :   /** Classification returned by GSLIB for a query point's location. */
      37             :   enum class PointLocationCode : unsigned int
      38             :   {
      39             :     INTERNAL = 0,
      40             :     BORDER = 1,
      41             :     NOT_FOUND = 2,
      42             :   };
      43             : 
      44             :   MFEMSamplerBase(const InputParameters & parameters,
      45             :                   const std::vector<Point> & points,
      46             :                   mfem::ParMesh & mesh);
      47             : 
      48             :   /// Copies interpolated values into the subclass VPP vectors.
      49             :   virtual void finalizeValues() = 0;
      50             : 
      51             :   /// Original query points used for point-location diagnostics.
      52             :   const std::vector<Point> _query_points;
      53             :   /// MFEM mesh on which the sampled quantity is defined.
      54             :   mfem::ParMesh & _mesh;
      55             :   /// GSLIB point finder used to locate and interpolate the query points.
      56             :   mfem::FindPointsGSLIB _finder;
      57             :   /// Ordering used to store the point coordinates in the MFEM vector.
      58             :   mfem::Ordering::Type _points_ordering;
      59             :   /// MFEM vector containing the query-point coordinates.
      60             :   mfem::Vector _points;
      61             :   /// Declared VPP output vectors for spatial coordinates ("x_0", "x_1", ...).
      62             :   std::vector<std::reference_wrapper<VectorPostprocessorValue>> _declared_points;
      63             : };
      64             : 
      65             : #endif // MOOSE_MFEM_ENABLED

Generated by: LCOV version 1.14