Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
8b46f8c9
Commit
8b46f8c9
authored
May 31, 2017
by
Gabriele Seitz
Browse files
[box] rename function scv.index() in scv.indexInElement()
parent
432332e8
Changes
23
Hide whitespace changes
Inline
Side-by-side
dumux/common/pointsource.hh
View file @
8b46f8c9
...
...
@@ -389,7 +389,7 @@ public:
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
if
(
BoundingBoxTreeHelper
<
dimworld
>::
pointInGeometry
(
scv
.
geometry
(),
globalPos
))
scvIndices
.
push_back
(
scv
.
index
());
scvIndices
.
push_back
(
scv
.
index
InElement
());
}
// for all scvs that where tested positiv add the point sources
// to the element/scv to point source map
...
...
dumux/discretization/box/darcyslaw.hh
View file @
8b46f8c9
...
...
@@ -110,11 +110,11 @@ public:
const
auto
&
volVars
=
elemVolVars
[
scv
];
if
(
enableGravity
)
rho
+=
volVars
.
density
(
phaseIdx
)
*
shapeValues
[
scv
.
index
()][
0
];
rho
+=
volVars
.
density
(
phaseIdx
)
*
shapeValues
[
scv
.
index
InElement
()][
0
];
// the global shape function gradient
DimVector
gradN
;
jacInvT
.
mv
(
shapeJacobian
[
scv
.
index
()][
0
],
gradN
);
jacInvT
.
mv
(
shapeJacobian
[
scv
.
index
InElement
()][
0
],
gradN
);
gradP
.
axpy
(
volVars
.
pressure
(
phaseIdx
),
gradN
);
}
...
...
dumux/discretization/box/elementvolumevariables.hh
View file @
8b46f8c9
...
...
@@ -65,7 +65,7 @@ public:
{
return
globalVolVars
().
volVars
(
eIdx_
,
scvIdx
);
}
const
VolumeVariables
&
operator
[](
const
SubControlVolume
&
scv
)
const
{
return
globalVolVars
().
volVars
(
eIdx_
,
scv
.
index
());
}
{
return
globalVolVars
().
volVars
(
eIdx_
,
scv
.
index
InElement
());
}
// For compatibility reasons with the case of not storing the vol vars.
// function to be called before assembling an element, preparing the vol vars within the stencil
...
...
@@ -137,7 +137,7 @@ public:
{
// TODO: INTERFACE SOLVER
// globalVolVars().problem_().model().boxInterfaceConditionSolver().updateScvVolVars(element, scv, sol);
volumeVariables_
[
scv
.
index
()].
update
(
elemSol
,
globalVolVars
().
problem_
(),
element
,
scv
);
volumeVariables_
[
scv
.
index
InElement
()].
update
(
elemSol
,
globalVolVars
().
problem_
(),
element
,
scv
);
}
}
...
...
@@ -148,10 +148,10 @@ public:
{
return
volumeVariables_
[
scvIdx
];
}
const
VolumeVariables
&
operator
[](
const
SubControlVolume
&
scv
)
const
{
return
volumeVariables_
[
scv
.
index
()];
}
{
return
volumeVariables_
[
scv
.
index
InElement
()];
}
VolumeVariables
&
operator
[](
const
SubControlVolume
&
scv
)
{
return
volumeVariables_
[
scv
.
index
()];
}
{
return
volumeVariables_
[
scv
.
index
InElement
()];
}
//! The global volume variables object we are a restriction of
const
GlobalVolumeVariables
&
globalVolVars
()
const
...
...
dumux/discretization/box/fickslaw.hh
View file @
8b46f8c9
...
...
@@ -115,12 +115,12 @@ public:
const
auto
&
volVars
=
elemVolVars
[
scv
];
// density interpolation
rho
+=
useMoles
?
volVars
.
molarDensity
(
phaseIdx
)
*
shapeValues
[
scv
.
index
()][
0
]
:
volVars
.
density
(
phaseIdx
)
*
shapeValues
[
scv
.
index
()][
0
];
rho
+=
useMoles
?
volVars
.
molarDensity
(
phaseIdx
)
*
shapeValues
[
scv
.
index
InElement
()][
0
]
:
volVars
.
density
(
phaseIdx
)
*
shapeValues
[
scv
.
index
InElement
()][
0
];
// the mole/mass fraction gradient
GlobalPosition
gradI
;
jacInvT
.
mv
(
shapeJacobian
[
scv
.
index
()][
0
],
gradI
);
jacInvT
.
mv
(
shapeJacobian
[
scv
.
index
InElement
()][
0
],
gradI
);
gradI
*=
useMoles
?
volVars
.
moleFraction
(
phaseIdx
,
compIdx
)
:
volVars
.
massFraction
(
phaseIdx
,
compIdx
);
gradX
+=
gradI
;
...
...
dumux/discretization/box/fourierslaw.hh
View file @
8b46f8c9
...
...
@@ -112,7 +112,7 @@ public:
// the mole/mass fraction gradient
GlobalPosition
gradI
;
jacInvT
.
mv
(
shapeJacobian
[
scv
.
index
()][
0
],
gradI
);
jacInvT
.
mv
(
shapeJacobian
[
scv
.
index
InElement
()][
0
],
gradI
);
gradI
*=
volVars
.
temperature
();
gradTemp
+=
gradI
;
}
...
...
dumux/discretization/box/globalvolumevariables.hh
View file @
8b46f8c9
...
...
@@ -80,7 +80,7 @@ public:
volumeVariables_
[
eIdx
].
resize
(
fvGeometry
.
numScv
());
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
volumeVariables_
[
eIdx
][
scv
.
index
()].
update
(
elemSol
,
volumeVariables_
[
eIdx
][
scv
.
index
InElement
()].
update
(
elemSol
,
problem
,
element
,
scv
);
...
...
dumux/discretization/box/subcontrolvolume.hh
View file @
8b46f8c9
...
...
@@ -86,7 +86,7 @@ public:
}
//! The global index of this scv
IndexType
index
()
const
IndexType
index
InElement
()
const
{
return
scvIdx_
;
}
...
...
dumux/discretization/volumevariables.hh
View file @
8b46f8c9
...
...
@@ -91,7 +91,7 @@ public:
*/
static
const
PrimaryVariables
&
extractDofPriVars
(
const
ElementSolutionVector
&
elemSol
,
const
SubControlVolume
&
scv
)
{
return
isBox
?
elemSol
[
scv
.
index
()]
:
elemSol
[
0
];
}
{
return
isBox
?
elemSol
[
scv
.
index
InElement
()]
:
elemSol
[
0
];
}
/*!
* \brief Return the vector of primary variables
...
...
dumux/implicit/box/elementboundarytypes.hh
View file @
8b46f8c9
...
...
@@ -91,7 +91,7 @@ public:
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
int
scvIdxLocal
=
scv
.
index
();
int
scvIdxLocal
=
scv
.
index
InElement
();
(
*
this
)[
scvIdxLocal
].
reset
();
if
(
problem
.
model
().
onBoundary
(
scv
))
...
...
dumux/implicit/box/localjacobian.hh
View file @
8b46f8c9
...
...
@@ -146,7 +146,7 @@ public:
VolumeVariables
origVolVars
(
curVolVars
);
// add precalculated residual for this scv into the global container
residual
[
dofIdx
]
+=
this
->
residual_
[
scv
.
index
()];
residual
[
dofIdx
]
+=
this
->
residual_
[
scv
.
index
InElement
()];
// calculate derivatives w.r.t to the privars at the dof at hand
for
(
int
pvIdx
=
0
;
pvIdx
<
numEq
;
pvIdx
++
)
...
...
@@ -166,7 +166,7 @@ public:
curVolVars
=
origVolVars
;
// restore the original element solution
curElemSol
[
scv
.
index
()][
pvIdx
]
=
this
->
model_
().
curSol
()[
scv
.
dofIndex
()][
pvIdx
];
curElemSol
[
scv
.
index
InElement
()][
pvIdx
]
=
this
->
model_
().
curSol
()[
scv
.
dofIndex
()][
pvIdx
];
}
// TODO: what if we have an extended source stencil????
...
...
@@ -242,7 +242,7 @@ protected:
// calculate f(x + \epsilon)
// deflect primary variables
curElemSol
[
scv
.
index
()][
pvIdx
]
+=
eps
;
curElemSol
[
scv
.
index
InElement
()][
pvIdx
]
+=
eps
;
delta
+=
eps
;
// update the volume variables connected to the dof
...
...
@@ -268,7 +268,7 @@ protected:
// need to calculate f(x - \epsilon)
// deflect the primary variables
curElemSol
[
scv
.
index
()][
pvIdx
]
-=
delta
+
eps
;
curElemSol
[
scv
.
index
InElement
()][
pvIdx
]
-=
delta
+
eps
;
delta
+=
eps
;
// update the volume variables connected to the dof
...
...
@@ -301,7 +301,7 @@ protected:
template
<
class
T
=
TypeTag
>
typename
std
::
enable_if
<
GET_PROP_VALUE
(
T
,
EnableGlobalVolumeVariablesCache
),
VolumeVariables
>::
type
&
getCurVolVars
(
ElementVolumeVariables
&
elemVolVars
,
const
SubControlVolume
&
scv
)
{
return
this
->
model_
().
nonConstCurGlobalVolVars
().
volVars
(
scv
.
elementIndex
(),
scv
.
index
());
}
{
return
this
->
model_
().
nonConstCurGlobalVolVars
().
volVars
(
scv
.
elementIndex
(),
scv
.
index
InElement
());
}
//! When global volume variables caching is disabled, return the local volvar object
template
<
class
T
=
TypeTag
>
...
...
dumux/implicit/box/localresidual.hh
View file @
8b46f8c9
...
...
@@ -108,7 +108,7 @@ protected:
if
(
scvf
.
boundary
())
{
auto
&&
scv
=
fvGeometry
.
scv
(
scvf
.
insideScvIdx
());
this
->
asImp_
().
evalBoundaryFluxes_
(
element
,
fvGeometry
,
elemVolVars
,
scvf
,
scv
,
bcTypes
[
scv
.
index
()],
elemFluxVarsCache
);
this
->
asImp_
().
evalBoundaryFluxes_
(
element
,
fvGeometry
,
elemVolVars
,
scvf
,
scv
,
bcTypes
[
scv
.
index
InElement
()],
elemFluxVarsCache
);
}
}
}
...
...
@@ -118,7 +118,7 @@ protected:
{
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
auto
scvBcTypes
=
bcTypes
[
scv
.
index
()];
auto
scvBcTypes
=
bcTypes
[
scv
.
index
InElement
()];
if
(
scvBcTypes
.
hasDirichlet
())
this
->
asImp_
().
evalDirichlet_
(
element
,
fvGeometry
,
elemVolVars
,
scv
,
scvBcTypes
);
}
...
...
@@ -149,7 +149,7 @@ protected:
// get the primary variables
const
auto
&
priVars
=
elemVolVars
[
scv
].
priVars
();
this
->
residual_
[
scv
.
index
()][
eqIdx
]
=
priVars
[
pvIdx
]
-
dirichletValues
[
pvIdx
];
this
->
residual_
[
scv
.
index
InElement
()][
eqIdx
]
=
priVars
[
pvIdx
]
-
dirichletValues
[
pvIdx
];
}
}
}
...
...
dumux/implicit/localresidual.hh
View file @
8b46f8c9
...
...
@@ -313,7 +313,7 @@ protected:
// all sub control volumes
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
auto
localScvIdx
=
isBox
?
scv
.
index
()
:
0
;
auto
localScvIdx
=
isBox
?
scv
.
index
InElement
()
:
0
;
const
auto
&
volVars
=
curElemVolVars
[
scv
];
storageTerm_
[
localScvIdx
]
=
asImp_
().
computeStorage
(
scv
,
volVars
);
storageTerm_
[
localScvIdx
]
*=
scv
.
volume
()
*
volVars
.
extrusionFactor
();
...
...
@@ -352,7 +352,7 @@ protected:
// evaluate the volume terms (storage + source terms)
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
auto
localScvIdx
=
isBox
?
scv
.
index
()
:
0
;
auto
localScvIdx
=
isBox
?
scv
.
index
InElement
()
:
0
;
auto
curExtrusionFactor
=
curElemVolVars
[
scv
].
extrusionFactor
();
// subtract the source term from the local rate
...
...
@@ -379,7 +379,7 @@ protected:
// evaluate the volume terms (storage + source terms)
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
auto
localScvIdx
=
isBox
?
scv
.
index
()
:
0
;
auto
localScvIdx
=
isBox
?
scv
.
index
InElement
()
:
0
;
const
auto
&
curVolVars
=
curElemVolVars
[
scv
];
const
auto
&
prevVolVars
=
prevElemVolVars
[
scv
];
...
...
dumux/implicit/problem.hh
View file @
8b46f8c9
...
...
@@ -981,7 +981,7 @@ public:
const
SubControlVolume
&
scv
)
const
{
PrimaryVariables
source
(
0
);
auto
scvIdx
=
isBox
?
scv
.
index
()
:
0
;
auto
scvIdx
=
isBox
?
scv
.
index
InElement
()
:
0
;
auto
key
=
std
::
make_pair
(
this
->
gridView
().
indexSet
().
index
(
element
),
scvIdx
);
if
(
pointSourceMap_
.
count
(
key
))
{
...
...
dumux/mixeddimension/integrationpointsource.hh
View file @
8b46f8c9
...
...
@@ -150,7 +150,7 @@ public:
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
if
(
BoundingBoxTreeHelper
<
dimworld
>::
pointInGeometry
(
scv
.
geometry
(),
globalPos
))
scvIndices
.
push_back
(
scv
.
index
());
scvIndices
.
push_back
(
scv
.
index
InElement
());
}
// for all scvs that where tested positiv add the point sources
// to the element/scv to point source map
...
...
dumux/mixeddimension/subproblemlocaljacobian.hh
View file @
8b46f8c9
...
...
@@ -257,7 +257,7 @@ protected:
VolumeVariables
origVolVars
(
curVolVars
);
// add precalculated residual for this scv into the global container
residual
[
dofIdx
]
+=
this
->
residual_
[
scv
.
index
()];
residual
[
dofIdx
]
+=
this
->
residual_
[
scv
.
index
InElement
()];
// calculate derivatives w.r.t to the privars at the dof at hand
for
(
int
pvIdx
=
0
;
pvIdx
<
numEq
;
pvIdx
++
)
...
...
@@ -277,7 +277,7 @@ protected:
curVolVars
=
origVolVars
;
// restore the original element solution
curElemSol
[
scv
.
index
()][
pvIdx
]
=
this
->
problem_
().
model
().
curSol
()[
scv
.
dofIndex
()][
pvIdx
];
curElemSol
[
scv
.
index
InElement
()][
pvIdx
]
=
this
->
problem_
().
model
().
curSol
()[
scv
.
dofIndex
()][
pvIdx
];
}
// TODO: what if we have an extended source stencil????
}
...
...
@@ -506,7 +506,7 @@ protected:
// this->updateGlobalJacobian_(couplingMatrix, scv.dofIndex(), globalJ, pvIdx, partialDeriv[scv.dofIndex()]);
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
this
->
updateGlobalJacobian_
(
couplingMatrix
,
scv
.
dofIndex
(),
globalJ
,
pvIdx
,
partialDeriv
[
scv
.
index
()]);
this
->
updateGlobalJacobian_
(
couplingMatrix
,
scv
.
dofIndex
(),
globalJ
,
pvIdx
,
partialDeriv
[
scv
.
index
InElement
()]);
}
}
}
...
...
dumux/porousmediumflow/2p2c/implicit/model.hh
View file @
8b46f8c9
...
...
@@ -215,7 +215,7 @@ public:
if
(
priVarSwitch_
().
wasSwitched
(
dofIdxGlobal
))
{
const
auto
elemSol
=
this
->
elementSolution
(
element
,
this
->
curSol
());
this
->
nonConstCurGlobalVolVars
().
volVars
(
scv
.
index
()).
update
(
elemSol
,
this
->
nonConstCurGlobalVolVars
().
volVars
(
scv
()).
update
(
elemSol
,
this
->
problem_
(),
element
,
scv
);
...
...
dumux/porousmediumflow/2pnc/implicit/model.hh
View file @
8b46f8c9
...
...
@@ -233,7 +233,7 @@ public:
auto
dofIdxGlobal
=
scv
.
dofIndex
();
if
(
priVarSwitch_
().
wasSwitched
(
dofIdxGlobal
))
{
this
->
nonConstCurGlobalVolVars
().
volVars
(
scv
.
index
()).
update
(
this
->
curSol
()[
dofIdxGlobal
],
this
->
nonConstCurGlobalVolVars
().
volVars
(
scv
()).
update
(
this
->
curSol
()[
dofIdxGlobal
],
this
->
problem_
(),
element
,
scv
);
...
...
dumux/porousmediumflow/2pncmin/implicit/model.hh
View file @
8b46f8c9
...
...
@@ -233,7 +233,7 @@ public:
auto
dofIdxGlobal
=
scv
.
dofIndex
();
if
(
priVarSwitch_
().
wasSwitched
(
dofIdxGlobal
))
{
this
->
nonConstCurGlobalVolVars
().
volVars
(
scv
.
index
()).
update
(
this
->
curSol
()[
dofIdxGlobal
],
this
->
nonConstCurGlobalVolVars
().
volVars
(
scv
()).
update
(
this
->
curSol
()[
dofIdxGlobal
],
this
->
problem_
(),
element
,
scv
);
...
...
dumux/porousmediumflow/2pncmin/implicit/volumevariables.hh
View file @
8b46f8c9
...
...
@@ -126,7 +126,7 @@ public:
/////////////
// calculate the remaining quantities
/////////////
auto
&&
priVars
=
isBox
?
elemSol
[
scv
.
index
()]
:
elemSol
[
0
];
auto
&&
priVars
=
isBox
?
elemSol
[
scv
.
index
InElement
()]
:
elemSol
[
0
];
sumPrecipitates_
=
0.0
;
for
(
int
sPhaseIdx
=
0
;
sPhaseIdx
<
numSPhases
;
++
sPhaseIdx
)
...
...
@@ -173,7 +173,7 @@ public:
fluidState
.
setTemperature
(
t
);
auto
phasePresence
=
problem
.
model
().
priVarSwitch
().
phasePresence
(
scv
.
dofIndex
());
auto
&&
priVars
=
isBox
?
elemSol
[
scv
.
index
()]
:
elemSol
[
0
];
auto
&&
priVars
=
isBox
?
elemSol
[
scv
.
index
InElement
()]
:
elemSol
[
0
];
/////////////
// set the saturations
...
...
dumux/porousmediumflow/3p3c/implicit/model.hh
View file @
8b46f8c9
...
...
@@ -212,7 +212,7 @@ public:
if
(
priVarSwitch_
().
wasSwitched
(
dofIdxGlobal
))
{
this
->
nonConstCurGlobalVolVars
().
volVars
(
scv
.
index
()).
update
(
this
->
curSol
()[
dofIdxGlobal
],
this
->
nonConstCurGlobalVolVars
().
volVars
(
scv
()).
update
(
this
->
curSol
()[
dofIdxGlobal
],
this
->
problem_
(),
element
,
scv
);
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment