Example #1
0
        public Input(SPARTA sparta)
        {
            this.infile = sparta.infile;

            variable    = new Variable(sparta);
            this.sparta = sparta;
        }
Example #2
0
        public Mixture(SPARTA sparta, string userid)
        {
            this.sparta = sparta;
            Particle particle = sparta.particle;

            this.userid  = userid;
            vstream      = new double[3];
            vstream_user = new double[3];
            id           = string.Copy(userid);
            activeflag   = false;
            foreach (char c in id)
            {
                if (!char.IsLetterOrDigit(c))
                {
                    sparta.DumpMessage("Mixture ID must be alphanumeric or underscore characters");
                }
            }

            all_default = species_default = false;
            switch (id)
            {
            case "all": all_default = true; break;

            case "species": species_default = true; break;

            default:
                break;
            }



            active = new List <int>();

            Allocate();
        }
Example #3
0
        public Grid(SPARTA sparta)
        {
            this.sparta = sparta;
            exist       = exist_ghost = clumped = false;

            gnames      = new string[MAXGROUP];
            bitmask     = new int[MAXGROUP];
            inversemask = new int[MAXGROUP];
            neighmask   = new int[6];
            neighshift  = new int[6];

            for (int i = 0; i < MAXGROUP; i++)
            {
                bitmask[i]     = 1 << i;
                inversemask[i] = bitmask[i] ^ ~0;
            }

            ngroup    = 1;
            gnames[0] = "all";

            ncell = nunsplit = nsplit = nsub = 0;

            nlocal      = nghost = maxlocal = maxcell = 0;
            nsplitlocal = nsplitghost = maxsplit = 0;
            nsublocal   = nsubghost = 0;
            nparent     = maxparent = 0;

            cells  = null;
            cinfo  = null;
            sinfo  = null;
            pcells = null;

            maxbits = 8 * sizeof(int) - 1;

            maxsurfpercell = MAXSURFPERCELL;
            //csurfs = null; csplits = null; csubs = null;
            AllocateSurfArrays();

            neighshift[(int)bd.XLO] = 0;
            neighshift[(int)bd.XHI] = 3;
            neighshift[(int)bd.YLO] = 6;
            neighshift[(int)bd.YHI] = 9;
            neighshift[(int)bd.ZLO] = 12;
            neighshift[(int)bd.ZHI] = 15;

            neighmask[(int)bd.XLO] = 7 << neighshift[(int)bd.XLO];
            neighmask[(int)bd.XHI] = 7 << neighshift[(int)bd.XHI];
            neighmask[(int)bd.YLO] = 7 << neighshift[(int)bd.YLO];
            neighmask[(int)bd.YHI] = 7 << neighshift[(int)bd.YHI];
            neighmask[(int)bd.ZLO] = 7 << neighshift[(int)bd.ZLO];
            neighmask[(int)bd.ZHI] = 7 << neighshift[(int)bd.ZHI];

            cutoff     = -1.0;
            weightflag = WeightFlag.NOWEIGHT;

            hash       = new Dictionary <int, int>();
            hashfilled = false;
            copy       = copymode = 0;
        }
Example #4
0
        public Modify(SPARTA sparta)
        {
            this.sparta = sparta;

            nfix            = maxfix = 0;
            n_start_of_step = n_end_of_step = 0;
            ncompute        = maxcompute = 0;
        }
Example #5
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            SPARTA sparta = new SPARTA(args);

            sparta.input.File();

            sparta.sw.Flush();
            Console.ReadKey();
        }
Example #6
0
        public Particle(SPARTA sparta)
        {
            this.sparta = sparta;
            exist       = sorted = false;

            particles = null;

            nspecies   = maxspecies = 0;
            species    = null;
            maxvibmode = 0;

            //maxgrid = 0;
            //cellcount = null;
            //first = null;
            maxsort = 0;
            next    = null;

            // create two default mixtures


            mixture  = new List <Mixture>();
            nmixture = 0;

            string[] newarg = new string[1];
            newarg[0] = "all";
            AddMixture(1, newarg);
            newarg[0] = "species";
            AddMixture(1, newarg);

            // custom per-particle vectors/arrays

            //ncustom = 0;
            ename = null;
            //etype = esize = ewhich = null;

            ncustom_ivec = ncustom_iarray = 0;
            icustom_ivec = icustom_iarray = null;
            //eivec = null;
            //eiarray = null;
            eicol = null;

            ncustom_dvec = ncustom_darray = 0;
            icustom_dvec = icustom_darray = null;
            //edvec = null;
            //edarray = null;
            edcol = null;

            custom_restart_flag = null;

            // RNG for particle weighting

            wrandom = null;

            //copy = copymode = 0;
        }
Example #7
0
        private int[] surf_react;                // index of SurfReact model
                                                 // for each bflag = SURFACE boundary

        public Domain(SPARTA sparta)
        {
            this.sparta  = sparta;
            boxlo        = new double[3];
            boxhi        = new double[3];
            prd          = new double[3];
            bflag        = new bc[6];
            norm         = new double[6, 3];
            surf_collide = new int[6];
            surf_react   = new int[6];


            box_exist                = false;
            dimension                = 3;
            axisymmetric             = false;
            boundary_collision_check = 1;

            for (int i = 0; i < 6; i++)
            {
                bflag[i] = bc.PERIODIC;
            }
            for (int i = 0; i < 6; i++)
            {
                surf_collide[i] = surf_react[i] = -1;
            }

            // surface normals of 6 box faces pointed inward towards particles

            norm[(int)bd.XLO, 0] = 1.0; norm[(int)bd.XLO, 1] = 0.0; norm[(int)bd.XLO, 2] = 0.0;
            norm[(int)bd.XHI, 0] = -1.0; norm[(int)bd.XHI, 1] = 0.0; norm[(int)bd.XHI, 2] = 0.0;
            norm[(int)bd.YLO, 0] = 0.0; norm[(int)bd.YLO, 1] = 1.0; norm[(int)bd.YLO, 2] = 0.0;
            norm[(int)bd.YHI, 0] = 0.0; norm[(int)bd.YHI, 1] = -1.0; norm[(int)bd.YHI, 2] = 0.0;
            norm[(int)bd.ZLO, 0] = 0.0; norm[(int)bd.ZLO, 1] = 0.0; norm[(int)bd.ZLO, 2] = 1.0;
            norm[(int)bd.ZHI, 0] = 0.0; norm[(int)bd.ZHI, 1] = 0.0; norm[(int)bd.ZHI, 2] = -1.0;

            nregion = maxregion = 0;
            regions = null;
            copy    = copymode = 0;
        }
Example #8
0
        public double pushvalue;         // new position to push to
        public Surf(SPARTA sparta)
        {
            bblo = new double[3];
            bbhi = new double[3];

            exist = false;
            surf_collision_check = true;

            gnames      = new string[MAXGROUP];
            bitmask     = new int[MAXGROUP];
            inversemask = new int[MAXGROUP];
            for (int i = 0; i < MAXGROUP; i++)
            {
                bitmask[i]     = 1 << i;
                inversemask[i] = bitmask[i] ^ ~0;
            }

            ngroup    = 1;
            gnames[0] = "all";

            npoint = nline = ntri = 0;
            //pts = NULL;
            //lines = NULL;
            //tris = NULL;
            //pushflag = 1;

            //nlocal = 0;
            //mysurfs = NULL;

            //nsc = maxsc = 0;
            //sc = NULL;

            //nsr = maxsr = 0;
            //sr = NULL;

            tally_comm  = Tally.TALLYAUTO;
            this.sparta = sparta;
        }
Example #9
0
        public Stats(SPARTA sparta)
        {
            this.sparta = sparta;
            wall0       = Timer.getTime();

            string[] arg = new string[] { "step", "cpu", "np" };
            nfield = 3;

            Allocate();
            SetFields(3, arg);

            // stats_modify defaults

            flushflag = false;

            // format strings

            //string Int64_format = (string)Int64_FORMAT;

            //format_float_def = (string)"%12.8g";
            //format_int_def = (string)"%8d";
            //sprintf(format_Int64_def, "%%8%s", &Int64_format[1]);
        }
Example #10
0
        public Cut2d(SPARTA sparta, bool axisymmetric)
        {
            this.sparta       = sparta;
            this.axisymmetric = axisymmetric;
            Surf surf = sparta.surf;

            npushmax = 2;

            npushcell = new int[4];

            pushlo_vec    = new double[3];
            pushhi_vec    = new double[3];
            pushvalue_vec = new double[3];

            pushlo_vec[0]    = -1.0;
            pushhi_vec[0]    = 1.0;
            pushvalue_vec[0] = 0.0;

            pushlo_vec[1]    = -1.0;
            pushhi_vec[1]    = 1.0;
            pushvalue_vec[1] = 0.0;

            switch (surf.pushflag)
            {
            case 0: npushmax = 0; break;

            case 2:
                npushmax         = 3;
                pushlo_vec[2]    = surf.pushlo;
                pushhi_vec[2]    = surf.pushhi;
                pushvalue_vec[2] = surf.pushvalue;
                break;

            default:
                break;
            }
        }
Example #11
0
        protected int boundary_pre_tally;  // 1 to log particle stats before boundary collide

        //protected int collide_react_setup();
        //protected void collide_react_update();

        //protected int bounce_setup();
        //protected void bounce_set(bigint);
        //protected void reset_timestep(bigint);


        public Update(SPARTA sparta)
        {
            vstream = new double[3];
            gravity = new double[3];
            rcblo   = new double[3];
            rcbhi   = new double[3];

            ntimestep = 0;
            firststep = laststep = 0;

            beginstep = endstep = 0;
            runflag   = 0;

            unit_style = null;

            SetUnit("si");

            fnum         = 1.0;
            nrho         = 1.0;
            vstream[0]   = vstream[1] = vstream[2] = 0.0;
            temp_thermal = 273.15;
            gravity[0]   = gravity[1] = gravity[2] = 0.0;

            maxmigrate = 0;
            mlist      = null;

            nslist_compute = nblist_compute = 0;
            slist_compute  = blist_compute = null;
            slist_active   = blist_active = null;

            ranmaster = new RanMars(sparta);

            reorder_period = 0;

            copymode    = 0;
            this.sparta = sparta;
        }
Example #12
0
 public RCB(SPARTA sparta)
 {
     this.sparta = sparta;
 }
Example #13
0
 public CreateGrid(SPARTA sparta)
 {
     this.sparta = sparta;
 }
Example #14
0
 public RanMars(SPARTA sparta)
 {
     this.sparta = sparta;
     initflag    = false;
     u           = null;
 }
Example #15
0
 public Output(SPARTA sparta)
 {
     this.sparta = sparta;
     stats       = new Stats(sparta);
 }
Example #16
0
 public BalanceGrid(SPARTA sparta)
 {
     this.sparta = sparta;
 }
Example #17
0
 public Variable(SPARTA sparta)
 {
     this.sparta = sparta;
 }
Example #18
0
 public ReadSurf(SPARTA sparta)
 {
     this.sparta = sparta;
 }
Example #19
0
 public Timer(SPARTA sparta)
 {
     this.sparta = sparta;
     array       = new double[(int)TimeEnum.TIME_N];
 }