@@ -327,8 +327,6 @@ EquationSystem::BuildJacobian(mfem::BlockVector & trueX, mfem::BlockVector & tru
327327void
328328EquationSystem ::Mult (const mfem ::Vector & sol , mfem ::Vector & residual ) const
329329{
330- // const_cast<EquationSystem *>(this)->CopyVec(sol, _trueBlockSol);
331- //_trueBlockSol.mfem::Vector::operator=(sol);
332330 static_cast < mfem ::Vector & > (_trueBlockSol ) = sol ;
333331 for (unsigned int i = 0 ; i < _trial_var_names .size (); i ++ )
334332 {
@@ -363,15 +361,14 @@ EquationSystem::Mult(const mfem::Vector & sol, mfem::Vector & residual) const
363361 _BlockResidual .GetBlock (i ).SetSubVector (_ess_tdof_lists .at (i ), 0.0 );
364362 }
365363
366- const_cast < EquationSystem * > ( this ) -> CopyVec ( _BlockResidual , residual );
364+ residual = static_cast < mfem :: Vector & > ( _BlockResidual );
367365 const_cast < EquationSystem * > (this )-> FormLinearSystem (_jacobian , _trueBlockSol , _BlockResidual );
368366 }
369367
370368 residual *= -1.0 ;
371369
372370 if (!_non_linear )
373371 {
374- //_jacobian->AddMult(sol, residual);
375372 residual = 0.0 ;
376373 _jacobian -> Mult (sol , residual );
377374 }
@@ -384,14 +381,8 @@ void
384381TimeDependentEquationSystem ::UpdateEssDerivativeVals (const mfem ::real_t & dt ,
385382 const mfem ::Vector & x_old )
386383{
387- // Update the old vector
388- mfem ::BlockVector block_x_old ;
389- block_x_old .Update (* _block_true_offsets );
390384 mfem ::ParGridFunction u_old_gf ;
391-
392- // Update the old vector
393- CopyVec (x_old , block_x_old );
394- // mfem::BlockVector block_x_old(const_cast<mfem::Vector &>(x_old), *_block_true_offsets);
385+ mfem ::BlockVector block_x_old (const_cast < mfem ::Vector & > (x_old ), * _block_true_offsets );
395386
396387 // Update the xs boundary conditions
397388 ApplyEssentialBCs ();
0 commit comments