1 (edited by licui 22-04-2016 10:28:06)

Topic: Problem of "activityltf"

Dears,
I've added a new nonlinear elastic material for my research. It works very well in static analysis, but the result is terrible that asymmetric displacement is got for a symmetric model when I use "activityltf" for a simulation of dam construction process. I think there is something wrong with the solving process, so somebody may tell me how "activityltf" works in the program?
My material code files and input file are attached.
Thanks a lot.

Post's attachments

kgmaterial.C 6.63 kb, 8 downloads since 2016-04-22 

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

Re: Problem of "activityltf"

There is my input file for test.

Post's attachments

test5.in 15.36 kb, 16 downloads since 2016-04-22 

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

3

Re: Problem of "activityltf"

Hi,
the zero value of activityltf simply means that element does not exist yet, so its contributions to the problem are not evaluated and assembled.
This may require some additional effort, for example, when you have nodes solely connected to inactive elements at particular time then these have to be supported or linked to other nodes, as they will receive no stiffness. Seems to me that this can be an issue in your model.

4 (edited by licui 26-04-2016 06:38:14)

Re: Problem of "activityltf"

bp wrote:

Hi,
the zero value of activityltf simply means that element does not exist yet, so its contributions to the problem are not evaluated and assembled.
This may require some additional effort, for example, when you have nodes solely connected to inactive elements at particular time then these have to be supported or linked to other nodes, as they will receive no stiffness. Seems to me that this can be an issue in your model.

Hi,
You mean some b.c.s should be applied to nodes which are only belong to inactive elements, or something else? Please tell me the way in detail.
Moreover, I find that nodes solely connected to inactive elements also get displacement values. I guess the non-zero displacement of the nodes shared by active and inactive elements may cause it. May it influence the next-step calculation?
Thanks a lot.

Re: Problem of "activityltf"

1. When an element gets activated, it uses the current displacements of it's nodes as the "initial displacement" that subtracted when computing strains.

2. If a DOF isn't connected to any (active) elements, then it will cause 1 line/row to be all zeroes in the stiffness matrix. This is a singular problem (but technically still solveable), and it will not work direct solvers (Cholesky, LU). There are several tricks around it
1. Using a CG-solver might work
2. PETSc has flags for adding small values on diagonal positions.
3. You could prescribe the DOF with a Dirichlet b.c. and turn off this b.c. when the connected elements are activated.

6 (edited by licui 29-04-2016 04:17:17)

Re: Problem of "activityltf"

Mikael Öhman wrote:

1. When an element gets activated, it uses the current displacements of it's nodes as the "initial displacement" that subtracted when computing strains.

2. If a DOF isn't connected to any (active) elements, then it will cause 1 line/row to be all zeroes in the stiffness matrix. This is a singular problem (but technically still solveable), and it will not work direct solvers (Cholesky, LU). There are several tricks around it
1. Using a CG-solver might work
2. PETSc has flags for adding small values on diagonal positions.
3. You could prescribe the DOF with a Dirichlet b.c. and turn off this b.c. when the connected elements are activated.

Hi,
1.I've known that it's the tecplot (the software I use to draw figures) who makes nodes solely connected to inactive elements geting displacements.
2.I use the third way (dirichlet b.c.) to deal with it(you can see it in my inputfile attached), but it's still a problem that when the second-layer elements are activitied, asymmetric results are given for symmetric model. Maybe the solver causes it?
3.I get to know that i.c. is given by velocity 'v' or accelerated speed 'a' in the manual. However, if i.c. could be given with displacement, maybe I have a different way to solve my problem.
Thanks a lot.

Post's attachments

test5.in 15.36 kb, file has never been downloaded. 

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

Re: Problem of "activityltf"

Dear Licui, you forgot to attach the file (you have to click the button after selecting the file, common mistake on the forum)

Re: Problem of "activityltf"

Mikael Öhman wrote:

Dear Licui, you forgot to attach the file (you have to click the button after selecting the file, common mistake on the forum)

Hi,
I've attached it above. In fact it is what I uploaded at the first.
Thanks a lot.

Re: Problem of "activityltf"

Hi,
I've done some simplified tests and the results is interesting. I used lspace of rectangular and ladder, lspacebb of ladder and lspace together with lwedge. The results shows different displacements are given for different elements. The rectangular one get symmetric results which are supposed to be, while there is a little difference for ladder elements of lspace and lspacebb, and the last one gets the worst values. (I've attached my input and output files below.)
Is that means element type or number will influence the results while Nonlinear Material and StructuralStatic are used?
One more question is whether displacements, strains or stress can be used for i.c.
Thanks a lot.

Post's attachments

dif-ele.rar 30.99 kb, 6 downloads since 2016-04-29 

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

Re: Problem of "activityltf"

"initial conditions" are meaningless concepts for stationary solvers. If you want to control displacements, then you use boundary conditions.

1. The element type will of course always influence the solution. The "BB" element is incompressible.
I don't see what would break symmetry though. Perhaps a bug in your material model. I haven't used it (i switched the tests over to existing models to debug easier... one problem at the time).

2. You aren't setting up your time functions correctly. There are some inconsistencies between the solvers. I've tried to be consistent in the new solvers, but some of the old ones can't be fixed without breaking backwards compatibility.
The first step in StaticStructural goes from 0.0 to 1.0 (which i think is the most logical choice). Other solvers start from -1.0 to 0.0.
You have to offset the time function here.

Re: Problem of "activityltf"

Hi,
Thanks for your great patience. Sorry to reply so late for some private bussiness.
I'm going to make my material better for oofem, and do some sensitivity analysis.
As for "initial conditions", is it meaningful for StaticStructural method? Boundary condition is impossible to change, but an initial one could be useful to determine a stiffness matrix at the beginning.
Thanks for your reply again.

Re: Problem of "activityltf"

As for "initial conditions", is it meaningful for StaticStructural method?

No, they are completely ignored. I guess we could just re-use that code to do initial guesses (there are a few other alternatives for initial guesses built in already). But.. if you read through the rest of my message you will see how this doesn't matter.

Boundary condition is impossible to change

No they aren't? You can turn them on and off, and change them arbitrarily (at least with staticstructural).

, but an initial one could be useful to determine a stiffness matrix at the beginning.

You should start off with a step that produces a solution within the elastic regime. If you do, then anything you had in mind for initial conditions (initial guess?) would make no difference. The first step when then immediately find the elastic solution, and from there on it's continuation of the analysis like normal.

Re: Problem of "activityltf"

Mikael Öhman wrote:

You should start off with a step that produces a solution within the elastic regime. If you do, then anything you had in mind for initial conditions (initial guess?) would make no difference. The first step when then immediately find the elastic solution, and from there on it's continuation of the analysis like normal.

Thanks for your patient reply again.
Do you mean initial stress/strain will not affect the stiffness matrix in elastic-solving step when a nonlinear material is used? Of course I can use "activityltf" to do it, but I don't know what the solvers do when new elements with old ones work together. The results of my tests is terrible. Even uphill displacements were given by the force of gravity.
Moreover, can you tell me something more about the way to use CG-solver?
Thanks a lot.

Re: Problem of "activityltf"

Based on your comments, I've discovered a bug in the code. Using sets for loads, the contributions assembled even when the element was not activated.
A simple "if ( !element->isActivated(tStep) ) continue;" was missing.
It's pushed to github.com/Micket/oofem
But this would really only have a very minor effect on the results (though, still, should be corrected).


This is still what happens when you activate an element:

1. When an element gets activated, it uses the current displacements of it's nodes as the "initial displacement" that subtracted when computing strains.

epsilon = B * (displacements - initial_displacements)
where "initial_displacements" is stored per each element.
That's it. It's very simple, and it's the *only* thing you can, and should, do.

We don't have any support for "initial stresses". I don't even think the concept is well defined.
Displacements control the strain
The strain controls the stress.
You can only control the displacements, the rest, whatever it ends up being, is implied.


Do you mean initial stress/strain will not affect the stiffness matrix in elastic-solving step when a nonlinear material is used? Of course I can use "activityltf" to do it, but I don't know what the solvers do when new elements with old ones work together.

I don't really know how to answer this.
The stiffness matrix is just a tool to solve the Newton iterations. If you are using so large steps that the initial guess strongly determines which solution you obtain.. then you are using to large timestep. Lower them until the point where the initial *guess* does not matter anymore.
And ActivityLTF is a completely unrelated concept, which has nothing at all to do with the initial guess.


To be perfectly clear: you absolutely *must* use activityltf, no matter what. CG solver, initial guesses/conditions are all just techniques for obtaining equilibrium.. but it doesn't matter.


CG you can use with IML solver or PETSc matrix+solver (you have to compile PETSc for this). Using petsc, specify the flag during runtime

-ksp_type cg

These concepts define the problem:
Equilibrium + ActivityLTF (and by it, the implied initial displacements) + Material model

These concepts define how to solve the given problem:
CG solver, dynamic Dirichlet BCs on loose nodes, Newton iterations, initial guesses on the solution
They should always reach the exact same answer. If the residual = 0, then the problem above is solved, no matter how you did it.

Re: Problem of "activityltf"

I'm glad that my work can do some help to OOFEM, and your answer is really helpful every time.
I noticed that you said we could change b.c. arbitrarily, so some tests were done to get aware of it. There is supposed to be an extra step for it, because any change of conditions during the time step will be ignored. Just like what I do, tests without b.c. get the same results as the ones whose b.c.s are canceled during the time step.
However, I'm still confused how the StaticStructural solver judes whether or not these conditions are activitied. In my tests it seems to choose a time point at the end of time step.
Thanks a lot.

16 (edited by licui 13-05-2016 10:53:25)

Re: Problem of "activityltf"

Moreover, if I want to make the displacement of some nodes zero(but not a constraint), what should I do with the input files or code?
Besides, I'm still confused why the results get asymmetric when new elements are activitied even if it is a very simple one (the input/output file and material code are all attached).
Thanks again.

Re: Problem of "activityltf"

StaticStructural checks if the BCs have activated/deactivated from the previous step, then renumbers the equations and all that when needed.
This is of course done at the target time, for when equilibrium is solved.
Doing any changes to BCs *within* a single timestep is wrong. If you need that high fidelity in your analysis, then you also need to use smaller time steps.
So, the BCs activation needs to change during the time step (after the start of the step, and before the end (target) time of the step).

----------

I want to make the displacement of some nodes zero(but not a constraint)

That is not even theoretically possible. "make displacement zero" === "constraint".  Constraining something without constraints?

---------

For debugging, please test each component separately. Use an existing (simple) material model, to run a minimal test (preferably 2 elements) that produces the problem, and we can help you find what could be wrong.

18 (edited by licui 17-05-2016 09:58:38)

Re: Problem of "activityltf"

Hi Mikael,
I've done some tests by using existing material models, and the results are right so I think there's something wrong with my material code. However, I have no idea where may be wrong. I write the code totally by reference to existing one and it runs well for one-step-static calculations. Can you help me to check it? My material code is attached below.
Thanks a lot.

Post's attachments

kgmaterial.C 6.63 kb, 2 downloads since 2016-05-17 

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

Re: Problem of "activityltf"

You sure like to write out everything out as scalar components, many of them just labeled "x1, x2, ... x9, a7, a8, a9". I have no idea what these represent, and neither would anyone else who reads the code.
All the familiar concepts are completely obfuscated; triple negations, random variable names.

    x3 = j1 * ( sigma22 + sigma33 - 2 * sigma11 );
    x3 = -x3 / x6;

    x4 = j1 * ( sigma11 + sigma33 - 2 * sigma22 );
    x4 = -x4 / x6;

    x5 = j1 * ( sigma22 + sigma11 - 2 * sigma33 );
    x5 = -x5 / x6;

    x7 = j1 * sigma12 / q;
    x8 = j1 * sigma23 / q;
    x9 = j1 * sigma31 / q;

Seems like this is something along the lines of " nu = sigma_dev * J1/sigma_vonMises; "
Why write out the components?!  These bugs would never happen if you stick with vectors
As far as I can tell, you mess up the Voigt order of x7, x8, x9.


This mess of variable names would reduce to something as simple and easy to read as:

    FloatArray sigma_dev, nu;
    const FloatArray &stress = status->giveStressVector();
    double hyd;
    // Keep the data in vector form.
    hyd = StructuralMaterial :: computeDeviatoricVolumetricSplit(dev, stress);
    p = -hyd;
    q = StructuralMaterial :: computeVonMisesStress(stress);

...
    answer.plusDyadUnsym(sigma_dev, sigma_dev, j1/q);
Post's attachments

kgmaterial.C 6.77 kb, 2 downloads since 2016-05-17 

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

Re: Problem of "activityltf"

Hi, Makeal,
Thanks a lot for your suggestions firstly. I'll try my best to make my material code more user-friendly and readable soonly.
I've tried your way of changing b.c. (some nodes are constrained in one step and then set free in the next step) but the results are wrong. The reason is obvious that the strain is completely determined by stress path. So is there any better way to deal with it?
I'm looking forward to your reply.

Re: Problem of "activityltf"

Of course, the strain and stress are unconditionally coupled together by the act of solving for equilibrium. If you don't want the stresses to influence  equilibrium (and thus displacements and strains), then I don't know what you want to solve for.

Locking nodes is just a means to make the problem solveable. It doesn't affect the solution at all compared to CG-solver.

These concepts define the problem:
Equilibrium + ActivityLTF (and by it, the implied initial displacements) + Material model

These concepts define how to solve the given problem:
CG solver, dynamic Dirichlet BCs on loose nodes, Newton iterations, initial guesses on the solution
They should always reach the exact same answer. If the residual = 0, then the problem above is solved, no matter how you did it.

1. Time step one, you have 1 layer of elements active. You obtain displacements for the first layer of nodes.
2. Time step two, you activate the second layer of elements. This second layer of elements use the solution from the first step as their initial displacements (stress free). Then you actually solve for the new mass and stiffness added by the second layer, and you get new displacements for all the nodes on the first and second layer.
3. Time step three, add another of new elements whose initial displacement are those from the solution from step 2. Apply the new mass and compute the new strains and stresses in all elements for all 3 layers.
4. And so on.

That's it. Just activityLTF on each element row.

Locking the otherwise unconnected nodes by B.C is just trick to get the linear sparse solver to work. It doesn't affect the solution at all.

Re: Problem of "activityltf"

Hi,Makael,
I'm sorry that I did not tell you the factors of my model.
1. Firstly I use a nonlinear material whose stiffness is determined by stress path completely.
2. Secondly "Activityltf" is applied but a additional condition is also required. When a new layer is activitied, the nodes at the top of old layer are supposed to be set zero-displacement (but not a constraint). It reflects some actual engineering conditions.

Re: Problem of "activityltf"

Actually, I'm quite sure I already understand the problem perfectly well.

1. Firstly I use a nonlinear material whose stiffness is determined by stress path completely.

This is not at all relevant to the problem setup. Reality doesn't "know" what material model you intend to use.
So, whatever model you use, the boundary conditions, element activation etc. should of course be identical. Therefor, this point is a not a factor in the problem setup.

2. Secondly "Activityltf" is applied but a additional condition is also required.

Yes. As I've said many times now, the BCs on the unconnected nodes are just there to make the problem non-singular so that direct solvers will work. ActivityLTF changes the output. The BCs on the nodes do not (if you apply it correctly).

When a new layer is activitied, the nodes at the top of old layer are supposed to be set zero-displacement

No they shouldn't. This is an awkward, inconvenient way to solve a problem which is solved perfectly by using initial displacements for the newly activated element instead of doing what you seem to ask for.

1. The new layer of elements gets activated (and the release of a new layer of nodes above)
2. The starting values for all nodes are the displacements from the previous step. NOT ZEROED out. The stress/strain state of all the old elements are also preserved.
3. The newly actiaved elements will use the current displacements of the old nodes as their, interally stored, initial displacements:

strain = B * (displacements - initial_displacements)

The new elements will "start" with zero strain.

If you insist on trying to re-define the displacements of the nodes in each step (which would give identical solution to the procedure mentioned above) then you'll have to rewrite the solver. Of course, there is no point to this, since ActivityLTF is already simulates additive manufacturing in this manner.

24 (edited by licui 06-06-2016 05:30:38)

Re: Problem of "activityltf"

Hi Mikael,
May you offer me some help to rewrite the N-R solver? I have some problems. It seems the main solve process is located in "proceedStep", but it's encapsulated well. I'm confused how to deal with it. I'll tell you what is supposed to do with it.
I've got there are two vectors for total displacement and increment displacement in the solver. In each step, we get total displacement for last step and increment displacement vector after calculation.
So there is an input record of some nodes (the number of them), and then the total displacement for last step of these nodes is made zero. Lastly the increment displacement is added.
I don't know how to deal with the input record. Maybe there is supposed to be a Flag and an extra function? I'm looking forward to your reply.

Additions: Is the tensile stress is positive in default and how to deal with this problem?

Re: Problem of "activityltf"

Hi,
1.
I would be against introducing any changes like that., because the solver is already working exactly like it should.
Performing analysis where new material is added is already perfectly supported by element-activityLTF.

You don't need to explain again how you want the displacement vector to be zeroed out etc. etc. because I already understand what you want to achieve.
And my answer is simply: No. Use the available code that provides the functionality you need in a much better way.

The only objection I've heard is that you got some unwanted anisotropy, which was caused by the faulty ordering in your material model. So why do you keep glossing over my suggestions to just use activityLTF like normal? It works, and it is OOFEMs intended way to deal with additive materials.

If I have misunderstood what you actually want to simulate (and I mean the *real* problem here, now how you think you want to *solve* it), then please explain that with a figure.

2. Tensile stresses are, of course, positive.