sandbox/bugs/symm.c

Bug with the tag “symmetric”.

#include "grid/multigrid.h"
#include "run.h"

symmetric tensor A[]; 

event init (i = 0) {
  foreach() {
    A.x.x[] = 1.;
    A.y.y[] = 5.;
    A.x.y[] = 2.;
  }
}

event plot_tensor (i = 0)
{
  symmetric tensor B[];
  
  foreach() {
    B.x.y[] = 2;
    foreach_dimension() 
      B.x.x[] = A.x.x[];

    fprintf(stderr, " Axx %g Axy %g \n", A.x.x[], A.x.y[]); 
    fprintf(stderr, " Ayx %g Ayy %g \n", A.y.x[], A.y.y[]); 
    fprintf(stderr, " ******************\n"); 
    fprintf(stderr, " Bxx %g Bxy %g \n", B.x.x[], B.x.y[]); 
    fprintf(stderr, " Byx %g Byy %g \n", B.y.x[], B.y.y[]); 
    fprintf(stderr, " ******************\n"); 
  }
}

int main()
{
  init_grid (0);
  run();
}