only the first component exported in vtu format

Mesh generators, CAD programs, and other tools
Post Reply
gagliar
Posts: 79
Joined: 04 Sep 2009, 16:34
Location: LGGE - Grenoble
Contact:

only the first component exported in vtu format

Post by gagliar »

Hello,

I have the strange behaviour that only the first component of an exported variable with dofs>1 is saved in the vtu output file.
The export of the variable in the sif file writes:

Code: Select all

Solver i 
...
Exported Variable 1 = -dofs 2 "Integrated Velocity"
End 
but only "Integrated velocity 1" appears in the vtu output file. On the other side, both "Integrated velocity 1" and "Integrated velocity 2" are saved in the ElmerPost file.

Is that normal?
Thanks
Gag
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25
Antispam: Yes

Re: only the first component exported in vtu format

Post by Franz Pichler »

i have the same problem with the new revision. And i now that it is not the result output solver. because i use my own version of that. So somehow the general treatment of variables was changed and it doesn't recognize all the components of the vectors anymore.

WOuld be great if someone couldf have a look at that.

best regards
Franz
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: only the first component exported in vtu format

Post by raback »

Ok, I guess there must be a bug. Thanx for narrowing it down. I'll try to have a look time permitting. -Peter
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25
Antispam: Yes

Re: only the first component exported in vtu format

Post by Franz Pichler »

Hi there,

the resultoutputsolver is using createlistfor saving from lists.src and there is a part that checks if a variable is a vector (number of components = dim)
and there are some changes from older revisions which may cause the problem.

the part

Code: Select all

            ! Associated to the previous case, cycle the other components of the vector
            ! and cycle them if they are part of the vector that will be detected above.
          ELSE IF( str(j:j) == '2' ) THEN
            Var1 => VariableGet(Variables,TRIM(str(1:j-2))//' 1',ThisOnly)		
            IF( ASSOCIATED( Var1 ) ) THEN
              IF( dim == 2 ) THEN 
                Var1 => VariableGet(Variables,TRIM(str(1:j-2))//' 3',ThisOnly)		
              ELSE IF( dim == 3 ) THEN
                Var1 => VariableGet(Variables,TRIM(str(1:j-2))//' 4',ThisOnly)		
              END IF
              Set = ASSOCIATED( Var1 )
            END IF

          ELSE IF( str(j:j) == '3' ) THEN
            IF( dim == 3 ) THEN
              Var1 => VariableGet(Variables,TRIM(str(1:j-2))//' 1',ThisOnly)		
              IF( ASSOCIATED( Var1 ) ) THEN
                Var1 => VariableGet(Variables,TRIM(str(1:j-2))//' 4',ThisOnly)		
                Set = ASSOCIATED( Var1 )
              END IF
            END IF
in the case that dim==3 and we have a vector with two components this function doesn#t work right (i think)
because it only checks if there is a 4th component but not if there is actually a third component.

one way to go around this for now would be to add alist of output variables in the resultoutputsolver section in the sif file manually.

maybe that helps

best regards

Franz
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25
Antispam: Yes

Re: only the first component exported in vtu format

Post by Franz Pichler »

And a further detail:

i saw a comment in the source code of the resultoutputsolver

Code: Select all

! Why does this not work?
    NoActive = NINT( ParallelReduction( 1.0_dp * Active ) )
this is because the partitions are not set to active here
i added

Code: Select all

    WRITE( Message,*) 'Active right now       :',parenv%Active(:)
    CALL Info('WritePvtuFile',Message)
    CALL PARALLELACTIVE(.True.)
    WRITE( Message,*) 'Active aftercall active:',parenv%Active(:)
    CALL Info('WritePvtuFile',Message)
just before the above code snippet and then the number of partitions is right
this is an issue i was wondering about earlier allready
viewtopic.php?f=7&t=2720
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: only the first component exported in vtu format

Post by raback »

Hi Franz

These should be now fixed. Thanx for reporting!

The logic in finding vectors was ok, albeit stupid since there is no internal information of the collection of scalar fields making a vector field. However, the name by it was saved was flawed.

-Peter
Post Reply