chombo-discharge
Loading...
Searching...
No Matches
CD_LocationImplem.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
13#ifndef CD_LOCATIONIMPLEM_H
14#define CD_LOCATIONIMPLEM_H
15
16// Our includes
17#include <CD_Location.H>
18#include <CD_NamespaceHeader.H>
19
20inline RealVect
22{
23
25
26 switch (a_position) {
27 case Location::Cell::Center: {
28 ret = RealVect(a_vof.gridIndex()) + 0.5 * RealVect::Unit;
29
30 break;
31 }
32 case Location::Cell::Centroid: {
33 ret = RealVect(a_vof.gridIndex()) + 0.5 * RealVect::Unit + a_ebisbox.centroid(a_vof);
34
35 break;
36 }
37 case Location::Cell::Boundary: {
38 ret = RealVect(a_vof.gridIndex()) + 0.5 * RealVect::Unit + a_ebisbox.bndryCentroid(a_vof);
39
40 break;
41 }
42 default: {
43 MayDay::Error("LeastSquares::position -- bad location input.");
44
45 break;
46 }
47 }
48
49 ret *= a_dx;
50
51 return ret;
52}
53
54inline RealVect
56{
58 const IntVect iv = a_face.gridIndex(Side::Hi);
59
60 switch (a_position) {
61 case Location::Face::Center: {
62 ret = (RealVect(iv) + 0.5 * RealVect::Unit) - 0.5 * BASISREALV(a_face.direction());
63
64 break;
65 }
66 case Location::Face::Centroid: {
67 ret = (RealVect(iv) + 0.5 * RealVect::Unit) - 0.5 * BASISREALV(a_face.direction());
68
69 const RealVect faceCentroid = a_ebisbox.centroid(a_face);
70
71 for (int dir = 0; dir < SpaceDim; dir++) { // Direction a_face is undefined.
72 if (dir != a_face.direction()) {
74 }
75 }
76
77 break;
78 }
79 default: {
80 MayDay::Error("LeastSquares::position - bad location input.");
81
82 break;
83 }
84 }
85
86 ret *= a_dx;
87
88 return ret;
89}
90
91#include <CD_NamespaceFooter.H>
92
93#endif
Declaration of cell positions.
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:38
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26
RealVect position(Location::Cell a_location, const VolIndex &a_vof, const EBISBox &a_ebisbox, const Real &a_dx)
Compute the position (ignoring the "origin) of a Vof.
Definition CD_LocationImplem.H:21
Cell
Enum for distinguishing between cell locations.
Definition CD_Location.H:31
Face
Enum for distinguishing between face locations.
Definition CD_Location.H:41