First, please correct the coding style. It takes additional mental effort for me to adapt to different coding styles all the time.
No tabs, 4 space indentation, don't indent on namespace, camel-case the functions, only classnames start with capital letters, use return values when suitable (at least for scalars)
Then, all the loops have to go. Use the functions in floatarray/floatmatrix, like add, dotProduct, beProductOf, beTProductOf, beProductTOf, plusProduct.
I will not look at any code again if you don't do this. In fact, I spent a few minutes fixing up your file, except for the loops since I don't have time for that now.
Please correct these things. I'm sure to have left some mistake in there, but this will show you how it should look (i.e. it should look like the rest of OOFEM).
The big problem, which I spotted while cleaning up the code, is due to your usage of "tStep->giveSolutionStateCounter()". This isn't what you think it is, and you should not use it.
In fact,
// It's possible to get the info about maximum substeps from the engng
history = std::vector<double>(100000, 0);
you must remove this variable. It messes up a lot of things for you. If you want the increment, or velocities, or the displacement, then you must use:
sN->giveUnknownVector(us, { D_u, D_v }, VM_Incremental, tStep, true); // or VM_Velocity for velocities
m1N->giveUnknownVector(um1, { D_u, D_v }, VM_Incremental, tStep, true);
m2N->giveUnknownVector(um2, { D_u, D_v }, VM_Incremental, tStep, true);
and not try to store old solutions internally in the boundary condition. Doing that will break the simulations in the most obscure and hard-to-find ways.
But the big problem i can spot,
Post's attachmentsNTSF.cpp 16.78 kb, 3 downloads since 2015-12-11
You don't have the permssions to download the attachments of this post.