optimization of Scanning Helmholtz Solver

General discussion about Elmer
Sergejs
Posts: 8
Joined: 06 Jan 2024, 00:50
Antispam: Yes
Location: Sweden
Contact:

Re: optimization of Scanning Helmholtz Solver

Post by Sergejs »

raback wrote: 09 Jan 2024, 10:54 To me that seems just paraview artefact of volume rendering. I seldom use that myself. I guess cuts are ok?
You are probably right - hopefully this is only visual problem in ParaView. It is quite misleading if you are not explicitly aware of where this pattern comes from. Perhaps there is a way to pre-merge the partial results so that ParaView does not need to run into this artefact?

From here: https://computational-acoustics.gitlab. ... lelisation
"note that the boundaries between partitions will probably be visible depending on the postprocessing you perform".
Sergejs
Posts: 8
Joined: 06 Jan 2024, 00:50
Antispam: Yes
Location: Sweden
Contact:

Re: optimization of Scanning Helmholtz Solver

Post by Sergejs »

raback wrote: 08 Jan 2024, 17:01 Hi

To split the analysis try this:

Code: Select all

$npart=5
$dn=10
$n0=(npart-1)*dn
Simulation 
...
  Simulation type = "scanning"
  timestep intervals = $dn
  Post File = "case.vtu"
  vtu: fileindex offset = $n0
...
Frequency = Variable "time"
  Real MATC "f0*1.1^(n0+tx-1)"

Solver n
  Procedure = "SaveData" "SaveScalars"
  Filename = f$npart$.dat
  ...
Alternating value of $npart you can run different part of the frequency sweep and catenate results
cat f*.dat > f.dat

-Peter
This code looks extremely useful - just what I need for writing a scheduler (based on "NumCalcManager.py") - will make initial tests tomorrow night.
kevinarden
Posts: 2317
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: optimization of Scanning Helmholtz Solver

Post by kevinarden »

Perhaps there is a way to pre-merge the partial results so that ParaView does not need to run into this artefact?

When I run parallel I get a vtu file for each partition and a combined one for the whole model
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: optimization of Scanning Helmholtz Solver

Post by raback »

Hi,

The issue is that each MPI process is working with its own piece. The nice feature of paraview is that it lets us write each of them separately and just provide the wrapper file (.pvtu). Then there is no communication needed in postprocessing. Imagine writinig everything to a single file there should be one process taking care of the writing.

So to me this is something that paraview should do - and does so for most visualizations. Maybe this is not made easy for paraview since each separate .vtu file uses local numbering. So the information could only be traced by searching nodes that have exactlty same coordinates.

-Peter
Sergejs
Posts: 8
Joined: 06 Jan 2024, 00:50
Antispam: Yes
Location: Sweden
Contact:

Re: optimization of Scanning Helmholtz Solver

Post by Sergejs »

raback wrote: 08 Jan 2024, 17:01 Hi

To split the analysis try this:

Code: Select all

$npart=5
$dn=10
$n0=(npart-1)*dn
Simulation 
...
  Simulation type = "scanning"
  timestep intervals = $dn
  Post File = "case.vtu"
  vtu: fileindex offset = $n0
...
Frequency = Variable "time"
  Real MATC "f0*1.1^(n0+tx-1)"

Solver n
  Procedure = "SaveData" "SaveScalars"
  Filename = f$npart$.dat
  ...
Alternating value of $npart you can run different part of the frequency sweep and catenate results
cat f*.dat > f.dat

-Peter

After some testing, Frequency data export/import is working great using ParaView to read in the group of individual files written by

Code: Select all

Filename = f$npart$.dat
But the command

Code: Select all

cat f*.dat > f.dat
can not be used unless filename will contain leading zeros (like .vtu files) - the numbering order during cat is not correct. And I could not figure out how to do this inside .sif file :)

Now working on a Python scheduler...
Sergejs
Posts: 8
Joined: 06 Jan 2024, 00:50
Antispam: Yes
Location: Sweden
Contact:

Re: optimization of Scanning Helmholtz Solver

Post by Sergejs »

My Python scheduler is ready. :)

As it works for Scanning simulations with input frequency value I assume it is only useful for audio simulations and I called it

Code: Select all

ElmerScanManager.py
If there are other use cases I could still change the name of it

At the moment there is no point in sharing it as without the rest of the example files and some tutorial it makes no sense.
But thank you for the example code - it was what I needed to get this project to this level.

Will share the links to tutorial with scheduler when it is available. (may be useful to beginners like me and hopefully people will find bugs and improvement suggestions in it)
Post Reply