refactor(poly): updated header guards to pragma once
This commit is contained in:
@@ -18,23 +18,24 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// *********************************************************************** */
|
||||
#include "mfem.hpp"
|
||||
#include "polySolver.h"
|
||||
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "polySolver.h"
|
||||
#include "mfem.hpp"
|
||||
|
||||
#include "4DSTARTypes.h"
|
||||
#include "config.h"
|
||||
#include "integrators.h"
|
||||
#include "mfem.hpp"
|
||||
#include "operator.h"
|
||||
#include "polyCoeff.h"
|
||||
#include "probe.h"
|
||||
#include "resourceManager.h"
|
||||
#include "resourceManagerTypes.h"
|
||||
|
||||
#include "quill/LogMacros.h"
|
||||
|
||||
|
||||
@@ -159,8 +160,7 @@ void PolySolver::assembleBlockSystem() {
|
||||
|
||||
// --- Assemble the NonlinearForm (f) ---
|
||||
auto fform = std::make_unique<mfem::NonlinearForm>(m_feTheta.get());
|
||||
mfem::ConstantCoefficient oneCoeff(1.0);
|
||||
fform->AddDomainIntegrator(new polyMFEMUtils::NonlinearPowerIntegrator(oneCoeff, m_polytropicIndex));
|
||||
fform->AddDomainIntegrator(new polyMFEMUtils::NonlinearPowerIntegrator(m_polytropicIndex));
|
||||
// TODO: Add essential boundary conditions to the nonlinear form
|
||||
|
||||
// -- Build the BlockOperator --
|
||||
@@ -183,8 +183,8 @@ void PolySolver::solve() const {
|
||||
// It's safer to get the offsets directly from the operator after finalization
|
||||
const mfem::Array<int>& block_offsets = m_polytropOperator->GetBlockOffsets(); // Assuming a getter exists or accessing member if public/friend
|
||||
mfem::BlockVector state_vector(block_offsets);
|
||||
state_vector.GetBlock(0) = *m_theta;
|
||||
state_vector.GetBlock(1) = *m_phi;
|
||||
state_vector.GetBlock(0) = static_cast<mfem::Vector>(*m_theta);
|
||||
state_vector.GetBlock(1) = static_cast<mfem::Vector>(*m_phi);
|
||||
|
||||
mfem::Vector zero_rhs(block_offsets.Last());
|
||||
zero_rhs = 0.0;
|
||||
@@ -289,7 +289,7 @@ void PolySolver::saveAndViewSolution(const mfem::BlockVector& state_vector) cons
|
||||
}
|
||||
|
||||
// --- Extract the Solution ---
|
||||
if (bool write11DSolution = m_config.get<bool>("Poly:Output:1D:Save", true)) {
|
||||
if (m_config.get<bool>("Poly:Output:1D:Save", true)) {
|
||||
auto solutionPath = m_config.get<std::string>("Poly:Output:1D:Path", "polytropeSolution_1D.csv");
|
||||
auto derivSolPath = "d" + solutionPath;
|
||||
|
||||
@@ -340,7 +340,7 @@ solverBundle PolySolver::setupNewtonSolver() const {
|
||||
LoadSolverUserParams(newtonRelTol, newtonAbsTol, newtonMaxIter, newtonPrintLevel, gmresRelTol, gmresAbsTol,
|
||||
gmresMaxIter, gmresPrintLevel);
|
||||
|
||||
solverBundle solver;
|
||||
solverBundle solver; // Use this solver bundle to ensure lifetime safety
|
||||
solver.solver.SetRelTol(gmresRelTol);
|
||||
solver.solver.SetAbsTol(gmresAbsTol);
|
||||
solver.solver.SetMaxIter(gmresMaxIter);
|
||||
|
||||
Reference in New Issue
Block a user