-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libROM / MFEM v4.6 updates + Advection-diffusion (#31)
* initial loading of advection-diffusion solver * AdvDiffSolver verified with direct solver. * advection diffusion verified with mms. * component-wise verification with mms for advection-diffusion. * AdvDiffSolver::GetFlowField and AdvDiffFlowPastArray class. still needs debugging. * VectorGridFunctionCoefficient needs mfem v4.6. updated docker. * reflecting librom update * bug fix for SteadyNSSolver: SetMUMPSSolver does not set operator in AssembleOperator. * minor fix in sketches. * StokesSolver now must use SYMMETRIC_INDEFINITE. * Reflect SubMesh updates from MFEM v4.6. * visualization includes flow field. * save stokes flow solution * save flow field only when it is newly computed.
- Loading branch information
1 parent
c7154c9
commit 47cf861
Showing
36 changed files
with
972 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright 2023 Lawrence Livermore National Security, LLC. See the top-level LICENSE file for details. | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
#ifndef SCALEUPROM_ADVDIFF_SOLVER_HPP | ||
#define SCALEUPROM_ADVDIFF_SOLVER_HPP | ||
|
||
#include "poisson_solver.hpp" | ||
#include "stokes_solver.hpp" | ||
|
||
// By convention we only use mfem namespace as default, not CAROM. | ||
using namespace mfem; | ||
|
||
class AdvDiffSolver : public PoissonSolver | ||
{ | ||
|
||
friend class ParameterizedProblem; | ||
|
||
protected: | ||
double Pe = 0.0; // Peclet number | ||
|
||
// coefficient for prescribed velocity field. | ||
// can be analytic function or solution from Stokes/SteadyNS equation. | ||
Array<VectorCoefficient *> flow_coeffs; | ||
|
||
/* | ||
flow solver to obtain the prescribed velocity field. both StokesSolver / SteadyNSSolver can be used. | ||
*/ | ||
StokesSolver *stokes_solver = NULL; | ||
bool load_flow = false; | ||
bool save_flow = false; | ||
std::string flow_file = ""; | ||
|
||
/* grid functions for visualizaing flow field */ | ||
/* NOTE(kevin): this will be set up at SaveVisualization. */ | ||
Array<FiniteElementSpace *> flow_fes; | ||
Array<GridFunction *> flow_visual; | ||
FiniteElementSpace *global_flow_fes = NULL; | ||
Array<GridFunction *> global_flow_visual; | ||
|
||
public: | ||
AdvDiffSolver(); | ||
|
||
virtual ~AdvDiffSolver(); | ||
|
||
void BuildDomainOperators() override; | ||
|
||
// Component-wise assembly | ||
void BuildCompROMElement(Array<FiniteElementSpace *> &fes_comp) override; | ||
|
||
bool Solve() override; | ||
|
||
void SetFlowAtSubdomain(std::function<void(const Vector &, Vector &)> F, const int m=-1); | ||
|
||
void SetParameterizedProblem(ParameterizedProblem *problem) override; | ||
|
||
void SaveVisualization() override; | ||
|
||
protected: | ||
void SetMUMPSSolver() override; | ||
|
||
private: | ||
void GetFlowField(ParameterizedProblem *flow_problem); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.