Skip to content
Snippets Groups Projects
Commit 923c13f6 authored by Elias Pipping's avatar Elias Pipping
Browse files

[Cleanup] Move normalStress and FrictionData

parent 720838a3
No related branches found
No related tags found
No related merge requests found
......@@ -178,26 +178,6 @@ int main(int argc, char *argv[]) {
functions.get("velocityDirichletCondition"),
&neumannFunction = functions.get("neumannCondition");
// Set up normal stress, mass matrix, and gravity functional
double normalStress;
{
double volume = 1.0;
for (size_t i = 0; i < dims; ++i)
volume *= (upperRight[i] - lowerLeft[i]);
double area = 1.0;
for (size_t i = 0; i < dims; ++i)
if (i != 1)
area *= (upperRight[i] - lowerLeft[i]);
// volume * gravity * density / area = normal stress
// V * g * rho / A = sigma_n
// m^d * N/kg * kg/m^d / m^(d-1) = N/m^(d-1)
normalStress = -volume * gravity * density / area;
}
FrictionData const frictionData(parset.sub("boundary.friction"),
normalStress);
using MyAssembler = MyAssembler<GridView, dims>;
using Matrix = MyAssembler::Matrix;
using LocalMatrix = Matrix::block_type;
......@@ -235,6 +215,25 @@ int main(int argc, char *argv[]) {
Vector ell(fineVertexCount);
computeExternalForces(0.0, ell);
double normalStress;
{
double volume = 1.0;
for (size_t i = 0; i < dims; ++i)
volume *= (upperRight[i] - lowerLeft[i]);
double area = 1.0;
for (size_t i = 0; i < dims; ++i)
if (i != 1)
area *= (upperRight[i] - lowerLeft[i]);
// volume * gravity * density / area = normal stress
// V * g * rho / A = sigma_n
// m^d * N/kg * kg/m^d / m^(d-1) = N/m^(d-1)
normalStress = -volume * gravity * density / area;
}
FrictionData const frictionData(parset.sub("boundary.friction"),
normalStress);
// {{{ Initial conditions
ScalarVector alpha_initial(fineVertexCount);
alpha_initial =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment