Go to the documentation of this file.
21 #ifndef THUNDEREGG_PATCHSOLVER_H
22 #define THUNDEREGG_PATCHSOLVER_H
54 std::shared_ptr<const GhostFiller<D>> ghost_filler;
67 , ghost_filler(ghost_filler.
clone())
109 if constexpr (ENABLE_DEBUG) {
119 domain.
getTimer()->startDomainTiming(domain.
getId(),
"Total Patch Solve");
123 domain.
getTimer()->start(
"Single Patch Solve");
129 domain.
getTimer()->stop(
"Single Patch Solve");
133 domain.
getTimer()->stopDomainTiming(domain.
getId(),
"Total Patch Solve");
144 if constexpr (ENABLE_DEBUG) {
153 domain.
getTimer()->startDomainTiming(domain.
getId(),
"Total Patch Smooth");
155 ghost_filler->fillGhost(u);
158 domain.
getTimer()->startPatchTiming(pinfo.id, domain.
getId(),
"Single Patch Solve");
164 domain.
getTimer()->stopPatchTiming(pinfo.id, domain.
getId(),
"Single Patch Solve");
168 domain.
getTimer()->stopDomainTiming(domain.
getId(),
"Total Patch Smooth");
bool hasTimer() const
Check if the Domain has a timer associated with it.
Definition: Domain.h:335
const Domain< D > & getDomain() const
Get the Domain object.
Definition: PatchSolver.h:84
virtual void apply(const Vector< D > &f, Vector< D > &u) const override
Solve all the patches in the domain, assuming zero boundary conditions for the patches.
Definition: PatchSolver.h:107
std::shared_ptr< Timer > getTimer() const
Get the Timer object.
Definition: Domain.h:330
virtual PatchSolver< D > * clone() const override=0
Clone this patch solver.
Solves the problem on the patches using a specified interface value.
Definition: PatchSolver.h:42
virtual ~PatchSolver()
Destroy the Patch Solver object.
Definition: PatchSolver.h:72
virtual void smooth(const Vector< D > &f, Vector< D > &u) const override
Solve all the patches in the domain, using the values in u for the boundary conditions.
Definition: PatchSolver.h:142
Uses a collection of PatchInfo objects to represent the domain of the problem.
Definition: Domain.h:50
View for accessing data of a patch. It supports variable striding.
Definition: PatchView.h:37
The ThunderEgg namespace.
Definition: BiLinearGhostFiller.h:31
Fills ghost cells on patches.
Definition: GhostFiller.h:36
Contains metadata for a patch.
Definition: PatchInfo.h:51
void setWithGhost(double alpha)
set all values in the vector (including ghost cells)
Definition: Vector.h:404
virtual void solveSinglePatch(const PatchInfo< D > &pinfo, const PatchView< const double, D > &f_view, const PatchView< double, D > &u_view) const =0
Perform a single solve over a patch.
const GhostFiller< D > & getGhostFiller() const
Get the GhostFiller object.
Definition: PatchSolver.h:90
PatchSolver(const Domain< D > &domain, const GhostFiller< D > &ghost_filler)
Construct a new PatchSolver object.
Definition: PatchSolver.h:65
Base class for operators.
Definition: Operator.h:37
PatchView< double, D > getPatchView(int patch_local_index)
Get the View objects for the specified patch index of View object will correspond to component index.
Definition: Vector.h:358
Vector class for use in thunderegg.
Definition: Vector.h:42
const std::vector< PatchInfo< D > > & getPatchInfoVector() const
Get a vector of PatchInfo pointers where index in the vector corresponds to the patch's local index.
Definition: Domain.h:259
Abstract class for smoothing operators.
Definition: Smoother.h:34
int getNumLocalPatches() const
Get the number of local patches.
Definition: Vector.h:316
int getId() const
Get the domain's id.
Definition: Domain.h:341
ThunderEgg runtime exception.
Definition: RuntimeError.h:36