Chi-Tech
ff_gridbased_01_updates.cc
Go to the documentation of this file.
2
3#include <petsc.h>
4
5#include "chi_log.h"
6
7// ###################################################################
8/**Updates the field data with a STL vector.*/
10 const std::vector<double>& field_vector)
11{
12 ChiInvalidArgumentIf(field_vector.size() < ghosted_field_vector_->LocalSize(),
13 "Attempted update with a vector of insufficient size.");
14
15 ghosted_field_vector_->Set(field_vector);
16
17 ghosted_field_vector_->CommunicateGhostEntries();
18}
19
20// ###################################################################
21/**Updates the field data with a PETSc vector.*/
23 const Vec& field_vector)
24{
25 ghosted_field_vector_->CopyLocalValues(field_vector);
26
27 ghosted_field_vector_->CommunicateGhostEntries();
28}
#define ChiInvalidArgumentIf(condition, message)
std::unique_ptr< chi_math::GhostedParallelSTLVector > ghosted_field_vector_
void UpdateFieldVector(const std::vector< double > &field_vector)
struct _p_Vec * Vec