Topic: Some questions while preparing some patches

I'm currently working on packaging up some patches of the things I've implemented so far, and there are some questions;

1. Element :: giveSpatialDimension(); seems strange. line elements == 1D and triangles == 2D, as they just as well be in 2D or 3D. A truss is a typical line element, but wouldn't make much sense in 1D.

I noticed that the pyramid supg element defines a similar function

int
PY1_3D_SUPG :: giveNumberOfSpatialDimensions()
{
    return 3;
}

but that function is completely useless as it's not used anywhere and not part of any parent class.

I don't see why giveSpatialDimension (or giveNumberOfSpatialDimensions) isn't part of the Element class, and is given as a pure virtual method.

2. Which is the Voigt order used for 3D strain/stress in oofem? I've only worked in 2D until now, so it never occurred to me. I could probably look around in the code and try to deduce it, but that feels risky.

3. For the geometry type, the comment in the header looks like;

* EGT_line_2 - line element with three nodes 1---2---3

but at the few places where it's used (in fact, is more commonly the edge of a triangle or similar), the order is the more common variant 1--3--2. Should this be changed in the comment? Right now i have to add some code in the VTK export tool to flip this around for my edge element.

2

Re: Some questions while preparing some patches

Hi Mikael,

1) the giveNumberOfSpatialDimensions is used at several places (fm/supgelement2.C). For the PY1_3D_SUPG element, it is used by its parent class SUPGElement2. So, its not useless. At present, it is declared at level, when needed - so for example at SUPGElement2 class level. But I see no problem to introduce it at element level already.
2) Do you mean the order of individual stress/strain components in a vector? It is following: eps_x, eps_y, eps_z, gamma_yz, gamma_xz, gamma_xy. Engineering notation.
3) Seems that the comment is not correct, the order should be 1--3--2.

Borek

Re: Some questions while preparing some patches

Thank you for your clarifications Bored,

1) I realized it wasn't a good idea to ask the elements for the number of spatial dimensions, rather i should have used the domain type to determine this anyway.

2) This was exactly what i was after.

3) Good to know, I shall adapt to that order instead.