previously I had a lagrangian multipliers at every element; however, we are enforcing a global constraint so there need only be one lagrangian multiplier
45 lines
1.0 KiB
C++
45 lines
1.0 KiB
C++
#ifndef POLYSOLVER_H
|
|
#define POLYSOLVER_H
|
|
|
|
#include "mfem.hpp"
|
|
#include <iostream>
|
|
#include <string>
|
|
#include <memory>
|
|
|
|
#include "meshIO.h"
|
|
#include "polyCoeff.h"
|
|
#include "polyMFEMUtils.h"
|
|
|
|
|
|
class PolySolver {
|
|
private:
|
|
double n, order;
|
|
MeshIO meshIO;
|
|
mfem::Mesh& mesh;
|
|
|
|
std::unique_ptr<mfem::H1_FECollection> feCollection;
|
|
|
|
std::unique_ptr<mfem::FiniteElementSpace> feSpace;
|
|
|
|
std::unique_ptr<polyMFEMUtils::CompositeNonlinearIntegrator> compositeIntegrator;
|
|
|
|
std::unique_ptr<mfem::NonlinearForm> nonlinearForm;
|
|
std::unique_ptr<mfem::LinearForm> C; // For the constraint equation
|
|
|
|
std::unique_ptr<mfem::GridFunction> u;
|
|
|
|
std::unique_ptr<mfem::VectorConstantCoefficient> diffusionCoeff;
|
|
std::unique_ptr<mfem::ConstantCoefficient> nonLinearSourceCoeff;
|
|
std::unique_ptr<polyMFEMUtils::GaussianCoefficient> gaussianCoeff;
|
|
|
|
void assembleNonlinearForm();
|
|
void assembleConstraintForm();
|
|
|
|
|
|
public:
|
|
PolySolver(double n, double order);
|
|
~PolySolver();
|
|
void solve();
|
|
};
|
|
|
|
#endif // POLYSOLVER_H
|