How do I write eigenvalues to .ep file?

Numerical methods and mathematical models of Elmer
Post Reply
Hal
Posts: 13
Joined: 24 Jun 2013, 19:56
Antispam: Yes

How do I write eigenvalues to .ep file?

Post by Hal »

I'm doing a simple eigenvalue analysis on a solid structure. The analysis itself seems to be working fine, but when I look in the .ep file, all that was written were the eigenvectors of my solution. The eigenvalues are spit out into the command line at the end of the analysis, so I know they are being computed, but I want a way to access them automatically when the analysis is over instead of transcribing them myself.

Does anyone know how to write the eigenvalues to a file for postprocessing?
Hal
Posts: 13
Joined: 24 Jun 2013, 19:56
Antispam: Yes

Re: How do I write eigenvalues to .ep file?

Post by Hal »

I have tried using this method as a guideline (viewtopic.php?f=8&t=597), as well as the Elmer Models manual (p213). Something like:

Procedure = File "SaveData" "SaveScalars"
Save Eigenfrequencies = Logical True

with a bunc of other commands around it. But ElmerSolver keeps reporting "Unknown specifier: [save eigenfrequencies]".

Any ideas?
raback
Site Admin
Posts: 4828
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: How do I write eigenvalues to .ep file?

Post by raback »

Hi

Eigenvalues cannot be written to .ep file. They are scalars that may be written to some other file by SaveScalars solver. Eigenmodes can be saved as a field.

There may be something wrong in the sif file already before the complaint because it does not make sense.

-Peter
Hal
Posts: 13
Joined: 24 Jun 2013, 19:56
Antispam: Yes

Re: How do I write eigenvalues to .ep file?

Post by Hal »

Sorry, I realize that I can't write the eigenvalues to the same .ep file the rest of the analysis is written to, I just meant any postprocessing file. Right now, my sif runs fine. If I add these lines:

Solver 3
Exec Solver = After Saving
Equation = Linear elasticity
Procedure = "SaveData" "SaveScalars"
Filename = "Eigenvalues.dat"
Save Eigenvalues = Logical True
End

Where "Linear elasticity" is the name of the equation that takes care of solving the eigensystem, my .sif still runs fine, I see the correct eigenvalues, but then I get "Program received signal SIGSEGV: Segmentation fault - invalid memory reference"
when these lines try to execute. I've also tried

Solver 3
Exec Solver = After Saving
Equation = Linear elasticity
Procedure = "SaveData" "SaveScalars"
Filename = "Eigenvalues.dat"
Variable 1 = Eigenvalues
End

I get "Variable does not exist: eigenvalues". Based on how I understand these functions, I think what I really want is something like

Solver 3
Exec Solver = After Saving
Equation = Linear elasticity
Procedure = "SaveData" "SaveScalars"
Filename = "Eigenvalues.dat"
Variable 1 = M^-1K
Save Eigenvalues = Logical True
End

But I don't actually know the name of the matrix that describes M^-1K.
raback
Site Admin
Posts: 4828
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: How do I write eigenvalues to .ep file?

Post by raback »

Hi, Try

Code: Select all

Solver 3
  Exec Solver = After Saving
  Equation = UniqueName
  Procedure = "SaveData" "SaveScalars"
  Filename = "Eigenvalues.dat"
  Variable 1 = Displacement
  Save Eigenvalues = Logical True
End
Hal
Posts: 13
Joined: 24 Jun 2013, 19:56
Antispam: Yes

Re: How do I write eigenvalues to .ep file?

Post by Hal »

Thanks a lot for helping me, raback. If I just copy and paste your code in, I get the same segfault I did earlier during SaveScalars. If I remove the line " Save Eigenvalues = Logical True", I get "WARNING:: SaveScalars: Found no values to save". This seems strange to me; I feel that the displacements should at least be written. I've attached my entire .sif for clarity.

Also, lookint at this topic viewtopic.php?f=8&t=446, it seems like there was at one time a bug regarding writing eigenfrequencies with SaveScalars. Is there a possibility it's still around?
Attachments
case.sif
(4.02 KiB) Downloaded 317 times
Hal
Posts: 13
Joined: 24 Jun 2013, 19:56
Antispam: Yes

Re: How do I write eigenvalues to .ep file?

Post by Hal »

For anyone who's also struggling with this, I found a hackish workaround- call ElmerSolver in a C++ wrapper with a system() call, then just dump the stdout of the terminal to a textfile using something like

freopen("output.txt","w",stdout)

Then, inside the wrapper, write a parser than can search the stdout dump for solutions to EigenSolve.

Far from elegant, I know, but it works. If anyone has a better solution (ie something with SaveScalars), I'm still very interested in knowing what you arrive at.
Post Reply