Computes the divergence vector with the space discretization scheme.
1988 if (requiresDivergenceComputation())
1998 if (isLeafWithVirtualChildren() && node(Nl, Ni-1, Nj, Nk) != 0 && node(Nl, Ni-1, Nj, Nk)->isInternalNode() &&
FluxCorrection)
2000 FluxIn =
Flux( *childCell(-2,0,0), *childCell(-1,0,0), *childCell(0,0,0) , *childCell(1,0,0), 1 );
2003 FluxIn +=
Flux( *childCell(-2,1,0), *childCell(-1,1,0), *childCell(0,1,0), *childCell(1,1,0), 1 );
2007 FluxIn +=
Flux( *childCell(-2,0,1), *childCell(-1,0,1), *childCell(0,0,1), *childCell(1,0,1), 1 );
2008 FluxIn +=
Flux( *childCell(-2,1,1), *childCell(-1,1,1), *childCell(0,1,1), *childCell(1,1,1), 1 );
2016 FluxIn =
Flux( *cousinCell(-2,0,0), *cousinCell(-1,0,0), ThisCell, *cousinCell(1,0,0), 1 );
2021 if (isLeafWithVirtualChildren() && node(Nl, Ni+1, Nj, Nk) != 0 && node(Nl, Ni+1, Nj, Nk)->isInternalNode() &&
FluxCorrection)
2023 FluxOut =
Flux( *childCell(0,0,0), *childCell(1,0,0), *childCell(2,0,0), *childCell(3,0,0), 1 );
2026 FluxOut +=
Flux( *childCell(0,1,0), *childCell(1,1,0), *childCell(2,1,0), *childCell(3,1,0), 1 );
2030 FluxOut +=
Flux( *childCell(0,0,1), *childCell(1,0,1), *childCell(2,0,1), *childCell(3,0,1), 1 );
2031 FluxOut +=
Flux( *childCell(0,1,1), *childCell(1,1,1), *childCell(2,1,1), *childCell(3,1,1), 1 );
2039 FluxOut =
Flux( *cousinCell(-1,0,0), ThisCell, *cousinCell(1,0,0), *cousinCell(2,0,0), 1 );
2044 FluxIn = FluxIn -
ResistiveTerms(ThisCell, *cousinCell(-1,0,0), *cousinCell(0,-1,0), *cousinCell(0,0,-1), 1);
2045 FluxOut = FluxOut -
ResistiveTerms(*cousinCell(1,0,0), ThisCell , *cousinCell(1,-1,0), *cousinCell(1,0,-1), 1);
2061 if (isLeafWithVirtualChildren() && node(Nl, Ni, Nj-1, Nk) != 0 && node(Nl, Ni, Nj-1, Nk)->isInternalNode() &&
FluxCorrection)
2063 FluxIn =
Flux( *childCell(0,-2,0), *childCell(0,-1,0), *childCell(0,0,0), *childCell(0,1,0), 2 );
2064 FluxIn +=
Flux( *childCell(1,-2,0), *childCell(1,-1,0), *childCell(1,0,0) , *childCell(1,1,0), 2 );
2068 FluxIn +=
Flux( *childCell(0,-2,1), *childCell(0,-1,1), *childCell(0,0,1), *childCell(0,1,1), 2 );
2069 FluxIn +=
Flux( *childCell(1,-2,1), *childCell(1,-1,1), *childCell(1,0,1), *childCell(1,1,1), 2 );
2077 FluxIn =
Flux( *cousinCell(0,-2,0), *cousinCell(0,-1,0), ThisCell, *cousinCell(0,1,0), 2 );
2082 if (isLeafWithVirtualChildren() && node(Nl, Ni, Nj+1, Nk) != 0 && node(Nl, Ni, Nj+1, Nk)->isInternalNode() &&
FluxCorrection)
2084 FluxOut =
Flux( *childCell(0,0,0), *childCell(0,1,0), *childCell(0,2,0), *childCell(0,3,0), 2 );
2085 FluxOut +=
Flux( *childCell(1,0,0), *childCell(1,1,0), *childCell(1,2,0), *childCell(1,3,0), 2 );
2089 FluxOut +=
Flux( *childCell(0,0,1), *childCell(0,1,1), *childCell(0,2,1), *childCell(0,3,1), 2 );
2090 FluxOut +=
Flux( *childCell(1,0,1), *childCell(1,1,1), *childCell(1,2,1), *childCell(1,3,1), 2 );
2098 FluxOut =
Flux( *cousinCell(0,-1,0), ThisCell, *cousinCell(0,1,0), *cousinCell(0,2,0), 2 );
2103 FluxIn = FluxIn -
ResistiveTerms(ThisCell, *cousinCell(-1,0,0), *cousinCell(0,-1,0), *cousinCell(0,0,-1), 2);
2104 FluxOut = FluxOut -
ResistiveTerms(*cousinCell(0,1,0), *cousinCell(-1,1,0), ThisCell , *cousinCell(0,1,-1), 2);
2124 if (isLeafWithVirtualChildren() && node(Nl, Ni, Nj, Nk-1) != 0 && node(Nl, Ni, Nj, Nk-1)->isInternalNode() &&
FluxCorrection)
2126 FluxIn =
Flux( *childCell(0,0,-2), *childCell(0,0,-1), *childCell(0,0,0), *childCell(0,0,1), 3 );
2127 FluxIn +=
Flux( *childCell(1,0,-2), *childCell(1,0,-1), *childCell(1,0,0), *childCell(1,0,1), 3 );
2128 FluxIn +=
Flux( *childCell(0,1,-2), *childCell(0,1,-1), *childCell(0,1,0), *childCell(0,1,1), 3 );
2129 FluxIn +=
Flux( *childCell(1,1,-2), *childCell(1,1,-1), *childCell(1,1,0), *childCell(1,1,1), 3 );
2136 FluxIn =
Flux( *cousinCell(0,0,-2), *cousinCell(0,0,-1), ThisCell, *cousinCell(0,0,1), 3 );
2142 if (isLeafWithVirtualChildren() && node(Nl, Ni, Nj, Nk+1) != 0 && node(Nl, Ni, Nj, Nk+1)->isInternalNode() &&
FluxCorrection)
2144 FluxOut =
Flux( *childCell(0,0,0), *childCell(0,0,1), *childCell(0,0,2), *childCell(0,0,3), 3 );
2145 FluxOut +=
Flux( *childCell(1,0,0), *childCell(1,0,1), *childCell(1,0,2), *childCell(1,0,3), 3 );
2146 FluxOut +=
Flux( *childCell(0,1,0), *childCell(0,1,1), *childCell(0,1,2), *childCell(0,1,3), 3 );
2147 FluxOut +=
Flux( *childCell(1,1,0), *childCell(1,1,1), *childCell(1,1,2), *childCell(1,1,3), 3 );
2154 FluxOut =
Flux( *cousinCell(0,0,-1), ThisCell, *cousinCell(0,0,1), *cousinCell(0,0,2), 3 );
2159 FluxIn = FluxIn -
ResistiveTerms(ThisCell, *cousinCell(-1,0,0), *cousinCell(0,-1,0), *cousinCell(0,0,-1), 3);
2160 FluxOut = FluxOut -
ResistiveTerms(*cousinCell(0,0,1), *cousinCell(-1,0,1), *cousinCell(0,-1,1), ThisCell , 3);
2175 if (isInternalNode())
Standard class for every vector in Carmen.
Definition: Vector.h:29
bool Resistivity
Definition: Parameters.cpp:120
void setDivergence(const int QuantityNo, const real UserAverage)
Identical to void setAverage (int QuantityNo, real UserAverage), but for the divergence vector...
Definition: Cell.h:1019
int ChildNb
Definition: Parameters.cpp:213
Vector Source(Cell &UserCell)
Returns the source term in the cell UserCell.
Definition: Source.cpp:23
real auxvar
Definition: Parameters.cpp:141
int Dimension
Definition: Parameters.cpp:74
bool FluxCorrection
Definition: Parameters.cpp:143
real divergence(const int QuantityNo) const
Returns the component no. QuantityNo of the divergence vector.
Definition: Cell.h:1192
real size(const int AxisNo) const
Returns the cell size in the direction AxisNo.
Definition: Cell.h:1095
real average(const int QuantityNo) const
Returns the component no. QuantityNo of the cell-average value.
Definition: Cell.h:1128
Vector ResistiveTerms(Cell &Cell1, Cell &Cell2, Cell &Cell3, Cell &Cell4, int AxisNo)
Returns the resistive source terms in the cell UserCell.
Definition: ResistiveTerms.cpp:11
Vector Flux(Cell &Cell1, Cell &Cell2, Cell &Cell3, Cell &Cell4, int AxisNo)
Returns the flux at the interface between Cell2 and Cell3. Here a 4-point space scheme is used...
Definition: Flux.cpp:22
real PsiGrad
Definition: Parameters.cpp:139
void computeDivergence()
Computes the divergence vector with the space discretization scheme.
Definition: Node.cpp:1977
real value(const int n) const
Returns the value of the component n.
Definition: Vector.h:565
real Bdivergence
Definition: Parameters.cpp:138
#define real
Definition: PreProcessor.h:31