Chi-Tech
chi_ffinter_volume.h
Go to the documentation of this file.
1#ifndef CHI_FFINTER_VOLUME_H
2#define CHI_FFINTER_VOLUME_H
3
4#include "../chi_ffinterpolation.h"
6
7#include <petscksp.h>
8
9//###################################################################
10/**Volume-wise field function interpolation.
11 *
12 * This interpolator allows the user to obtain quantities by logical
13 * volume. If no logical volume is assigned to the method it will
14 * default to operating over the entire volume.\n
15 * \n
16 * The method also supports a few primitive operations:
17 * - OP_VOLUME_AVG. Obtains the volume average of the field function
18 * of interest.
19 * - OP_VOLUME_SUM. Obtains the volume integral of the field function
20 * of interest.*/
23{
24protected:
25 std::shared_ptr<chi_mesh::LogicalVolume> logical_volume_ = nullptr;
27 std::string op_lua_func_;
28 double op_value_ = 0.0;
29
30private:
31 std::vector<uint64_t> cell_local_ids_inside_logvol_;
32
33public:
35 FieldFunctionInterpolation(ff_interpolation::Type::VOLUME)
36 { }
37 std::shared_ptr<chi_mesh::LogicalVolume>&
39
41
42 std::string& GetOperationLuaFunction() {return op_lua_func_;}
43
44 double& GetOpValue() {return op_value_;}
45
46 //01
47 void Initialize() override;
48
49 //02
50 void Execute() override;
51
52 double CallLuaFunction(double ff_value, int mat_id) const;
53
54 std::string GetDefaultFileBaseName() const override
55 {return "ZVFFI";}
56 void ExportPython(std::string base_name) override {}
57};
58
59
60#endif
ff_interpolation::Type Type() const
void ExportPython(std::string base_name) override
ff_interpolation::Operation & GetOperationType()
double CallLuaFunction(double ff_value, int mat_id) const
std::vector< uint64_t > cell_local_ids_inside_logvol_
std::string GetDefaultFileBaseName() const override
std::shared_ptr< chi_mesh::LogicalVolume > logical_volume_
std::shared_ptr< chi_mesh::LogicalVolume > & GetLogicalVolume()