Advanced Multi-Physics (AMP)
On-Line Documentation
RadiationDiffusionFDDiscretization.h
Go to the documentation of this file.
1#ifndef RAD_DIF_FD_DISCRETIZATION
2#define RAD_DIF_FD_DISCRETIZATION
3
4#include "AMP/IO/AsciiWriter.h"
5#include "AMP/IO/PIO.h"
6#include "AMP/discretization/MultiDOF_Manager.h"
7#include "AMP/discretization/boxMeshDOFManager.h"
8#include "AMP/geometry/shapes/Box.h"
9#include "AMP/matrices/MatrixBuilder.h"
10#include "AMP/mesh/structured/BoxMesh.h"
11#include "AMP/mesh/structured/structuredMeshElement.h"
12#include "AMP/operators/LinearOperator.h"
13#include "AMP/operators/Operator.h"
14#include "AMP/operators/OperatorParameters.h"
15#include "AMP/utils/AMPManager.h"
16#include "AMP/vectors/MultiVector.h"
17#include "AMP/vectors/Vector.h"
18#include "AMP/vectors/VectorBuilder.h"
19
20#include <optional>
21#include <variant>
22
23
59namespace AMP::Operator {
60
61// Foward declaration of classes declared in this file
62class RadDifCoefficients; // Static class defining PDE coefficients
63class FDMeshOps; // Static class for creating mesh-related data and FD coefficients
64class FDMeshGlobalIndexingOps; // Class for index conversions on global DOFs
65class FDBoundaryUtils; // Static class for boundary-related utilities
66//
67class RadDifOp; // The main, nonlinear operator
68class RadDifOpPJac; // Its linearization
69class RadDifOpPJacParameters; // Operator parameters for linearization
70struct RadDifOpPJacData; // Data structure for storing the linearization data
71
74{
75
76public:
77 // Hack. This should really be templated against. Realistically the operator RadDifOp, and its
78 // linearization, should be templated against a coefficient class, and a non-templated base
79 // class added. The realistic use case is for the nonlinear coefficients, but the linear
80 // coefficients can be useful for testing, debugging, etc.
82 static constexpr bool IsNonlinear = true;
83
86
92 static double diffusionE( double k11, double T, double zatom );
93
98 static double diffusionT( double k21, double T );
99
101 static void reaction( double k12,
102 double k22,
103 double T,
104 double zatom,
105 double &REE,
106 double &RET,
107 double &RTE,
108 double &RTT );
109};
110
111
116{
117
118private:
120 static constexpr size_t WEST = 0;
121 static constexpr size_t ORIGIN = 1;
122 static constexpr size_t EAST = 2;
123
124public:
125 // Hack. This should really be templated against. That said, for applications flux limiting is
126 // usually required.
128 static constexpr bool IsFluxLimited = true;
129
131 FDMeshOps() = delete;
132
134 static void
135 createMeshData( std::shared_ptr<AMP::Mesh::Mesh> mesh,
136 std::shared_ptr<AMP::Mesh::BoxMesh> &d_BoxMesh,
137 size_t &d_dim,
138 AMP::Mesh::GeomType &d_CellCenteredGeom,
139 std::shared_ptr<AMP::Discretization::DOFManager> &d_scalarDOFMan,
140 std::shared_ptr<AMP::Discretization::multiDOFManager> &d_multiDOFMan,
141 std::shared_ptr<AMP::Mesh::BoxMesh::Box> &d_globalBox,
142 std::shared_ptr<AMP::Mesh::BoxMesh::Box> &d_localBox,
143 std::shared_ptr<AMP::ArraySize> &d_localArraySize,
144 std::vector<double> &d_h,
145 std::vector<double> &d_rh2 );
146
160 template<bool computeE, bool computeT>
161 static void FaceDiffusionCoefficients( std::array<double, 3> &ELoc3,
162 std::array<double, 3> &TLoc3,
163 double k11,
164 double k21,
165 double zatom,
166 double h,
167 double *Dr_WO,
168 double *Dr_OE,
169 double *DT_WO,
170 double *DT_OE );
171
172 // Helper function
173private:
175 static void
177 std::shared_ptr<AMP::Mesh::BoxMesh> &mesh,
178 std::shared_ptr<AMP::Discretization::DOFManager> &scalarDOFMan,
179 std::shared_ptr<AMP::Discretization::multiDOFManager> &multiDOFMan );
180};
181
182
188{
189
190 // Data
191private:
193 static constexpr size_t WEST = 0;
194 static constexpr size_t ORIGIN = 1;
195 static constexpr size_t EAST = 2;
196
198 std::shared_ptr<AMP::Mesh::BoxMesh> d_BoxMesh;
202 std::shared_ptr<AMP::Discretization::DOFManager> d_scalarDOFMan;
204 std::shared_ptr<AMP::Discretization::multiDOFManager> d_multiDOFMan;
205
206
207public:
208 FDMeshGlobalIndexingOps( std::shared_ptr<AMP::Mesh::BoxMesh> BoxMesh,
210 std::shared_ptr<AMP::Discretization::DOFManager> scalarDOFMan,
211 std::shared_ptr<AMP::Discretization::multiDOFManager> multiDOFMan );
212
214 size_t gridIndsToScalarDOF( const std::array<size_t, 3> &ijk ) const;
215
217 std::array<size_t, 3> scalarDOFToGridInds( size_t dof ) const;
218
221 gridIndsToMeshElement( const std::array<size_t, 3> &ijk ) const;
222};
223
224
227{
228
229private:
231 static constexpr std::string_view a_keys[] = { "a1", "a2", "a3", "a4", "a5", "a6" };
232 static constexpr std::string_view b_keys[] = { "b1", "b2", "b3", "b4", "b5", "b6" };
233 static constexpr std::string_view r_keys[] = { "r1", "r2", "r3", "r4", "r5", "r6" };
234 static constexpr std::string_view n_keys[] = { "n1", "n2", "n3", "n4", "n5", "n6" };
235
236 //
237public:
239 FDBoundaryUtils() = delete;
240
242 enum class BoundarySide { WEST, EAST };
243
247 static size_t getBoundaryIDFromDim( size_t dim, BoundarySide side );
248
252 static size_t getDimFromBoundaryID( size_t boundaryID );
253
256 static void getBCConstantsFromDB( const AMP::Database &db,
257 size_t boundaryID,
258 double &ak,
259 double &bk,
260 double &rk,
261 double &nk );
262
282 static void ghostValuesSolve( double a,
283 double b,
284 const std::function<double( double T )> &cHandle,
285 double r,
286 double n,
287 double h,
288 double Eint,
289 double Tint,
290 double &Eg,
291 double &Tg );
292
304 static double ghostValueSolveT( double n, double h, double Tint );
305
321 static double ghostValueSolveE( double a, double b, double r, double c, double h, double Eint );
322};
323
324
367{
368
369 // Data
370public:
372 std::shared_ptr<AMP::Database> d_db = nullptr;
373
374
375 // Methods
376public:
378 RadDifOp( std::shared_ptr<const AMP::Operator::OperatorParameters> params );
380 virtual ~RadDifOp(){};
381
382 std::string type() const override { return "RadDifOp"; };
383
385 void apply( std::shared_ptr<const AMP::LinearAlgebra::Vector> ET,
386 std::shared_ptr<AMP::LinearAlgebra::Vector> LET ) override;
387
389 bool isValidVector( std::shared_ptr<const AMP::LinearAlgebra::Vector> ET ) override;
390
392 std::shared_ptr<AMP::LinearAlgebra::Vector> createInputVector() const override;
393
395 const std::vector<double> &getMeshSize() const;
396
399
401 std::shared_ptr<const AMP::Discretization::DOFManager> getScalarDOFManager() const;
402
405 const std::function<double( size_t boundaryID, const AMP::Mesh::Point &boundaryPoint )>
406 &fn_ );
407
410 const std::function<double( size_t boundaryID, const AMP::Mesh::Point &boundaryPoint )>
411 &fn_ );
412
413 // Data
414private:
416 const double d_k11;
417 const double d_k12;
418 const double d_k21;
419 const double d_k22;
420
423 std::array<double, 6> d_ak;
424 std::array<double, 6> d_bk;
425 std::array<double, 6> d_rk;
426 std::array<double, 6> d_nk;
427
429private:
431 std::shared_ptr<AMP::Discretization::multiDOFManager> d_multiDOFMan;
433 std::shared_ptr<AMP::Discretization::DOFManager> d_scalarDOFMan;
435 std::shared_ptr<AMP::Mesh::BoxMesh> d_BoxMesh;
437 std::shared_ptr<AMP::Mesh::BoxMesh::Box> d_globalBox = nullptr;
439 std::shared_ptr<AMP::Mesh::BoxMesh::Box> d_localBox = nullptr;
441 std::shared_ptr<AMP::ArraySize> d_localArraySize = nullptr;
445 size_t d_dim = (size_t) -1;
447 std::vector<double> d_h;
449 std::vector<double> d_rh2;
450
452 static constexpr size_t WEST = 0;
453 static constexpr size_t ORIGIN = 1;
454 static constexpr size_t EAST = 2;
455
457 std::shared_ptr<FDMeshGlobalIndexingOps> d_meshIndexingOps = nullptr;
458
459
460private:
462 void applyInterior( std::shared_ptr<const AMP::LinearAlgebra::Vector> E_vec,
463 std::shared_ptr<const AMP::LinearAlgebra::Vector> T_vec,
464 std::shared_ptr<AMP::LinearAlgebra::Vector> LE_vec,
465 std::shared_ptr<AMP::LinearAlgebra::Vector> LT_vec );
466
468 void applyBoundary( std::shared_ptr<const AMP::LinearAlgebra::Vector> E_vec,
469 std::shared_ptr<const AMP::LinearAlgebra::Vector> T_vec,
470 std::shared_ptr<AMP::LinearAlgebra::Vector> LE_vec,
471 std::shared_ptr<AMP::LinearAlgebra::Vector> LT_vec );
472
473
486 double Eint,
487 double Tint,
488 double &Eg,
489 double &Tg );
490
505 void getNNDataBoundary( std::shared_ptr<const AMP::LinearAlgebra::Vector> E_vec,
506 std::shared_ptr<const AMP::LinearAlgebra::Vector> T_vec,
507 std::array<size_t, 3> &ijk,
508 size_t dim,
509 std::array<double, 3> &ELoc3,
510 std::array<double, 3> &TLoc3 );
511
512
519 std::function<double( size_t boundaryID, const AMP::Mesh::Point &boundaryPoint )>
521
528 std::function<double( size_t boundaryID, const AMP::Mesh::Point &boundaryPoint )>
530
531 //
532protected:
538 std::shared_ptr<AMP::Operator::OperatorParameters>
540};
541// End of RadDifOp
542
543
551{
552
553 //
554public:
555 std::shared_ptr<AMP::Database> d_db = nullptr;
557 std::shared_ptr<RadDifOpPJacData> d_data = nullptr;
560
562 RadDifOpPJac( std::shared_ptr<const AMP::Operator::OperatorParameters> params_ );
563
565 virtual ~RadDifOpPJac(){};
566
568 std::shared_ptr<AMP::LinearAlgebra::Vector> createInputVector() const override;
569
571 static std::unique_ptr<AMP::Operator::Operator>
572 create( std::shared_ptr<AMP::Operator::OperatorParameters> params )
573 {
574 return std::make_unique<RadDifOpPJac>( params );
575 };
576
582 void reset( std::shared_ptr<const AMP::Operator::OperatorParameters> params ) override;
583
584 std::string type() const override { return "RadDifOpPJac"; };
585
587 void apply( std::shared_ptr<const AMP::LinearAlgebra::Vector> ET,
588 std::shared_ptr<AMP::LinearAlgebra::Vector> LET ) override;
589
594
595
596 // Data
597private:
599 const double d_k11;
600 const double d_k12;
601 const double d_k21;
602 const double d_k22;
603
606 std::array<double, 6> d_ak;
607 std::array<double, 6> d_bk;
608 std::array<double, 6> d_rk;
609 std::array<double, 6> d_nk;
610
614
615
617private:
619 std::shared_ptr<AMP::Discretization::multiDOFManager> d_multiDOFMan;
621 std::shared_ptr<AMP::Discretization::DOFManager> d_scalarDOFMan;
623 std::shared_ptr<AMP::Mesh::BoxMesh> d_BoxMesh;
625 std::shared_ptr<AMP::Mesh::BoxMesh::Box> d_globalBox = nullptr;
627 std::shared_ptr<AMP::Mesh::BoxMesh::Box> d_localBox = nullptr;
629 std::shared_ptr<AMP::ArraySize> d_localArraySize = nullptr;
633 size_t d_dim = (size_t) -1;
635 std::vector<double> d_h;
637 std::vector<double> d_rh2;
638
640 std::array<size_t, 5> d_ijk;
642 std::array<double, 3> d_ELoc3;
643 std::array<double, 3> d_TLoc3;
645 std::array<size_t, 3> d_dofsLoc3;
646
648 static constexpr size_t WEST = 0;
649 static constexpr size_t ORIGIN = 1;
650 static constexpr size_t EAST = 2;
651
653 std::shared_ptr<FDMeshGlobalIndexingOps> d_meshIndexingOps = nullptr;
654 //
655private:
657 void applyFromData( std::shared_ptr<const AMP::LinearAlgebra::Vector> ET_,
658 std::shared_ptr<AMP::LinearAlgebra::Vector> LET_ );
659
661 void setData();
662
668 void setDataReaction( std::shared_ptr<const AMP::LinearAlgebra::Vector> T_vec );
669
673 template<size_t Component>
674 void fillDiffusionMatrixWithData( std::shared_ptr<AMP::LinearAlgebra::Matrix> matrix );
675
690 template<size_t Component>
691 void getCSRDataDiffusionMatrix( std::shared_ptr<const AMP::LinearAlgebra::Vector> E_vec,
692 std::shared_ptr<const AMP::LinearAlgebra::Vector> T_vec,
693 const double *E_rawData,
694 const double *T_rawData,
695 size_t row,
696 std::vector<size_t> &cols,
697 std::vector<double> &data );
698
702 template<size_t Component>
704 const double *T_rawData,
705 size_t rowLocal,
706 std::array<size_t, 5> &ijkLocal,
707 std::vector<size_t> &colsLocal,
708 std::vector<double> &data );
709
711 template<size_t Component>
712 void getCSRDataDiffusionMatrixBoundary( std::shared_ptr<const AMP::LinearAlgebra::Vector> E_vec,
713 std::shared_ptr<const AMP::LinearAlgebra::Vector> T_vec,
714 size_t row,
715 std::vector<size_t> &cols,
716 std::vector<double> &data );
717
718
728 double PicardCorrectionCoefficient( size_t component, size_t boundaryID, double ck ) const;
729
742 double Eint,
743 double Tint,
744 double &Eg,
745 double &Tg );
746
765 std::shared_ptr<const AMP::LinearAlgebra::Vector> E_vec,
766 std::shared_ptr<const AMP::LinearAlgebra::Vector> T_vec,
767 std::array<size_t, 3> &ijk, // is modified locally, but returned in same state
768 size_t dim,
769 std::array<double, 3> &ELoc3,
770 std::array<double, 3> &TLoc3,
771 std::array<size_t, 3> &dofsLoc3,
772 std::optional<FDBoundaryUtils::BoundarySide> &boundaryIntersection );
773
780 std::function<double( size_t boundaryID, const AMP::Mesh::Point &boundaryPoint )>
782
789 std::function<double( size_t boundaryID, const AMP::Mesh::Point &boundaryPoint )>
791};
792// End of RadDifOpPJac
793
794
803 friend class RadDifOpPJac;
804
805public:
807 std::tuple<std::shared_ptr<AMP::LinearAlgebra::Matrix>,
808 std::shared_ptr<AMP::LinearAlgebra::Matrix>,
809 std::shared_ptr<AMP::LinearAlgebra::Vector>,
810 std::shared_ptr<AMP::LinearAlgebra::Vector>,
811 std::shared_ptr<AMP::LinearAlgebra::Vector>,
812 std::shared_ptr<AMP::LinearAlgebra::Vector>>
814
815private:
820
822 std::shared_ptr<AMP::LinearAlgebra::Matrix> d_E = nullptr;
823 std::shared_ptr<AMP::LinearAlgebra::Matrix> d_T = nullptr;
824 std::shared_ptr<AMP::LinearAlgebra::Vector> r_EE = nullptr;
825 std::shared_ptr<AMP::LinearAlgebra::Vector> r_ET = nullptr;
826 std::shared_ptr<AMP::LinearAlgebra::Vector> r_TE = nullptr;
827 std::shared_ptr<AMP::LinearAlgebra::Vector> r_TT = nullptr;
828};
829
830
839{
840public:
841 // Constructor
842 explicit RadDifOpPJacParameters( std::shared_ptr<AMP::Database> db )
843 : OperatorParameters( db ){};
845
847
848 std::function<double( size_t boundaryID, const AMP::Mesh::Point &boundaryPoint )>
850 std::function<double( size_t boundaryID, const AMP::Mesh::Point &boundaryPoint )>
852};
853
854} // namespace AMP::Operator
855
856
857#endif
Class to a database.
Definition Database.h:111
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 derived class used to define a mesh element.
static size_t getBoundaryIDFromDim(size_t dim, BoundarySide side)
FDBoundaryUtils()=delete
Prevent instantiation.
static size_t getDimFromBoundaryID(size_t boundaryID)
static void ghostValuesSolve(double a, double b, const std::function< double(double T)> &cHandle, double r, double n, double h, double Eint, double Tint, double &Eg, double &Tg)
static constexpr std::string_view n_keys[]
BoundarySide
Defines a boundary in a given dimension (WEST is the first boundary, and EAST the second)
static constexpr std::string_view b_keys[]
static double ghostValueSolveT(double n, double h, double Tint)
static constexpr std::string_view a_keys[]
Keys used to access db constants.
static constexpr std::string_view r_keys[]
static double ghostValueSolveE(double a, double b, double r, double c, double h, double Eint)
static void getBCConstantsFromDB(const AMP::Database &db, size_t boundaryID, double &ak, double &bk, double &rk, double &nk)
std::shared_ptr< AMP::Discretization::DOFManager > d_scalarDOFMan
DOFManager for E and T individually.
AMP::Mesh::structuredMeshElement gridIndsToMeshElement(const std::array< size_t, 3 > &ijk) const
Map from grid index to a MeshElement.
std::shared_ptr< AMP::Discretization::multiDOFManager > d_multiDOFMan
MultiDOFManager for managing [E,T] multivectors.
static constexpr size_t WEST
Indices used for referencing WEST, ORIGIN, and EAST entries in Loc3 data structures.
std::array< size_t, 3 > scalarDOFToGridInds(size_t dof) const
Map from scalar DOF to grid indices i, j, k.
std::shared_ptr< AMP::Mesh::BoxMesh > d_BoxMesh
Mesh; keep a pointer to save having to downcast repeatedly.
size_t gridIndsToScalarDOF(const std::array< size_t, 3 > &ijk) const
Map from grid index to a the corresponding DOF.
FDMeshGlobalIndexingOps(std::shared_ptr< AMP::Mesh::BoxMesh > BoxMesh, AMP::Mesh::GeomType &geom, std::shared_ptr< AMP::Discretization::DOFManager > scalarDOFMan, std::shared_ptr< AMP::Discretization::multiDOFManager > multiDOFMan)
FDMeshOps()=delete
Prevent instantiation.
static constexpr bool IsFluxLimited
Flag indicating whether energy diffusion coefficient is limited.
static void createMeshData(std::shared_ptr< AMP::Mesh::Mesh > mesh, std::shared_ptr< AMP::Mesh::BoxMesh > &d_BoxMesh, size_t &d_dim, AMP::Mesh::GeomType &d_CellCenteredGeom, std::shared_ptr< AMP::Discretization::DOFManager > &d_scalarDOFMan, std::shared_ptr< AMP::Discretization::multiDOFManager > &d_multiDOFMan, std::shared_ptr< AMP::Mesh::BoxMesh::Box > &d_globalBox, std::shared_ptr< AMP::Mesh::BoxMesh::Box > &d_localBox, std::shared_ptr< AMP::ArraySize > &d_localArraySize, std::vector< double > &d_h, std::vector< double > &d_rh2)
Create mesh-related data given the mesh.
static constexpr size_t WEST
Indices used for referencing WEST, ORIGIN, and EAST entries in Loc3 data structures.
static void FaceDiffusionCoefficients(std::array< double, 3 > &ELoc3, std::array< double, 3 > &TLoc3, double k11, double k21, double zatom, double h, double *Dr_WO, double *Dr_OE, double *DT_WO, double *DT_OE)
static void createDOFManagers(const AMP::Mesh::GeomType &Geom, std::shared_ptr< AMP::Mesh::BoxMesh > &mesh, std::shared_ptr< AMP::Discretization::DOFManager > &scalarDOFMan, std::shared_ptr< AMP::Discretization::multiDOFManager > &multiDOFMan)
Create DOFManagers given the geometry and mesh.
std::shared_ptr< AMP::Operator::Operator > shared_ptr
Definition Operator.h:29
static constexpr bool IsNonlinear
Flag indicating whether nonlinear or linear PDE coefficients are used.
static void reaction(double k12, double k22, double T, double zatom, double &REE, double &RET, double &RTE, double &RTT)
Compute reaction coefficients REE, RET, RTE, REE.
static double diffusionE(double k11, double T, double zatom)
static double diffusionT(double k21, double T)
RadDifCoefficients()=delete
Prevent instantiation.
std::function< double(size_t boundaryID, const AMP::Mesh::Point &boundaryPoint)> d_robinFunctionE
RadDifOpPJacParameters(std::shared_ptr< AMP::Database > db)
std::function< double(size_t boundaryID, const AMP::Mesh::Point &boundaryPoint)> d_pseudoNeumannFunctionT
AMP::LinearAlgebra::Vector::shared_ptr d_frozenSolution
std::shared_ptr< AMP::Discretization::multiDOFManager > d_multiDOFMan
Mesh-related data.
std::shared_ptr< AMP::LinearAlgebra::Vector > createInputVector() const override
Create a multiVector of E and T over the mesh.
void getCSRDataDiffusionMatrixInterior(const double *E_rawData, const double *T_rawData, size_t rowLocal, std::array< size_t, 5 > &ijkLocal, std::vector< size_t > &colsLocal, std::vector< double > &data)
std::vector< double > d_h
Mesh sizes, hx, hy, hz. We compute these based on the incoming mesh.
void setDataReaction(std::shared_ptr< const AMP::LinearAlgebra::Vector > T_vec)
std::shared_ptr< FDMeshGlobalIndexingOps > d_meshIndexingOps
Mesh indexing functions.
std::string type() const override
Return the name of the operator.
std::array< size_t, 3 > d_dofsLoc3
Placeholder array for dofs we connect to in 3-point stencil.
std::vector< double > d_rh2
Reciprocal squares of mesh sizes.
void fillDiffusionMatrixWithData(std::shared_ptr< AMP::LinearAlgebra::Matrix > matrix)
AMP::LinearAlgebra::Vector::shared_ptr d_frozenVec
The vector the above operator is linearized about.
std::array< double, 3 > d_ELoc3
Placeholder arrays for values used in 3-point stencils.
void reset(std::shared_ptr< const AMP::Operator::OperatorParameters > params) override
void getCSRDataDiffusionMatrix(std::shared_ptr< const AMP::LinearAlgebra::Vector > E_vec, std::shared_ptr< const AMP::LinearAlgebra::Vector > T_vec, const double *E_rawData, const double *T_rawData, size_t row, std::vector< size_t > &cols, std::vector< double > &data)
void apply(std::shared_ptr< const AMP::LinearAlgebra::Vector > ET, std::shared_ptr< AMP::LinearAlgebra::Vector > LET) override
Compute LET = L(ET)
AMP::Mesh::GeomType CellCenteredGeom
Placeholder for geometry that results in cell-centered data.
std::shared_ptr< AMP::ArraySize > d_localArraySize
Local array size.
void getNNDataBoundary(std::shared_ptr< const AMP::LinearAlgebra::Vector > E_vec, std::shared_ptr< const AMP::LinearAlgebra::Vector > T_vec, std::array< size_t, 3 > &ijk, size_t dim, std::array< double, 3 > &ELoc3, std::array< double, 3 > &TLoc3, std::array< size_t, 3 > &dofsLoc3, std::optional< FDBoundaryUtils::BoundarySide > &boundaryIntersection)
std::shared_ptr< AMP::Mesh::BoxMesh > d_BoxMesh
Mesh; keep a pointer to save having to downcast repeatedly.
static constexpr size_t WEST
Indices used for referencing WEST, ORIGIN, and EAST entries in Loc3 data structures.
std::shared_ptr< AMP::Mesh::BoxMesh::Box > d_localBox
Local grid index box w/ zero ghosts.
std::function< double(size_t boundaryID, const AMP::Mesh::Point &boundaryPoint)> d_pseudoNeumannFunctionT
void applyFromData(std::shared_ptr< const AMP::LinearAlgebra::Vector > ET_, std::shared_ptr< AMP::LinearAlgebra::Vector > LET_)
Apply action of the operator utilizing its representation in d_data.
std::shared_ptr< AMP::Discretization::DOFManager > d_scalarDOFMan
DOFManager for E and T individually.
double PicardCorrectionCoefficient(size_t component, size_t boundaryID, double ck) const
static std::unique_ptr< AMP::Operator::Operator > create(std::shared_ptr< AMP::Operator::OperatorParameters > params)
Used by OperatorFactory to create a RadDifOpPJac.
RadDifOpPJac(std::shared_ptr< const AMP::Operator::OperatorParameters > params_)
Constructor.
void setData()
Set our d_data member.
void getCSRDataDiffusionMatrixBoundary(std::shared_ptr< const AMP::LinearAlgebra::Vector > E_vec, std::shared_ptr< const AMP::LinearAlgebra::Vector > T_vec, size_t row, std::vector< size_t > &cols, std::vector< double > &data)
Get cols and data for given row, when the row lives on a process boundary.
std::shared_ptr< AMP::Mesh::BoxMesh::Box > d_globalBox
Global grid index box w/ zero ghosts.
void ghostValuesSolveWrapper(size_t boundaryID, const AMP::Mesh::Point &boundaryPoint, double Eint, double Tint, double &Eg, double &Tg)
std::function< double(size_t boundaryID, const AMP::Mesh::Point &boundaryPoint)> d_robinFunctionE
std::shared_ptr< RadDifOpPJacData > d_data
Representation of this operator as a block 2x2 matrix.
const double d_k11
Constant scaling factors in the PDE.
std::array< size_t, 5 > d_ijk
Placeholder for grid indices. Size 5 is because ArraySize deals with 5 grid indcies.
void ghostValuesSolveWrapper(size_t boundaryID, const AMP::Mesh::Point &boundaryPoint, double Eint, double Tint, double &Eg, double &Tg)
std::shared_ptr< const AMP::Discretization::DOFManager > getScalarDOFManager() const
DOFManager used for each of E and T.
std::shared_ptr< AMP::LinearAlgebra::Vector > createInputVector() const override
Create a multiVector of E and T over the mesh.
std::shared_ptr< FDMeshGlobalIndexingOps > d_meshIndexingOps
Mesh-indexing functions.
void applyBoundary(std::shared_ptr< const AMP::LinearAlgebra::Vector > E_vec, std::shared_ptr< const AMP::LinearAlgebra::Vector > T_vec, std::shared_ptr< AMP::LinearAlgebra::Vector > LE_vec, std::shared_ptr< AMP::LinearAlgebra::Vector > LT_vec)
Apply operator over DOFs living on the boundary of process.
void setBoundaryFunctionT(const std::function< double(size_t boundaryID, const AMP::Mesh::Point &boundaryPoint)> &fn_)
Set the pseudo-Neumann return function for the temperature.
static constexpr size_t WEST
Indices used for referencing WEST, ORIGIN, and EAST entries in Loc3 data structures.
void apply(std::shared_ptr< const AMP::LinearAlgebra::Vector > ET, std::shared_ptr< AMP::LinearAlgebra::Vector > LET) override
Compute LET = L(ET)
void getNNDataBoundary(std::shared_ptr< const AMP::LinearAlgebra::Vector > E_vec, std::shared_ptr< const AMP::LinearAlgebra::Vector > T_vec, std::array< size_t, 3 > &ijk, size_t dim, std::array< double, 3 > &ELoc3, std::array< double, 3 > &TLoc3)
std::shared_ptr< AMP::ArraySize > d_localArraySize
Local array size.
void applyInterior(std::shared_ptr< const AMP::LinearAlgebra::Vector > E_vec, std::shared_ptr< const AMP::LinearAlgebra::Vector > T_vec, std::shared_ptr< AMP::LinearAlgebra::Vector > LE_vec, std::shared_ptr< AMP::LinearAlgebra::Vector > LT_vec)
Apply operator over DOFs living on the interior of process.
std::shared_ptr< AMP::Mesh::BoxMesh::Box > d_localBox
Local grid index box w/ zero ghosts.
const std::vector< double > & getMeshSize() const
Vector of hx, hy, hz.
std::string type() const override
Return the name of the operator.
std::function< double(size_t boundaryID, const AMP::Mesh::Point &boundaryPoint)> d_robinFunctionE
std::shared_ptr< AMP::Database > d_db
Parameters required by the discretization.
AMP::Mesh::GeomType CellCenteredGeom
Placeholder for geometry that results in cell-centered data.
const double d_k11
Constant scaling factors in the PDE.
std::function< double(size_t boundaryID, const AMP::Mesh::Point &boundaryPoint)> d_pseudoNeumannFunctionT
bool isValidVector(std::shared_ptr< const AMP::LinearAlgebra::Vector > ET) override
E and T must be positive.
void setBoundaryFunctionE(const std::function< double(size_t boundaryID, const AMP::Mesh::Point &boundaryPoint)> &fn_)
Set the Robin return function for the energy.
std::shared_ptr< AMP::Discretization::DOFManager > d_scalarDOFMan
DOFManager for E and T individually.
std::shared_ptr< AMP::Mesh::BoxMesh > d_BoxMesh
Mesh; keep a pointer to save having to downcast repeatedly.
std::vector< double > d_rh2
Reciprocal squares of mesh sizes.
RadDifOp(std::shared_ptr< const AMP::Operator::OperatorParameters > params)
Constructor.
AMP::Mesh::GeomType getGeomType() const
Geometry used in the mesh.
std::vector< double > d_h
Mesh sizes, hx, hy, hz. We compute these based on the incoming mesh.
std::shared_ptr< AMP::Discretization::multiDOFManager > d_multiDOFMan
Mesh-related data.
std::shared_ptr< AMP::Operator::OperatorParameters > getJacobianParameters(AMP::LinearAlgebra::Vector::const_shared_ptr u_in) override
std::shared_ptr< AMP::Mesh::BoxMesh::Box > d_globalBox
Global grid index box w/ zero ghosts.
std::shared_ptr< ParameterBase > shared_ptr
GeomType
Enumeration for basic mesh-based quantities.
Definition MeshID.h:12
std::shared_ptr< AMP::LinearAlgebra::Matrix > d_T
std::shared_ptr< AMP::LinearAlgebra::Vector > r_EE
std::shared_ptr< AMP::LinearAlgebra::Vector > r_ET
std::shared_ptr< AMP::LinearAlgebra::Vector > r_TE
std::tuple< std::shared_ptr< AMP::LinearAlgebra::Matrix >, std::shared_ptr< AMP::LinearAlgebra::Matrix >, std::shared_ptr< AMP::LinearAlgebra::Vector >, std::shared_ptr< AMP::LinearAlgebra::Vector >, std::shared_ptr< AMP::LinearAlgebra::Vector >, std::shared_ptr< AMP::LinearAlgebra::Vector > > get()
Getter routine; any external updates to the private data members below done via this.
std::shared_ptr< AMP::LinearAlgebra::Vector > r_TT
std::shared_ptr< AMP::LinearAlgebra::Matrix > d_E
Members used to store matrix components.



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