Saving results & restarting

Discussion about coding and new developments

Re: Saving results & restarting

Postby Martina » 04 Mar 2014, 16:20

Hi,

I just came by chance accross this old post. I have experienced recently the same issue:
I do a run, where I use the Navier-Stokes Solver and calculate the loads. Then I restart from this, and in my second run I am not running Navier-Stokes, I only need the loads. The userfunction which uses them can't find them. They are not found in Model % Variables anymore (see code below, I get the error message 'Need >Calculate Loads = Logical True<. Flow Load not found').
So apparently FlowLoads are saved during the restart, but are not found by Model % Variables unless the Navier-Stokes Solver is present in the sif-file.
I'm not sure if that is wanted?
Putting Navier-Stokes with Exec=Never in the sif-file works, and also saving the loads as variable and passing directly this variable to the userfunction helps (but the latter makes loosing the benefit of passing them automatically).

Martina


Code: Select all
! Get the Stokes loads
  !---------------------------
  FlowLoadsName = GetString( Model % Solver % Values , 'Flow Solver Name', GotIt ) 
  IF (.NOT. GotIt) THEN
     WRITE(FlowLoadsName,'(A)') TRIM(FlowSolutionName)//' Loads'
     WRITE(Message,'(AA)') 'Using default name for flow solution: ', &
          FlowLoadsName
     CALL WARN(FunctionName,Message)
  END IF
  FlowLoadSol => VariableGet( Model % Variables, TRIM(FlowLoadsName) )
  IF ( ASSOCIATED( FlowLoadSol ) ) THEN
     FlowLoadPerm    => FlowLoadSol % Perm
     FlowLoadValues  => FlowLoadSol % Values
  ELSE
     CALL FATAL(FunctionName,&
          'Need >Calculate Loads = Logical True<. Flow Load not found')
  END IF
Martina
 
Posts: 39
Joined: 17 Apr 2013, 14:06

Re: Saving results & restarting

Postby mrninkoz » 12 Nov 2015, 13:14

Code: Select all
! Get the Stokes loads
  !---------------------------
  FlowLoadsName = GetString( Model % Solver % Values , 'Flow Solver Name', GotIt ) 
  IF (.NOT. GotIt) THEN
     WRITE(FlowLoadsName,'(A)') TRIM(FlowSolutionName)//' Loads'
     WRITE(Message,'(AA)') 'Using default name for flow solution: ', &
          FlowLoadsName
     CALL WARN(FunctionName,Message)
  END IF
  FlowLoadSol => VariableGet( Model % Variables, TRIM(FlowLoadsName) )
  IF ( ASSOCIATED( FlowLoadSol ) ) THEN
     FlowLoadPerm    => FlowLoadSol % Perm
     FlowLoadValues  => FlowLoadSol % Values
  ELSE
     CALL FATAL(FunctionName,&
          'Need >Calculate Loads = Logical True<. Flow Load  [url=http://www.androidphonesoft.com/resources/recover-deleted-contacts-messages-lg-g3.html]restore[/url] and not found')
  END IF


I don't think the main problem is not specific to her own userfunctions or her recent changes in sif-files.
mrninkoz
 
Posts: 1
Joined: 10 Nov 2015, 09:34

Previous

Return to Software development

Who is online

Users browsing this forum: No registered users and 2 guests