fix(poly): polytrope converges to solution
first commit where the polytrope module converges to a solution. I have not yet validated if it is a correct solution
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "polyMFEMUtils.h"
|
||||
|
||||
#include "warning_control.h"
|
||||
|
||||
namespace polyMFEMUtils {
|
||||
NonlinearPowerIntegrator::NonlinearPowerIntegrator(
|
||||
mfem::Coefficient &coeff,
|
||||
@@ -242,7 +244,11 @@ namespace polyMFEMUtils {
|
||||
y[i] = F[i];
|
||||
}
|
||||
mfem::GridFunction u_gf(C.FESpace());
|
||||
u_gf.SetData(u);
|
||||
|
||||
DEPRECATION_WARNING_OFF
|
||||
u_gf.SetData(u);
|
||||
DEPRECATION_WARNING_ON
|
||||
|
||||
y[lambdaDofOffset] = C.operator()(u_gf);
|
||||
|
||||
// add -lambda * C to the residual
|
||||
@@ -275,8 +281,13 @@ namespace polyMFEMUtils {
|
||||
mfem::SparseMatrix *J_aug = new mfem::SparseMatrix(height, width);
|
||||
// Copy the original Jacobian into the augmented Jacobian
|
||||
for (int i = 0; i < Jnfl_sparse->Height(); i++) {
|
||||
for (int j = 0; j < Jnfl_sparse->Width(); j++) {
|
||||
J_aug->Set(i, j, Jnfl_sparse->Elem(i, j));
|
||||
const int *J_cols = Jnfl_sparse->GetRowColumns(i);
|
||||
const double *J_vals = Jnfl_sparse->GetRowEntries(i);
|
||||
|
||||
for (int jj = 0; jj < Jnfl_sparse->RowSize(i); jj++) {
|
||||
int j = J_cols[jj];
|
||||
double val = J_vals[jj];
|
||||
J_aug->Set(i, j, val);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user