Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

written moments should live at same time as fields and particles #70

Open
alecjohnson opened this issue May 22, 2014 · 0 comments
Open

Comments

@alecjohnson
Copy link
Contributor

Currently, at the end of each cycle, we output the field and particle data at time tn, but we output the moment data for time step tn-1. Instead, at the end of each output cycle, all quantities saved should live at time step tn.

The current algorithm cycle looks like this:

  for (int i = KCode.FirstCycle(); i < KCode.LastCycle(); i++) 
  {
      // computes moments M at t^(n-1) and implicit moments IM at t^n
      KCode.CalculateMoments();
      KCode.CalculateField(); // computes E at t^n
      KCode.ParticlesMover(); // computes pcls P at t^n
      KCode.CalculateB(); // computes B at t^n
      KCode.WriteOutput(i); // writes M, E, B, and P
  }   

To fix this problem, we can change the algorithm cycle to look like this:

  // computes moments M at t^0 and implicit moments IM at t^1
  KCode.CalculateMoments();
  for (int i = KCode.FirstCycle(); i < KCode.LastCycle(); i++) 
  {
      KCode.CalculateField(); // computes E at t^n
      KCode.ParticlesMover(); // computes pcls P at t^n
      KCode.CalculateB(); // computes B at t^n
      // computes moments M at t^n and implicit moments IM at t^(n+1)
      KCode.CalculateMoments();
      KCode.WriteOutput(i);  // writes M, E, B, and P
  }   
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant