Chi-Tech
chi_ffinter_volume_initialize.cc
Go to the documentation of this file.
2
3#include "chi_runtime.h"
4#include "chi_log.h"
5
9
10//###################################################################
11/**Initializes the volume field function interpolation.*/
13{
14 Chi::log.Log0Verbose1() << "Initializing volume interpolator.";
15 //================================================== Check grid available
16 if (field_functions_.empty())
17 throw std::logic_error("Unassigned field function in volume field "
18 "function interpolator.");
19
20 if (logical_volume_ == nullptr)
21 throw std::logic_error("Unassigned logical volume in volume field function"
22 "interpolator.");
23
24 const auto& grid =
25 field_functions_.front()->GetSpatialDiscretization().Grid();
26
27 //================================================== Find cells inside volume
28 for (const auto& cell : grid.local_cells)
29 if (logical_volume_->Inside(cell.centroid_))
30 cell_local_ids_inside_logvol_.push_back(cell.local_id_);
31}
static chi::ChiLog & log
Definition: chi_runtime.h:81
LogStream Log0Verbose1()
Definition: chi_log.h:234
std::vector< chi_physics::FieldFunctionGridBasedPtr > field_functions_
std::vector< uint64_t > cell_local_ids_inside_logvol_
std::shared_ptr< chi_mesh::LogicalVolume > logical_volume_