https://mooseframework.inl.gov
Loading...
Searching...
No Matches
POD.h
Go to the documentation of this file.
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#pragma once
11
13#include "MooseTypes.h"
14#include "libmesh/petsc_vector.h"
15#include "libmesh/libmesh_config.h"
16
17#include <slepcsvd.h>
18
19namespace StochasticTools
20{
25class POD
26{
27public:
28 POD(const ParallelSolutionStorage * const parallel_storage,
29 const std::string & extra_slepc_options,
30 const Parallel::Communicator & comm);
39 void computePOD(const VariableName & vname,
40 std::vector<DenseVector<Real>> & left_basis_functions,
41 std::vector<DenseVector<Real>> & right_basis_functions,
42 std::vector<Real> & singular_values,
43 const dof_id_type num_modes,
44 const Real energy) const;
45
46private:
55 dof_id_type determineNumberOfModes(const std::vector<Real> & singular_values,
56 const dof_id_type num_modes_compute,
57 const Real energy) const;
58
59#if !PETSC_VERSION_LESS_THAN(3, 14, 0)
63 const std::string & _extra_slepc_options;
65 const Parallel::Communicator & _communicator;
66#endif
67};
68}
A Reporter which stores serialized solution fields for given variables in a distributed fashion.
Class which computes a Proper Orthogonal Decomposition (POD) for snapshots stored in ParallelSolution...
Definition POD.h:26
const std::string & _extra_slepc_options
Additional options for the singular value solver.
Definition POD.h:63
const ParallelSolutionStorage *const _parallel_storage
The container where the snapshots are stored.
Definition POD.h:61
const Parallel::Communicator & _communicator
The communicator for parallel routines.
Definition POD.h:65
dof_id_type determineNumberOfModes(const std::vector< Real > &singular_values, const dof_id_type num_modes_compute, const Real energy) const
Determine the number of basis functions needed for a given variable based on the information on the s...
Definition POD.C:205
void computePOD(const VariableName &vname, std::vector< DenseVector< Real > > &left_basis_functions, std::vector< DenseVector< Real > > &right_basis_functions, std::vector< Real > &singular_values, const dof_id_type num_modes, const Real energy) const
Definition POD.C:40
Enum for batch type in stochastic tools MultiApp.