Dear Professor Taylor,
I set up a very simple mesh with three unit square elements side by side along the x-direction and played around a bit with integration of the surface area.
Serial run:
In the isw=16 task of my user element, I wrote the nodal coordinates and the corresponding contribution to the terminal. All results are as expected: The nodal values are equal to a quarter of the surface area for each element, which can be seen from the attached debug.txt, block starting at line 5.
Now, after triggering the assembly into p, cf. first post, by writing
call formfe(np(40),np(26),np(26),np(26),.false.,.true.,.false.,.true.,16,1,numel,1)
I am calling another subroutine
call calcsurf(hr(np(26))
which takes the assembled residual/reactions (pointer 26) and performs a loop over all nodes (no ghost nodes for serial run). Here, something strange happens. You find the output for increment 9 (of 10) in debug.txt, block starting at line 17. The first nodal contributions perfectly sum up to 3, which is the total surface area (correct), but this seems more or less a coincidence. I apply a compressive displacement along the x-direction, which yields some reaction forces. Now, these forces seem to be persistent in hr(np(26)). Somehow I expected, that this array would be zeroed at the very beginning of formfe(...). Hence, I added pzero before formfe, so that it reads
call pzero(hr(np(26)),ndf*numnp*2)
call formfe(...)
call calcsurf(...)
This did the trick for serial feap and removed some perturbations in the y-component (I did not mention them before in order to not distract). However, having added the pzero call, I now get a message at the very end of the successful simulation: Header field was corrupted. Ignoring this for a moment, I now switch to parfeap.
Parallel run:
At first, I implemented your suggestion with ghostfl in pform.f. Looking at the output within the isw = 16 task in my user element, I observe either 2 (flag set as you suggested) or 3 (permanently set to .false.) element calls with the correct nodal contributions (0.25 each). I expected this, but this seems not to solve my problem.
For better understanding, I attached a sketch of the partitioning. Circles are "real" nodes and crosses are "ghost" nodes. Switching to the output in calcsurf(...) again, I observe strange behavior. In partition 1 (cf. debug.txt line 54ff), the leftmost two nodes seem to be ignored by the assembly in formfe, because they are 0 instead of 0.25. The same can be seen in partition 2 (cf. debug.txt line 71ff) from nodes 3 and 4. All ghost node contributions are zero, which I also find weird, but I would have excluded them from summation anyways. Now, the lack of 4*0.25 of surface area explains, why I originally observed slightly smaller values in my original post. Some nodes are simply ignored during assembly.
Also for parfeap, I now receive a message
->Header field was corrupted
->corrupted size vs. prev_size
->Program received signal SIGABRT: Process abort signal.
at the very end of the simulation, but only with the pzero modification. Maybe, I made something wrong in call pzero(hr(np(26)),ndf*numnp*2).
Let me sum up some major questions/observations:
- The problem lies not within my isw = 16 task in the user element. Everything is calculated as expected and manual summation yields the correct total surface area (=3).
- hr(np(26)) has to be zeroed manually (?)
- In parfeap, nodal contributions seem to be lost, if at all they are assembled by formfe.
- It seems as if (columns of) ghost nodes are never assembled (at least in my case).
I will now try to put together a small user macro, that I can upload here, so that you can test it yourself.
Kind regards,
a118145