Advanced Multi-Physics (AMP)
On-Line Documentation
PowerShape.h
Go to the documentation of this file.
1#ifndef included_AMP_PowerShape_h
2#define included_AMP_PowerShape_h
3
4// AMP files
5#include "AMP/mesh/Mesh.h"
6#include "AMP/operators/Operator.h"
7#include "AMP/operators/OperatorParameters.h"
8#include "AMP/operators/libmesh/PowerShapeParameters.h"
9#include "AMP/utils/Database.h"
10#include "AMP/utils/UtilityMacros.h"
11#include "AMP/vectors/Variable.h"
12#include <memory>
13
14
15// Libmesh headers
17#include "libmesh/libmesh_config.h"
18#undef LIBMESH_ENABLE_REFERENCE_COUNTING
19#include "libmesh/elem.h"
20#include "libmesh/fe_base.h"
21#include "libmesh/fe_type.h"
22#include "libmesh/quadrature_gauss.h"
24
25
26#include <vector>
27
28
29namespace AMP::Operator {
30
31
32//===========================================================================//
37//===========================================================================//
38
39class PowerShape : public Operator
40{
41public:
42 /*
43 * A class for representing the neutronics source operator.
44 */
45 explicit PowerShape( std::shared_ptr<PowerShapeParameters> parameters );
46
50 virtual ~PowerShape();
51
53 std::string type() const override { return "PowerShape"; }
54
58 void printClassData( std::ostream &os ) const;
59
65 void putToDatabase( std::shared_ptr<AMP::Database> db );
66
76
80 void reset( std::shared_ptr<const OperatorParameters> parameters ) override;
81
82
83 double evalFactorial( const int n );
84 double choose( int, int );
85 double evalZernike( const int m, const int n, const double rho, const double phi );
86 double evalLegendre( const int n, const double x );
87 double getVolumeIntegralSum( double rmax, double cx, double cy );
88 double getFrapconFr( double radius, double rmax );
89 double getZernikeRadial( double rho );
90 double getZernike( double rho, double phi );
91 double getGaussianF( double x, double y );
92
93protected:
94 std::shared_ptr<AMP::Database> d_db;
95
96 std::shared_ptr<libMesh::FEType> d_feType;
97 std::shared_ptr<libMesh::FEBase> d_fe;
98 std::shared_ptr<libMesh::QBase> d_qrule;
99
101
103
105
106 libMesh::Elem *d_currElemPtr;
107
108private:
109 // Defines fission data types.
111
112 bool d_useFixedPower; // use a spatially constant power distribution
113 std::string d_coordinateSystem; // Coordinate system
114 std::string d_type; // Cylindrical coordinate system
115 unsigned int d_numXmoments; // Number of moments in the x direction
116 unsigned int d_numYmoments; // Number of moments in the y direction.
117 unsigned int d_numZmoments; // Number of moments in the z direction.
118 unsigned int d_numMoments; // Number of moments in the Zernike basis function
119 unsigned int d_numMNmoments;
120 std::vector<double> d_Xmoments; // Moments in the x direction: size= d_numXmoments
121 std::vector<double> d_Ymoments; // Moments in the y direction: size= d_numYmoments
122 std::vector<double> d_Zmoments; // Moments in the z direction: size= d_numZmoments
123 std::vector<double> d_Moments; // Moments in the Zernike basis function
124 double d_frapconConstant; // Frapcon constant
125 double d_angularConstant; // Angular constan.
126
127 // Radial Bounding Box
128 // (0,1) = center (x,y)
129 // (2,3) = radius (min, max)
130 // (4,5) = height (min, max)
131 std::vector<double> d_radialBoundingBox;
132
133 // Gaussian constants
134 double d_muX;
135 double d_muY;
136 double d_sigmaX;
137 double d_sigmaY;
138};
139} // namespace AMP::Operator
140
141#endif
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
Definition Vector.h:60
std::shared_ptr< const Vector > const_shared_ptr
Definition Vector.h:65
A pointer class to wrap a MeshElementVector.
std::shared_ptr< AMP::Operator::Operator > shared_ptr
Definition Operator.h:29
Provides the specific power distribution by node for a given mesh.
Definition PowerShape.h:40
void putToDatabase(std::shared_ptr< AMP::Database > db)
AMP::Mesh::MeshElementVectorPtr d_currNodes
Definition PowerShape.h:104
double getZernikeRadial(double rho)
std::vector< double > d_Zmoments
Definition PowerShape.h:122
std::vector< double > d_Moments
Definition PowerShape.h:123
std::shared_ptr< libMesh::QBase > d_qrule
Definition PowerShape.h:98
double evalLegendre(const int n, const double x)
std::shared_ptr< libMesh::FEBase > d_fe
Definition PowerShape.h:97
std::vector< double > d_radialBoundingBox
Definition PowerShape.h:131
double evalFactorial(const int n)
std::string d_coordinateSystem
Definition PowerShape.h:113
std::string type() const override
Return the name of the operator.
Definition PowerShape.h:53
double getZernike(double rho, double phi)
libMesh::Elem * d_currElemPtr
Definition PowerShape.h:106
std::vector< double > d_Xmoments
Definition PowerShape.h:120
void reset(std::shared_ptr< const OperatorParameters > parameters) override
std::shared_ptr< libMesh::FEType > d_feType
Definition PowerShape.h:96
std::shared_ptr< AMP::Database > d_db
Definition PowerShape.h:94
double getFrapconFr(double radius, double rmax)
PowerShape(std::shared_ptr< PowerShapeParameters > parameters)
std::vector< double > d_Ymoments
Definition PowerShape.h:121
double getGaussianF(double x, double y)
double choose(int, int)
double getVolumeIntegralSum(double rmax, double cx, double cy)
double evalZernike(const int m, const int n, const double rho, const double phi)
void apply(AMP::LinearAlgebra::Vector::const_shared_ptr u, AMP::LinearAlgebra::Vector::shared_ptr f) override
void printClassData(std::ostream &os) const
unsigned int d_numMNmoments
Definition PowerShape.h:119
#define DISABLE_WARNINGS
Re-enable warnings.
#define ENABLE_WARNINGS
Suppress all warnings.



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page