-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSetFluidGasSolidDensity.h
More file actions
136 lines (112 loc) · 4.57 KB
/
Copy pathSetFluidGasSolidDensity.h
File metadata and controls
136 lines (112 loc) · 4.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// ---------------------------------------------------------------------
//
// Copyright (c) 2019 - 2022 by the IBAMR developers
// All rights reserved.
//
//
// IBAMR is free software and is distributed under the 3-clause BSD
// license. The full text of the license can be found in the file
// COPYRIGHT at the top level directory of IBAMR.
//
// ---------------------------------------------------------------------
/////////////////////// INCLUDE GUARD ////////////////////////////////////
#ifndef included_SetFluidGasSolidDensity
#define included_SetFluidGasSolidDensity
///////////////////////////// INCLUDES ///////////////////////////////////
#include <ibamr/AdvDiffHierarchyIntegrator.h>
#include <ibtk/ibtk_utilities.h>
#include <tbox/Pointer.h>
#include <Variable.h>
namespace IBTK
{
class HierarchyMathOps;
}
/*!
* Pre processing call back function to be hooked into IBAMR::VCINSStaggeredHierarchyIntegratorclass.
*
* \param rho_idx a patch data index for the current density variable maintained by the integrator.
* \param ctx is the pointer to SetFluidGasSolidDensity class object.
*
* \TODO: Let's move this out of the global namespace and use "snake case" for static function names.
*/
void callSetFluidGasSolidDensityCallbackFunction(int rho_idx,
SAMRAI::tbox::Pointer<SAMRAI::hier::Variable<NDIM> > rho_var,
SAMRAI::tbox::Pointer<IBTK::HierarchyMathOps> hier_math_ops,
const int cycle_num,
const double time,
const double current_time,
const double new_time,
void* ctx);
/*!
* \brief Class SetFluidGasSolidDensity is a utility class which sets the fluid and
* solid Eulerian density based on the current level set information
*/
class SetFluidGasSolidDensity
{
public:
/*!
* The only constructor of this class.
*/
SetFluidGasSolidDensity(const std::string& object_name,
SAMRAI::tbox::Pointer<IBAMR::AdvDiffHierarchyIntegrator> adv_diff_solver,
SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM, double> > ls_solid_var,
SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM, double> > ls_gas_var,
const double rho_fluid,
const double rho_gas,
const double rho_solid,
const int ls_reinit_interval,
const double num_solid_interface_cells,
const double num_gas_interface_cells);
/*!
* Destructor for this class.
*/
~SetFluidGasSolidDensity() = default;
/*!
* Set the density based on the current level set information
*/
void setDensityPatchData(int rho_idx,
SAMRAI::tbox::Pointer<SAMRAI::hier::Variable<NDIM> > rho_var,
SAMRAI::tbox::Pointer<IBTK::HierarchyMathOps> hier_math_ops,
const int cycle_num,
const double time,
const double current_time,
const double new_time);
private:
/*!
* Default constructor is not implemented and should not be used.
*/
SetFluidGasSolidDensity() = delete;
/*!
* Default assignment operator is not implemented and should not be used.
*/
SetFluidGasSolidDensity& operator=(const SetFluidGasSolidDensity& that) = delete;
/*!
* Default copy constructor is not implemented and should not be used.
*/
SetFluidGasSolidDensity(const SetFluidGasSolidDensity& from) = delete;
/*!
* Name of this object.
*/
std::string d_object_name;
/*!
* Pointer to advection-diffusion solver.
*/
SAMRAI::tbox::Pointer<IBAMR::AdvDiffHierarchyIntegrator> d_adv_diff_solver;
/*!
* Level set variables
*/
SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM, double> > d_ls_solid_var, d_ls_gas_var;
/*!
* Density of the fluid and solid.
*/
double d_rho_fluid, d_rho_gas, d_rho_solid;
/*!
* Level set reinitialization interval
*/
int d_ls_reinit_interval;
/*!
* Number of interface cells
*/
double d_num_solid_interface_cells, d_num_gas_interface_cells;
}; // SetFluidGasSolidDensity
#endif // #ifndef included_SetFluidGasSolidDensity