WARPXM v1.10.0
Loading...
Searching...
No Matches
spatial_solver.h
Go to the documentation of this file.
1#ifndef WMSPATIALSOLVER_H
2#define WMSPATIALSOLVER_H
3
4// Wm includes
5#include "dfem/dfem.h"
8
9#include <memory>
10
11// forward declarations
12class WmMemoryObject;
13
14namespace wxm
15{
16namespace dfem
17{
18namespace solver
19{
20
32{
33protected:
34 std::vector<size_t> rhs_idcs_;
35 std::vector<size_t> all_idcs_;
36
37public:
42 bool test_dt = true;
43
44 std::vector<std::unique_ptr<WmApplication>> _apps;
45
47
48 spatial_solver_t() = default;
49
50 ~spatial_solver_t() override = default;
51
56 void setup(const WxCryptSet& wxc) override;
57
64 virtual const std::shared_ptr<TimestepConstraint>
65 solve(const real time, const variables_type& input, variables_type& output) = 0;
66
67 virtual void Barrier(const WxMsgBase& msg, const real time, variables_type& output)
68 {
69 }
70
71 std::vector<wxm::array::patch_array_t*>
73
77 virtual const WxRange& element_periphery_range() const = 0;
78
82 virtual const WxRange& element_interior_range() const = 0;
83
88 virtual const WxRange& element_full_range() const = 0;
89
90 // TODO: this is only here because zero_fluxes isn't designed to
91 // take advantage of scopes yet. Need to fix in ndg_t
92 virtual void zero_fluxes() = 0;
93
94 const std::vector<size_t>& get_output_indices() const
95 {
96 return rhs_idcs_;
97 }
98
105 std::vector<size_t> convert_to_rhs_indexes(const std::vector<int>& indexes) const;
106
110 virtual size_t get_num_dof() const = 0;
111
112 // unused, but override just to satisfy WmPatchProcess interface
113 // spatial_solver probably shouldn't be a patch process, but this is the easiest
114 // way to get something which needs one object per local patch
115 void process() override
116 {
117 }
118};
119
121} // namespace solver
122} // namespace dfem
123} // namespace wxm
124
125#endif // WMSPATIALSOLVER_H
The WmPatchProcess class is a base class for processes that are broken up onto separate sections of t...
Definition: wmpatchprocess.h:26
WxCryptSet extends WxCrypt by providing, in addition to name-value pairs, an set of named WxCryptSets...
Definition: wxcryptset.h:35
Provides an abstract interface for message based communication between different processes.
Definition: wxmsgbase.h:22
WxRange represents a hyper-rectangular domain of an n-dimensional space of integers.
Definition: wxrange.h:23
The WmSpatialSolver class is a base class for spatial sovers.
Definition: spatial_solver.h:32
std::vector< std::unique_ptr< WmApplication > > _apps
Definition: spatial_solver.h:44
wxm::temporal_solver::variables_type variables_type
Definition: spatial_solver.h:46
void setup(const WxCryptSet &wxc) override
Setup the spatial solver using the cryptset.
bool test_dt
True if this special solver should compute a stability-based recommended time step.
Definition: spatial_solver.h:42
virtual const WxRange & element_periphery_range() const =0
Get a range of elements associated with the periphery.
virtual const WxRange & element_full_range() const =0
Get a range of elements associated with the entire patch (periphery+interior)
std::vector< size_t > convert_to_rhs_indexes(const std::vector< int > &indexes) const
Converts a vector of indexes to RHS indexes TODO: probably can remove at some point in the future?
std::vector< size_t > rhs_idcs_
Definition: spatial_solver.h:34
virtual const WxRange & element_interior_range() const =0
Get a range of elements associated with the interior.
std::vector< size_t > all_idcs_
Definition: spatial_solver.h:35
virtual void Barrier(const WxMsgBase &msg, const real time, variables_type &output)
Definition: spatial_solver.h:67
~spatial_solver_t() override=default
std::vector< wxm::array::patch_array_t * > get_patch_arrays(const variables_type &in) const
const std::vector< size_t > & get_output_indices() const
Definition: spatial_solver.h:94
void process() override
Definition: spatial_solver.h:115
virtual size_t get_num_dof() const =0
Gets the number of degrees of freedom per element per component.
virtual const std::shared_ptr< TimestepConstraint > solve(const real time, const variables_type &input, variables_type &output)=0
Solves the spatial system.
std::vector< std::pair< wxm::variable::distributed_variable_t *, size_t > > variables_type
Definition: wmtemporalsolver.h:47
Base namespace for everything not included in the global namespace.
Definition: field_source.h:8
#define real
Definition: wmoclunstructuredreconstruction.h:11