feat(poly): lagrangian constrained weak form of 3D lane-Emden

added a basic implimentation of the 3D lane emden equation using a lagrangian multiplier to constrain the value at the center of a spherical domain
This commit is contained in:
2025-02-20 15:28:00 -05:00
parent deab5be0c1
commit 1fd1e624f2
4 changed files with 89 additions and 85 deletions

View File

@@ -1,3 +1,6 @@
#ifndef POLYMFEMUTILS_H
#define POLYMFEMUTILS_H
#include "mfem.hpp"
#include <string>
@@ -183,10 +186,10 @@ namespace polyMFEMUtils {
class AugmentedOperator : public mfem::Operator {
private:
std::unique_ptr<mfem::NonlinearForm> nfl;
std::unique_ptr<mfem::LinearForm> C;
mfem::NonlinearForm &nfl;
mfem::LinearForm &C;
int lambdaDofOffset;
mfem::SparseMatrix *lastJacobian = nullptr;
mutable mfem::SparseMatrix *lastJacobian = nullptr;
public:
AugmentedOperator(mfem::NonlinearForm &nfl_, mfem::LinearForm &C_, int lambdaDofOffset_);
@@ -196,4 +199,6 @@ namespace polyMFEMUtils {
virtual mfem::Operator &GetGradient(const mfem::Vector &x) const override;
};
} // namespace polyMFEMUtils
} // namespace polyMFEMUtils
#endif // POLYMFEMUTILS_H