/* This file is part of the Neper software package. */
/* Copyright (C) 2003-2014, Romain Quey. */
/* See the COPYING file in the top-level directory. */

#include"net_tesr_.h"

void
net_tesr_init (struct IN In, struct TESS Domain, struct SEEDSET GSet,
	      struct TESR *pTesr)
{
  (*pTesr).CellQty = GSet.N;
  (*pTesr).Dim = Domain.Dim;
  neut_tesr_init_tesrsize (pTesr, Domain, In.dim, In.tesrsizestring);
  neut_tesr_alloc (pTesr, In.dim, (*pTesr).size, (*pTesr).vsize);

  return;
}

void
net_tesr_periodic (struct TESR *pTesr, struct SEEDSET GSet)
{
  int i, j, k;

  for (k = 1; k <= (*pTesr).size[2]; k++)
    for (j = 1; j <= (*pTesr).size[1]; j++)
      for (i = 1; i <= (*pTesr).size[0]; i++)
	(*pTesr).VoxCell[i][j][k]
	  = neut_seedset_seed_master (GSet, (*pTesr).VoxCell[i][j][k]);

  return;
}
