fix(poly): coefficients properly handle chain rule

This commit is contained in:
2025-03-18 11:18:46 -04:00
parent 8dcdf92414
commit afc488abd1
4 changed files with 28 additions and 513 deletions

View File

@@ -2,7 +2,7 @@
//
// Copyright (C) 2025 -- The 4D-STAR Collaboration
// File Author: Emily Boudreaux
// Last Modified: February 14, 2025
// Last Modified: March 18, 2025
//
// 4DSSE is free software; you can use it and/or modify
// it under the terms and restrictions the GNU General Library Public
@@ -19,21 +19,23 @@
//
// *********************************************************************** */
#include "mfem.hpp"
#include <iostream>
#include "polyCoeff.h"
namespace polycoeff{
double nonlinearSourceCoeff(const mfem::Vector &x)
{
// double r = x.Norml2();
return 1.0;
double r = x.Norml2();
return std::pow(r, 2);
}
void diffusionCoeff(const mfem::Vector &x, mfem::Vector &v)
{
v.SetSize(3);
for (int i = 0; i < 3; i++) { v(i) = -1; }
double r = x.Norml2();
for (int i = 0; i < 3; i++) {
v(i) = -std::pow(r, 2);
}
}
double x1(const double n)