SaveMaterials for vectors and tensors

General discussion about Elmer
Post Reply
vencels
Posts: 66
Joined: 20 Sep 2016, 17:05
Antispam: Yes
Location: Latvia
Contact:

SaveMaterials for vectors and tensors

Post by vencels »

Hi

When exporting Material property

1) As a scalar it works:

Code: Select all

Material 1
  TRRR = Real 1
End

Solver 1
  Procedure = File "SaveData" "SaveMaterials"	
  Parameter 1 =  String "TRRR"
End
2) As a vector it does not work - exported variable "TRRR" is absolute 0:

Code: Select all

Material 1
  TRRR(3) = Real 1 2 3
End

Solver 1
  Procedure = File "SaveData" "SaveMaterials"	
  Parameter 1 =  String "TRRR 1"
End
Ideas?
raback
Site Admin
Posts: 4823
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: SaveMaterials for vectors and tensors

Post by raback »

Hi Juris,

A variable in Elmer always has its components. So when we have "Displacement" vector fields, we also have components 1,2,3.

A keyword may be a vector but its components do not exist.

The SaveMaterials in effect makes fields out of keywords. So what could be done here is make the module to be prepared to read also vectors and in that case create vector valued fields. I.e. in the code we should use ListGetRealArray instead of ListGetReal.

-Peter
grishman
Posts: 1
Joined: 15 Apr 2023, 02:00
Antispam: Yes

Re: SaveMaterials for vectors and tensors

Post by grishman »

Thanks for this interesting answer.
Post Reply