nutofem / nuto

NuTo - yet another finite element library
https://nuto.readthedocs.io
Boost Software License 1.0
17 stars 5 forks source link

Introduce area/thickness as a parameter #271

Open felixheld123 opened 6 years ago

felixheld123 commented 6 years ago

The mechanical momentum equation contains the area (1D), or thickness (2D) as a parameter A, that also may depend on the coordinates. There is no parameter in 3D. This quantity is not a parameter at the moment like E, or nu.

Should this also be a parameter? Should the case when A depends on the coordinates also be considered?

If yes, I suggest that this should be a parameter of MomentumBalance, because it is needed there. If also the case of a variable thickness is considered it must be a part of the integrand in Hessian0. The other option I see is, that it is a parameter of the Law.

Psirus commented 6 years ago

It doesn't necessarily need to be at the momentum balance at all. For example, in the PatchTest.cpp, replace

auto MomentumHessian0F = Bind(momentumBalance, &Integrands::MomentumBalance<2>::Hessian0);

with

auto A = [](Eigen::VectorXd x){ return x[0] > 5.0 ? 2.0 : 1.0; };
auto MomentumHessian0F = [&](const CellIpData& cipd)
{
    Eigen::VectorXd x = cipd.GlobalCoordinates();
    DofMatrix<double> elementMatrix;
    elementMatrix(displ, displ) = A(x) * momentumBalance.Hessian0(cipd, 0.0)(displ, displ);
    return elementMatrix;
};
TTitscher commented 6 years ago

Currently, I also add the thickness/area in the gradient/hessian functions. But it feels like a workaround and I find it reasonable to have this parameter. In my understanding, the cell integrates over a volume. This could be a full 3D integration in the reference system. Or this could be a 2D integration multiplied with a thickness, or a 1D integration with an area. So for me, putting an additional parameter (default 1) at the Cell, is fine.

pmueller2 commented 6 years ago

I think the cell integrates over what its shape dictates. In the case of Neumann boundaries you want to integrate over surfaces. If you want to integrate over a volume but because you are clever use surface cells and handle the third coordinate analytically (e.g. multiply by thickness) you can do that by changing the gradient/hessian functions. I do not think that this belongs in any way to the cell.