1 (edited by johnnyontheweb 11-11-2014 17:00:56)

Topic: tr_shell01 and NodalLoad

Hi all,
I've a problem with the tr_shell01 element and the use of NodalLoad. In the manual (2.6.5) I found the sentence "Body loads are supported. Boundary loads are not supported now". This includes NodalLoads in this limitation?

In attachment you can find a sample file taken from another topic in this forum. When I delete " BodyLoads 1 2 " from each element and adding a nodalload instead of DeadWeight, I get the following error:

____________________________________________________
           OOFEM - Finite Element Solver
        Copyright (C) 1994-2014 Borek Patzak
____________________________________________________
Total number of solution steps     10
_______________________________________________________
Error: (floatarray.C:543)
In oofem::FloatArray::assemble:
dimensions of 'fe' (0) and 'loc' (9) mismatch
_______________________________________________________
No backtrace available
Total 1 error(s) and 0 warning(s) reported
oofem exit code 1

can you help? I get this error only with the Debug version; in Release the analysis won't start and the the error is not displayed.

thanks

Post's attachments

svemirSH.in 25 kb, 12 downloads since 2014-11-11 

You don't have the permssions to download the attachments of this post.

Re: tr_shell01 and NodalLoad

If you run OOFEM through a debugger, you can set a breakpoint in "Logger :: writeELogMsg" and you can see a stack trace. This lets you know where the error occurs.
The problem here is a bug in TRSHELL_01

void
TR_SHELL01 :: giveCharacteristicVector(FloatArray &answer, CharType mtrx, ValueModeType mode, TimeStep *tStep)
//
// returns characteristics vector of receiver accordind to mtrx
//
{
    IntArray loc(9);
    FloatArray aux;

    answer.resize(18);
    answer.zero();

    plate->giveCharacteristicVector(aux, mtrx, mode, tStep);
    loc = {3, 4, 5, 9, 10, 11, 15, 16, 17};
    answer.assemble(aux, loc);

    membrane->giveCharacteristicVector(aux, mtrx, mode, tStep);
    loc = {1, 2, 6, 7, 8, 12, 13, 14, 18};
    answer.assemble(aux, loc);
}

when it is called "ExternalForces".  There are no contributions, so both the plate and the membrane will be returning an empty vector.
TRSHELL01 should check for this.

Re: tr_shell01 and NodalLoad

Thanks for the reply, I have the stack trace.

     oofem.exe!oofem::Logger::writeELogMsg(oofem::Logger::logLevelType level, const char * _func, const char * _file, int _line, const char * format, ...) Line 280    C++
     oofem.exe!oofem::FloatArray::assemble(const oofem::FloatArray & fe, const oofem::IntArray & loc) Line 543    C++
     oofem.exe!oofem::TR_SHELL01::giveCharacteristicVector(oofem::FloatArray & answer, oofem::CharType mtrx, oofem::ValueModeType mode, oofem::TimeStep * tStep) Line 132    C++
     oofem.exe!oofem::EngngModel::giveElementCharacteristicVector(oofem::FloatArray & answer, int num, oofem::CharType type, oofem::ValueModeType mode, oofem::TimeStep * tStep, oofem::Domain * domain) Line 1194    C++
     oofem.exe!oofem::EngngModel::assembleVectorFromElements(oofem::FloatArray & answer, oofem::TimeStep * tStep, oofem::CharType type, oofem::ValueModeType mode, const oofem::UnknownNumberingScheme & s, oofem::Domain * domain, oofem::FloatArray * eNorms) Line 1112    C++
     oofem.exe!oofem::EngngModel::assembleVector(oofem::FloatArray & answer, oofem::TimeStep * tStep, oofem::CharType type, oofem::ValueModeType mode, const oofem::UnknownNumberingScheme & s, oofem::Domain * domain, oofem::FloatArray * eNorms) Line 882    C++
     oofem.exe!oofem::NonLinearStatic::assembleIncrementalReferenceLoadVectors(oofem::FloatArray & _incrementalLoadVector, oofem::FloatArray & _incrementalLoadVectorOfPrescribed, oofem::SparseNonLinearSystemNM::referenceLoadInputModeType _refMode, oofem::Domain * sourceDomain, oofem::TimeStep * tStep) Line 853    C++
     oofem.exe!oofem::NonLinearStatic::proceedStep(int di, oofem::TimeStep * tStep) Line 471    C++
     oofem.exe!oofem::NonLinearStatic::solveYourselfAt(oofem::TimeStep * tStep) Line 345    C++
     oofem.exe!oofem::EngngModel::solveYourself() Line 562    C++
     oofem.exe!oofem::NonLinearStatic::solveYourself() Line 338    C++
>    oofem.exe!main(int argc, char * * argv) Line 286    C++

However, I tried to figure out how to solve: if there are no contributions, I forced to avoid to assemble in FloatArray :: assemble:

void FloatArray :: assemble(const FloatArray &fe, const IntArray &loc)
// Assembles the array fe (typically, the load vector of a finite
// element) to the receiver, using loc as location array.
{
    int n = fe.giveSize();
#  ifdef DEBUG
    // if ( n != loc.giveSize() ) {
        // OOFEM_ERROR("dimensions of 'fe' (%d) and 'loc' (%d) mismatch", fe.giveSize(), loc.giveSize() );
    // }

#  endif

    if (n == loc.giveSize()) {
        for ( int i = 1; i <= n; i++ ) {
            int ii = loc.at(i);
            if ( ii ) { // if non 0 coefficient,
                this->at(ii) += fe.at(i);
            }
        }
    }
}

So, the section "#  ifdef DEBUG" is no more used. Do you think it could be right? I'm making a simplier example to check results.

(sorry, at this point this topic should be in Developed discussion...)

Thanks

Re: tr_shell01 and NodalLoad

It could be argued how FloatArray :: assemble should treat an empty "fe"-vector. Should it be just ignored? It's a sensible approach, sure.
But it should definitely check to see that you aren't trying to add a vector of size 10 using a location array of size 5.

Your change in floatarray would produce correct results in this particular case, but in general, it is not properly checking sizes.

But I would argue that trying to assemble a vector of zero size indicates indicates some bug in the code in most cases. That is why I said that TR_SHELL01 is the code that has the bug, and it should be corrected there, i.e. TR_SHELL01 should check if the size is nonzero, and only call assemble in those cases.

5 (edited by johnnyontheweb 11-11-2014 23:19:24)

Re: tr_shell01 and NodalLoad

I absolutely agree, I'm changing TR_SHELL01 :: giveCharacteristicVector as you suggested:

    if (aux.giveSize() == loc.giveSize())     answer.assemble(aux, loc);

However, with a simpler example (see attachment), the code works but gives strange results.
Can you please have a look to the attached input deck, to see if it's wrong in any part? The model represents 2 wall not connected each other but both bounded at 2 base nodes.

thanks a lot

Post's attachments

2paretiBnomolle2.in 36.14 kb, 6 downloads since 2014-11-11 

You don't have the permssions to download the attachments of this post.

Re: tr_shell01 and NodalLoad

Regarding the code;
I would actually prefer the previous case you had before editing.

if (aux.giveSize() == loc.giveSize())     answer.assemble(aux, loc);

What if, later, "aux" turned out to be of length 5? It would indicate something was broken, and this code would skip it. The zero sized aux-vector is a documented intended return value (if the element has no contributions), so it should be given special treatment (the if-clause is not to check for errors here). I have committed some changes, as I saw some need to clean up a bit of code in tr_shell01 as well. The changes will be merged into oofem.org soon.

Re: tr_shell01 and NodalLoad

I tried running your new input file, and the problem is the tangent is singular. More specifically, the membrane part doesn't seem to be capable of computing the secant matrix requested, and returns a zero matrix. I can't find a good reason for this though, and I'm currently debugging it.

Re: tr_shell01 and NodalLoad

I found a bug in "computeVolumeAround" when used with the membrane element, which would only work properly if the shell lies in the X-Y plane.

I fixed it, and it's commited to my github repo. I will merge it with the oofem.org repo soon.

Re: tr_shell01 and NodalLoad

Thanks for your help; if I understand well, to see immediatly the changes I have to pull from https://github.com/Micket/oofem ?

Re: tr_shell01 and NodalLoad

Yes, but i will hopefully merge the changes very soon

Re: tr_shell01 and NodalLoad

Thanks, I downloaded corrected files and they work fine. I had to comment out some functions which are in your git repo and not in oofem.git; for the rest of the changes I'll wait your merge.

Only one last question: can you confirm that in OOFEM there aren't any quadrilateral shell (4 node plate + membrane) element? I dig in the manual, only 3 node shells seems to be available.

Re: tr_shell01 and NodalLoad

There is one 4 node shell, and that's Quad1MindlinShell3D. It requires underintegration to be any good though. You can read the discussion here http://www.oofem.org/forum/viewtopic.php?id=1148
I would say it's a *bit* experimental yet (though I'm fairly certain the most serious bugs are worked out), but I haven't done any extensive checking.

Re: tr_shell01 and NodalLoad

Thanks, I has already read that topic before posting, but to me the Quad1MindlinShell3D elements are not working properly; now I'll do some test with the flag "reducedintegration".

Re: tr_shell01 and NodalLoad

Using Quad1MindlinShell3d I get:

C:\oofem\Debug>oofem -f 2pareti2.in
____________________________________________________
           OOFEM - Finite Element Solver
        Copyright (C) 1994-2014 Borek Patzak
____________________________________________________
Total number of solution steps     10


Solving       [step number     1.0, time = 0.000000e+00]

NRSolver: Iteration ForceError DisplError
--------------------------------------------------------
_______________________________________________________
Error: (floatarray.C:671)
In oofem::FloatArray::beProductOf:
dimension mismatch
_______________________________________________________
No backtrace available
Total 1 error(s) and 0 warning(s) reported
oofem exit code 1

Re: tr_shell01 and NodalLoad

That must be the result of a bug in quad1mindlin.
But without either input file or stack trace from a debugger, I cannot help to debug it any further than that.

16 (edited by johnnyontheweb 22-11-2014 16:34:55)

Re: tr_shell01 and NodalLoad

In attachment the input file.

Call stack:

>    oofem.exe!oofem::FloatArray::beProductOf(const oofem::FloatMatrix & aMatrix, const oofem::FloatArray & anArray) Riga 671    C++
     oofem.exe!oofem::FloatArray::rotatedWith(oofem::FloatMatrix & r, char mode) Riga 777    C++
     oofem.exe!oofem::Element::computeVectorOf(const oofem::IntArray & dofIDMask, oofem::ValueModeType u, oofem::TimeStep * tStep, oofem::FloatArray & answer, bool padding) Riga 136    C++
     oofem.exe!oofem::Quad1MindlinShell3D::giveInternalForcesVector(oofem::FloatArray & answer, oofem::TimeStep * tStep, int useUpdatedGpRecord) Riga 282    C++
     oofem.exe!oofem::StructuralElement::giveCharacteristicVector(oofem::FloatArray & answer, oofem::CharType mtrx, oofem::ValueModeType mode, oofem::TimeStep * tStep) Riga 1000    C++
     oofem.exe!oofem::EngngModel::giveElementCharacteristicVector(oofem::FloatArray & answer, int num, oofem::CharType type, oofem::ValueModeType mode, oofem::TimeStep * tStep, oofem::Domain * domain) Riga 1194    C++
     oofem.exe!oofem::EngngModel::assembleVectorFromElements(oofem::FloatArray & answer, oofem::TimeStep * tStep, oofem::CharType type, oofem::ValueModeType mode, const oofem::UnknownNumberingScheme & s, oofem::Domain * domain, oofem::FloatArray * eNorms) Riga 1112    C++
     oofem.exe!oofem::EngngModel::assembleVector(oofem::FloatArray & answer, oofem::TimeStep * tStep, oofem::CharType type, oofem::ValueModeType mode, const oofem::UnknownNumberingScheme & s, oofem::Domain * domain, oofem::FloatArray * eNorms) Riga 882    C++
     oofem.exe!oofem::StructuralEngngModel::giveInternalForces(oofem::FloatArray & answer, bool normFlag, int di, oofem::TimeStep * tStep) Riga 146    C++
     oofem.exe!oofem::NonLinearStatic::updateComponent(oofem::TimeStep * tStep, oofem::NumericalCmpn cmpn, oofem::Domain * d) Riga 582    C++
     oofem.exe!oofem::NRSolver::solve(oofem::SparseMtrx * k, oofem::FloatArray * R, oofem::FloatArray * R0, oofem::FloatArray * X, oofem::FloatArray * dX, oofem::FloatArray * F, const oofem::FloatArray & internalForcesEBENorm, double & l, oofem::SparseNonLinearSystemNM::referenceLoadInputModeType rlm, int & nite, oofem::TimeStep * tNow) Riga 284    C++
     oofem.exe!oofem::NonLinearStatic::proceedStep(int di, oofem::TimeStep * tStep) Riga 525    C++
     oofem.exe!oofem::NonLinearStatic::solveYourselfAt(oofem::TimeStep * tStep) Riga 345    C++
     oofem.exe!oofem::EngngModel::solveYourself() Riga 562    C++
     oofem.exe!oofem::NonLinearStatic::solveYourself() Riga 338    C++
     oofem.exe!main(int argc, char * * argv) Riga 286    C++

thanks

Post's attachments

2walls.in 40.86 kb, 2 downloads since 2014-11-21 

You don't have the permssions to download the attachments of this post.

Re: tr_shell01 and NodalLoad

I've located the problem, but there are some complications. I can fix it, but none of the possible solutions are really that attractive.
I will make a quick.


Just for reference;
The problem stems from the elements local coordinate system, in combination with plate+membrane element.
Since many elements want to separate unknowns into groups (for example, velocity + pressure, or displacement + rotations), I added convenient functionality to request unknown vectors by specifying dof ids.
However, the implementation of the global to local coordinate system fails to take into account the anything but the default dof ids.
Adding this support would be possible, but it would also add a whole lot of code for many elements, and I'd like to keep them as simple as possible.

Re: tr_shell01 and NodalLoad

Thanks, I'm trying to apply your commit, by I cannot solve an error in Quad1MindlinShell3D :: computeGaussPoints():

integrationRulesArray[0].reset( new GaussIntegrationRule(1, this, 1, 5) );

VS says

error C2228: l'elemento a sinistra di '.reset' deve avere una classe, struttura o unione    C:\oofem\src\sm\quad1mindlinshell3d.C    95    1    sm

May I have to modify also integrationrule.c? Sorry but I'm still learning C++...

Re: tr_shell01 and NodalLoad

I'm thinking this might be an issue introduced by some local changes that you have introduced.
From what I can tell from the error message:

error C2228: the element to the left of '.reset' must have a class, structure or union C: \ oofem \ src \ sm \ quad1mindlinshell3d.C 95 1 sm

"computeGaussPoints" is nearly identical in all elements, and the "reset" function is used in all of them.

Re: tr_shell01 and NodalLoad

Yes you're right, I merged the files more carefully and everything worked.

I have just a final question: if I change in the model the laying plane of the Mindlin shell elements, will it work again? I didn't fully undestand your phrase

the implementation of the global to local coordinate system fails to take into account the anything but the default dof ids

Anyway, the warning you places in element.c was not shown during the analysis; my question is: are the results obtained with mindlinshell3d reliable in any case or it is preferable to use always tr_shell01?

thanks

Re: tr_shell01 and NodalLoad

You need not worry about my comments about the default dof IDs. This is just me having an open document on these issues.

I worked around it for now, by using the function that takes all the elements DOFs. I added the warning in case any other element tried to do the same in the future.

The fact that I just had to make a fix to make quad1mindlinshell3d work at all says quite a bit of the stability; There are no tests for it, and by that meassure, I would have to call it unstable. I would not recommend using it for analysis without making a few tests to see that it is working correctly.
While I understand the need for good shell models in OOFEM, I can't spend so much time developing this, as I'm not payed to develop. The same goes for most others. Unless some of the developers have a need for a model, it is of course unlikely to be added.

If you can find a thorough description of the model you would like to have implemented, help set up input files for regression tests, then I can probably help you with the implementation. Otherwise, I'm afraid, rershell, tr_shell01, and quad1mindlinshell3d are your only options.

Re: tr_shell01 and NodalLoad

Thanks for your reply and for your help. quad1mindlinshell3d is exactly what I needed; I'll do some tests on the results obtained with it with various input decks and I'll let you know.

I'm glad to give help in any way you need; for now it's difficult to me to fully understand the oofem code, and I cannot support the development right now, but I wish to do in a few time.

Re: tr_shell01 and NodalLoad

I did some tests, and the shell in planes XY and XZ works fine (see input and pic inside attached ZIP).

The model with the shells in YZ did not, no errors are reported when launching, except some warnings like this:

Warning: (zznodalrecoverymodel.C:194)
In ZZNodalRecoveryModeloofem::ZZNodalRecoveryModel::recoverValues:
some values of some dofmanagers undetermined

I digged into the code but I cannot still figure out why it happens.

Post's attachments

wallYZ.zip 189.49 kb, 4 downloads since 2014-11-25 

You don't have the permssions to download the attachments of this post.

Re: tr_shell01 and NodalLoad

The problem is a singularity which means the problem isn't actually solved when it tries to export (all NAN values).
I looked into the tests, and found that an incorrect transpose for the local coordinate system transformation.

I have pushed the fix now.
If you could make some smaller test than this, perhaps at a 45degree angle (90 degree angles miss a lot of possible bugs due to all the symmetries), I can add that as an automatic regression test to OOFEM (so that we don't break the element in the future).

The regression test should have few time steps (preferably just 1 time step), have very very few elements (less than 10), so these input files are to big for this purpose.

25 (edited by johnnyontheweb 26-11-2014 22:29:26)

Re: tr_shell01 and NodalLoad

thanks for the support. In attachment you can find the 2 file you asked:
- wallXYrot45x which works fine;
- wallXYrot45y, which does not work: the deformed shape is very strange and presents bending distorsions.

Edit: the 2 meshes have 9 elements and 2 bounded nodes. Please noticed that I cannot use exactly 45° in the program I wrote for the mesh (I used it for buildings), so I used 44.9°, I hope it is the same for you.

Post's attachments

wallXYrot45.zip 1.72 kb, 6 downloads since 2014-11-26 

You don't have the permssions to download the attachments of this post.