Topic: Extracting Force Using Extractor

Hi Borek,

I am trying to extract force out of my field using this line in input file

#REACTION number # dof #

but it just returns dash lines:

---
             ---
             ---
             ---

the extractor.py works for displacement at nodes but it fails for extracting quasi-reaction forces.
can you please help me?

Kind Regards,
Hassan

Re: Extracting Force Using Extractor

the output has such a form:

  node  dof            force
============================
    #        1                 #
    #        2                 #
============================

I made some changes in extractor.py as following:


reaction_re = re.compile (r"""
   
        (\d+)\s+(\d+)\s+
    ([-]*\d+\.\d+(e[+-]\d+)?)     # value 

        """,re.X)

and

match=reaction_re.search(line)
    if match:
        if debug: print "Rea: ", line
        rectype = rt_reaction
   
        recnumber = int(match.group(1))
        recdofnum = int(match.group(2))
        recvalue  = float(match.group(3))

        check_reaction_rec (rectime, recnumber, recdofnum, recvalue)
        return None


but it still writes nothing,

Re: Extracting Force Using Extractor

Hello Hassan,

some time ago I had the same problem. In my case the problem was that I specified wrong node or dof (i.e. such node, where there was no (Dirrichlet) boundary condition = no reaction). Then the output was exactly 3 dashed lines.. Try to check, if this your case as well.

good luck
Jan

Re: Extracting Force Using Extractor

Thanks Jan for your reply,
I found the problem, it is so simple just one plus missing,
I just insert the corrected version:

reaction_re = re.compile (r"""
   
        (\d+)\s+(\d+)\s+
    ([+-]*\d+\.\d+(e[+-]\d+)?)     # value
        """,re.X)

Re: Extracting Force Using Extractor

I would argue that positive values shouldn't prepend a "+".
And I dont really follow what you are trying to achieve here. Clearly, the obvious way would be to have your oofem code write output files normally.
I.e, do this

    R E A C T I O N S  O U T P U T:
    _______________________________


    Node        1 iDof  1 reaction -2.7113e+00    [bc-id: 1]
    Node        1 iDof  2 reaction  5.0000e-01    [bc-id: 1]
    Node        3 iDof  2 reaction -5.7735e-01    [bc-id: 1]

6

Re: Extracting Force Using Extractor

I think that "smhzolanvari" is right, he is not trying to extract reaction but quasi-reaction, which is different it is like a virtual reaction in controlled node, but there is no bc applied in this node. And he is right, the format for printing out this reaction is always pre pending sign before a value (see nrsolver.C code). So his modification is ok, but I think we remove the sign enforcement in corresponding format.