Hi Robert,

Thanks a lot for your patient explanation.  

ouyang

On Friday, July 18, 2014 8:32:56 PM UTC+8, Robert Cimrman wrote:
On 07/18/2014 01:49 PM, Ouyang wrote:
> Hi Robert,
>
> hanks for your help. It works now.
>
> I did try       f = Material('f', val={'.val': [0.0,0.0, -100000.0]})
>     for point load and failed due to val= {...} instead of values={...}.

Here 'val' is the name you chose for the material parameter (it could be
something else, like 'c' or 'const' or 'coef'...). On the other hand, values is
the name of the keyword argument of Material.__init__(), that can be used to
pass in material parameter names that are not valid argument names (e.g. '.val').

>    Based on that, I have retested the following cases both body forces and
> point load with three components.  It seems that the argument formats of
> Material() are not consistency for me.
>
>    For body forces (three components), abbreviation "val=" must be used and
> "values=" won't work.  I tested three cases: f1,f2 work  and f3 fail.
>
>    f1 = Material('f', val=[[0.02], [0.01],[0.05]])
>    f2 = Material('f', val=[0.02, 0.01, 0.05])
>    f3 = Material('f', val=[[0.02, 0.01,0.05]])
>
>    For point load (three components), abbreviation "val=" won't work and
> "values=" must be used. As a result, f1 fail and f2,f3 work.
>
>    f1 = Material('f', values={'.val': [[0.0],[0.0], [-100000.0]]})
>    f2 = Material('f', values={'.val': [0.0,0.0, -100000.0]})
>    f3 = Material('f', values={'.val': [[0.0,0.0, -100000.0]]})

You are right that in body forces the parameter has to be a column vector,
while in point loads as rows of a 2D array (each row for a point). The point
load term is somewhat special.

r.

> Ouyang
>
>
> On Friday, July 18, 2014 6:31:14 PM UTC+8, Robert Cimrman wrote:
>
>> Hi Ouyang,
>>
>> On 07/16/2014 05:15 AM, Ouyang wrote:
>>> Hi there,
>>>
>>>     I followed the interactive example in sfepy tutorial  and wrote my
>> custom
>>> simulation script for the block domain with body force (t2 term). That
>>> works. But for the point loaded block model (t3 term), I can't make it
>>> work. The script stopped at "assert_(mat.shape[-1]==virtual.dim)" of
>>> terms_point.py with IndexError: tuple index out of range.   Searching
>> the
>>> web does not find help information for this.
>>
>> It is caused by the fact, that the point load has to be given as a special
>> material parameter (= not evaluated in quadrature points, taken "as is",
>> see
>> the term docstring) -> its name has to start with dot.
>>
>> Try:
>>
>>      f = Material('f', values={'.val': [[0.0,0.0, -100000.0]]})
>>
>> It works for me.
>>
>> Cheers,
>> r.
>>
>>
>
>
>>>
>>>    The reason I write the attached custom simulation script is that I
>> failed
>>> doing the things below:
>>>    the "non-custom" script for a point loaded block running with
>> "simple.py"
>>> works and gmsh can mesh different geometries. I would like to finish
>> those
>>> two things together in python like  "os.system('gmsh ........')", and
>>>    "os.system('simple.py examples/myscript.py") but  errors to import
>> config
>>> in simple.py got me there since "path" settings for import  in simple.py
>>> seems a little complicated for me.    The custom simulation script might
>> be
>>> easier to setup import "path" for me.
>>>
>>> Thanks for your help.
>>>
>>>    ouyang
>>>
>>
>>
>