@@ -338,7 +338,7 @@ void PetscVector<T>::add (const T a_in, const NumericVector<T> & v_in)
338338 libmesh_assert (this -> comm ().verify (
339339 static_cast < typename std ::underlying_type < ParallelType > ::type > (this -> type ())));
340340
341- if (this -> type () == GHOSTED )
341+ if (this -> is_effectively_ghosted () )
342342 VecGhostUpdateBeginEnd (this -> comm (), _vec , INSERT_VALUES , SCATTER_FORWARD );
343343
344344 this -> _is_closed = true;
@@ -379,7 +379,7 @@ void PetscVector<T>::scale (const T factor_in)
379379 libmesh_assert (this -> comm ().verify (
380380 static_cast < typename std ::underlying_type < ParallelType > ::type > (this -> type ())));
381381
382- if (this -> type () == GHOSTED )
382+ if (this -> is_effectively_ghosted () )
383383 VecGhostUpdateBeginEnd (this -> comm (), _vec , INSERT_VALUES , SCATTER_FORWARD );
384384}
385385
@@ -421,7 +421,7 @@ void PetscVector<T>::abs()
421421 libmesh_assert (this -> comm ().verify (
422422 static_cast < typename std ::underlying_type < ParallelType > ::type > (this -> type ())));
423423
424- if (this -> type () == GHOSTED )
424+ if (this -> is_effectively_ghosted () )
425425 VecGhostUpdateBeginEnd (this -> comm (), _vec , INSERT_VALUES , SCATTER_FORWARD );
426426}
427427
@@ -486,7 +486,7 @@ PetscVector<T>::operator = (const T s_in)
486486 libmesh_assert (this -> comm ().verify (
487487 static_cast < typename std ::underlying_type < ParallelType > ::type > (this -> type ())));
488488
489- if (this -> type () == GHOSTED )
489+ if (this -> is_effectively_ghosted () )
490490 VecGhostUpdateBeginEnd (this -> comm (), _vec , INSERT_VALUES , SCATTER_FORWARD );
491491 }
492492
@@ -569,7 +569,7 @@ PetscVector<T>::operator = (const PetscVector<T> & v)
569569 libmesh_assert (this -> comm ().verify (
570570 static_cast < typename std ::underlying_type < ParallelType > ::type > (this -> type ())));
571571
572- if (this -> type () == GHOSTED )
572+ if (this -> is_effectively_ghosted () )
573573 VecGhostUpdateBeginEnd (this -> comm (), _vec , INSERT_VALUES , SCATTER_FORWARD );
574574
575575 this -> _is_closed = true;
@@ -610,7 +610,7 @@ PetscVector<T>::operator = (const std::vector<T> & v)
610610 }
611611
612612 // Make sure ghost dofs are up to date
613- if (this -> type () == GHOSTED )
613+ if (this -> is_effectively_ghosted () )
614614 this -> close ();
615615
616616 return * this ;
@@ -969,7 +969,7 @@ void PetscVector<T>::pointwise_mult (const NumericVector<T> & vec1,
969969 libmesh_assert (this -> comm ().verify (
970970 static_cast < typename std ::underlying_type < ParallelType > ::type > (this -> type ())));
971971
972- if (this -> type () == GHOSTED )
972+ if (this -> is_effectively_ghosted () )
973973 VecGhostUpdateBeginEnd (this -> comm (), _vec , INSERT_VALUES , SCATTER_FORWARD );
974974
975975 this -> _is_closed = true;
@@ -993,7 +993,7 @@ void PetscVector<T>::pointwise_divide (const NumericVector<T> & vec1,
993993 libmesh_assert (this -> comm ().verify (
994994 static_cast < typename std ::underlying_type < ParallelType > ::type > (this -> type ())));
995995
996- if (this -> type () == GHOSTED )
996+ if (this -> is_effectively_ghosted () )
997997 VecGhostUpdateBeginEnd (this -> comm (), _vec , INSERT_VALUES , SCATTER_FORWARD );
998998
999999 this -> _is_closed = true;
@@ -1056,7 +1056,7 @@ void PetscVector<T>::create_subvector(NumericVector<T> & subvector,
10561056 parallel_object_only ();
10571057
10581058 libmesh_error_msg_if (
1059- subvector .type () == GHOSTED && ! subvector . is_effectively_serial (),
1059+ subvector .is_effectively_ghosted (),
10601060 "We do not support scattering parallel information to ghosts for subvectors" );
10611061
10621062 this -> _restore_array ();
@@ -1184,7 +1184,7 @@ void PetscVector<T>::_get_array(bool read_only) const
11841184 std ::scoped_lock lock (_petsc_get_restore_array_mutex );
11851185 if (!_array_is_present .load (std ::memory_order_relaxed ))
11861186 {
1187- if (this -> type () != GHOSTED )
1187+ if (! this -> is_effectively_ghosted () )
11881188 {
11891189 if (read_only )
11901190 {
@@ -1243,7 +1243,7 @@ void PetscVector<T>::_restore_array() const
12431243 std ::scoped_lock lock (_petsc_get_restore_array_mutex );
12441244 if (_array_is_present .load (std ::memory_order_relaxed ))
12451245 {
1246- if (this -> type () != GHOSTED )
1246+ if (! this -> is_effectively_ghosted () )
12471247 {
12481248 if (_values_read_only )
12491249 LibmeshPetscCall (VecRestoreArrayRead (_vec , & _read_only_values ));
@@ -1307,7 +1307,7 @@ PetscVector<T>::restore_subvector(std::unique_ptr<NumericVector<T>> subvector,
13071307 Vec subvec = petsc_subvector -> vec ();
13081308 LibmeshPetscCall (VecRestoreSubVector (_vec , parent_is , & subvec ));
13091309
1310- if (this -> type () == GHOSTED )
1310+ if (this -> is_effectively_ghosted () )
13111311 VecGhostUpdateBeginEnd (this -> comm (), _vec , INSERT_VALUES , SCATTER_FORWARD );
13121312
13131313 this -> _is_closed = true;
0 commit comments