Re: [petsc-users] residual norm with TSPSEUDO

2018-06-13 Thread Smith, Barry F.


-ts_monitor_pseudo  ? 


> On Jun 13, 2018, at 10:54 AM, Praveen C  wrote:
> 
> Hello Barry
> 
> I am working in Fortran :-(
> 
> I can see the residual if I use -info but it prints too much information. Is 
> it possible to reduce the amount of log messages printed to screen, some sort 
> of log-level ???

   | grep -i "String you want"   ?


> 
> Thanks
> praveen
> 
>> On 13-Jun-2018, at 8:29 PM, Smith, Barry F.  wrote:
>> 
>>   Take a look at TSPseudoMonitorDefault() in src/ts/impls/pseudo/posindep.c 
>> 
>>The problem is that you need to expose 
>> 
>> typedef struct {
>>  Vec update;   /* work vector where new solution is formed */
>>  Vec func; /* work vector where F(t[i],u[i]) is stored */
>>  Vec xdot; /* work vector for time derivative of state */
>> 
>>  /* information used for Pseudo-timestepping */
>> 
>>  PetscErrorCode (*dt)(TS,PetscReal*,void*);  /* compute next 
>> timestep, and related context */
>>  void *dtctx;
>>  PetscErrorCode (*verify)(TS,Vec,void*,PetscReal*,PetscBool*);  /* verify 
>> previous timestep and related context */
>>  void *verifyctx;
>> 
>>  PetscReal fnorm_initial,fnorm;   /* original and current 
>> norm of F(u) */
>>  PetscReal fnorm_previous;
>> 
>>  PetscReal dt_initial; /* initial time-step */
>>  PetscReal dt_increment;   /* scaling that dt is incremented 
>> each time-step */
>>  PetscReal dt_max; /* maximum time step */
>>  PetscBool increment_dt_from_initial_dt;
>>  PetscReal fatol,frtol;
>> } TS_Pseudo;
>> 
>> inside your application code (that is make a copy of this struct definition 
>> and put it in your code so you can access the fields).
>> 
>>   Barry
> 



Re: [petsc-users] residual norm with TSPSEUDO

2018-06-13 Thread Praveen C
Hello Barry

I am working in Fortran :-(

I can see the residual if I use -info but it prints too much information. Is it 
possible to reduce the amount of log messages printed to screen, some sort of 
log-level ???

Thanks
praveen

> On 13-Jun-2018, at 8:29 PM, Smith, Barry F.  wrote:
> 
>   Take a look at TSPseudoMonitorDefault() in src/ts/impls/pseudo/posindep.c 
> 
>The problem is that you need to expose 
> 
> typedef struct {
>  Vec update;   /* work vector where new solution is formed */
>  Vec func; /* work vector where F(t[i],u[i]) is stored */
>  Vec xdot; /* work vector for time derivative of state */
> 
>  /* information used for Pseudo-timestepping */
> 
>  PetscErrorCode (*dt)(TS,PetscReal*,void*);  /* compute next 
> timestep, and related context */
>  void *dtctx;
>  PetscErrorCode (*verify)(TS,Vec,void*,PetscReal*,PetscBool*);  /* verify 
> previous timestep and related context */
>  void *verifyctx;
> 
>  PetscReal fnorm_initial,fnorm;   /* original and current 
> norm of F(u) */
>  PetscReal fnorm_previous;
> 
>  PetscReal dt_initial; /* initial time-step */
>  PetscReal dt_increment;   /* scaling that dt is incremented 
> each time-step */
>  PetscReal dt_max; /* maximum time step */
>  PetscBool increment_dt_from_initial_dt;
>  PetscReal fatol,frtol;
> } TS_Pseudo;
> 
> inside your application code (that is make a copy of this struct definition 
> and put it in your code so you can access the fields).
> 
>   Barry



Re: [petsc-users] residual norm with TSPSEUDO

2018-06-13 Thread Smith, Barry F.


   Take a look at TSPseudoMonitorDefault() in src/ts/impls/pseudo/posindep.c 

The problem is that you need to expose 

typedef struct {
  Vec update;   /* work vector where new solution is formed */
  Vec func; /* work vector where F(t[i],u[i]) is stored */
  Vec xdot; /* work vector for time derivative of state */

  /* information used for Pseudo-timestepping */

  PetscErrorCode (*dt)(TS,PetscReal*,void*);  /* compute next 
timestep, and related context */
  void *dtctx;
  PetscErrorCode (*verify)(TS,Vec,void*,PetscReal*,PetscBool*);  /* verify 
previous timestep and related context */
  void *verifyctx;

  PetscReal fnorm_initial,fnorm;   /* original and current norm 
of F(u) */
  PetscReal fnorm_previous;

  PetscReal dt_initial; /* initial time-step */
  PetscReal dt_increment;   /* scaling that dt is incremented 
each time-step */
  PetscReal dt_max; /* maximum time step */
  PetscBool increment_dt_from_initial_dt;
  PetscReal fatol,frtol;
} TS_Pseudo;

inside your application code (that is make a copy of this struct definition and 
put it in your code so you can access the fields).

   Barry


> On Jun 13, 2018, at 12:32 AM, Praveen C  wrote:
> 
> Dear all
> 
> How can I access the current residual norm inside my TSMonitor function when 
> using TSPSEUDO ?
> 
> Thanks
> praveen



[petsc-users] residual norm with TSPSEUDO

2018-06-12 Thread Praveen C
Dear all

How can I access the current residual norm inside my TSMonitor function when 
using TSPSEUDO ?

Thanks
praveen