Skip to content

Commit

Permalink
Solved segmentation fault in non eqp hyperreduction
Browse files Browse the repository at this point in the history
  • Loading branch information
axla-io committed Jul 18, 2023
1 parent ade25bd commit aebb5c7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/prom/nonlinear_elasticity_global_rom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ int main(int argc, char *argv[])
// Setup hyperreduction, using either EQP or sampled DOFs and a sample mesh.

ParFiniteElementSpace *sp_XV_space;
CAROM::Matrix *Hsinv = NULL;
CAROM::Matrix *Hsinv = new CAROM::Matrix(hdim, hdim, false); // Gets resized before use.
const IntegrationRule *ir0 = NULL;

if (ir0 == NULL)
Expand Down Expand Up @@ -916,7 +916,7 @@ int main(int argc, char *argv[])
nsamp_H = hdim;
}

CAROM::Matrix *Hsinv = new CAROM::Matrix(nsamp_H, hdim, false);
Hsinv->setSize(nsamp_H, hdim);
vector<int> sample_dofs(nsamp_H);
if (use_sopt)
{
Expand All @@ -943,6 +943,7 @@ int main(int argc, char *argv[])
myid,
num_procs,
nsamp_H);

}
else
{
Expand Down Expand Up @@ -1099,6 +1100,7 @@ int main(int argc, char *argv[])
{
if (!use_eqp)
{

// Define operator in sample space
soper = new HyperelasticOperator(*sp_XV_space, ess_tdof_list_sp, visc, mu, K);
}
Expand Down Expand Up @@ -1795,7 +1797,8 @@ void RomOperator::Mult_Hyperreduced(const Vector &vx, Vector &dvx_dt) const
z[i] += resEQP[i];
}
else
{ // Lift x- and v-vector
{
// Lift x- and v-vector
// I.e. perform v = v0 + V_v v^, where v^ is the input
V_v_sp->mult(v_librom, *z_v_librom);
V_x_sp->mult(x_librom, *z_x_librom);
Expand Down

0 comments on commit aebb5c7

Please sign in to comment.