noncompiled/models/lithosphere/Crust.js
// It also provides functions for modeling properties of Crust
It also provides functions for modeling properties of Crust
It also provides functions for modeling properties of Crust
function Crust(parameters) {
    this.grid = parameters['grid'] || stop('missing parameter: "grid"');
    var length = this.grid.vertices.length;
    var raster_stack_buffer = new RasterStackBuffer(8 * Float32Array.BYTES_PER_ELEMENT * this.grid.vertices.length, parameters['buffer']);
    this.buffer             = raster_stack_buffer.buffer;
    this.sediment           = raster_stack_buffer.getFloat32Raster(this.grid);
    this.sedimentary        = raster_stack_buffer.getFloat32Raster(this.grid);
    this.metamorphic        = raster_stack_buffer.getFloat32Raster(this.grid);
    this.felsic_plutonic    = raster_stack_buffer.getFloat32Raster(this.grid);
    this.felsic_volcanic    = raster_stack_buffer.getFloat32Raster(this.grid);
    this.mafic_volcanic     = raster_stack_buffer.getFloat32Raster(this.grid);
    this.mafic_plutonic     = raster_stack_buffer.getFloat32Raster(this.grid);
    this.age                = raster_stack_buffer.getFloat32Raster(this.grid);
    this.conserved_array    = new Float32Array(this.buffer, 0, 5 * length);
    this.mass_array         = new Float32Array(this.buffer, 0, 7 * length);
    this.everything         = new Float32Array(this.buffer);
    this.all_pools = [ 
        this.sediment,
        this.sedimentary,
        this.metamorphic,
        this.felsic_plutonic,
        this.felsic_volcanic,
        this.mafic_volcanic,
        this.mafic_plutonic,
        this.age,
    ];
    this.mass_pools = [ 
        this.sediment,
        this.sedimentary,
        this.metamorphic,
        this.felsic_plutonic,
        this.felsic_volcanic,
        this.mafic_volcanic,
        this.mafic_plutonic,
    ];
    this.conserved_pools = [ 
        this.sediment,
        this.sedimentary,
        this.metamorphic,
        this.felsic_plutonic,
        this.felsic_volcanic,
    ];
    this.nonconserved_pools = [ 
        this.mafic_volcanic,
        this.mafic_plutonic,
        this.age,
    ];
     "felsic" is the mass of the buoyant, unsubductable igneous component of the crust
     AKA "sial", or "continental" crust
     "sediment", "sedimentary", and "metamorphic" are forms of felsic rock that have been converted by weathering, lithification, or metamorphosis
     together with felsic, they form a conserved quantity - felsic type rock is never created or destroyed without our explicit say-so
     This is done to provide our model with a way to check for errors
     "mafic" is the mass of the denser, subductable igneous component of the crust
     AKA "sima", or "oceanic" crust
     mafic never undergoes conversion to the other rock types (sediment, sedimentary, or metamorphic)
     this is due to a few reasons:
        1.) it's not performant
        2.) mafic is not conserved, so it's not as important to get right
        3.) mafic remains underocean most of the time so it isn't very noticeable
     "volcanic" rock is rock that was created by volcanic resurfacing
     "plutonic" rock is rock that has 
     by tracking plutonic/volcanic rock, we can identify the specific kind of rock that's in a region:
                 volcanic     plutonic
         felsic     rhyolite     granite
         mafic     basalt         gabbro
     "age" is the age of the subductable, mafic component of the crust
     we don't track the age of unsubductable crust because it doesn't affect model behavior
}
function Crust ( parameters ) { this . grid = parameters [ 'grid' ] || stop ( 'missing parameter: "grid"' ) ; var length = this . grid . vertices . length ; var raster_stack_buffer = new RasterStackBuffer ( 8 * Float32Array . BYTES_PER_ELEMENT * this . grid . vertices . length , parameters [ 'buffer' ] ) ; this . buffer = raster_stack_buffer . buffer ; this . sediment = raster_stack_buffer . getFloat32Raster ( this . grid ) ; this . sedimentary = raster_stack_buffer . getFloat32Raster ( this . grid ) ; this . metamorphic = raster_stack_buffer . getFloat32Raster ( this . grid ) ; this . felsic_plutonic = raster_stack_buffer . getFloat32Raster ( this . grid ) ; this . felsic_volcanic = raster_stack_buffer . getFloat32Raster ( this . grid ) ; this . mafic_volcanic = raster_stack_buffer . getFloat32Raster ( this . grid ) ; this . mafic_plutonic = raster_stack_buffer . getFloat32Raster ( this . grid ) ; this . age = raster_stack_buffer . getFloat32Raster ( this . grid ) ; this . conserved_array = new Float32Array ( this . buffer , 0 , 5 * length ) ; this . mass_array = new Float32Array ( this . buffer , 0 , 7 * length ) ; this . everything = new Float32Array ( this . buffer ) ; this . all_pools = [ this . sediment , this . sedimentary , this . metamorphic , this . felsic_plutonic , this . felsic_volcanic , this . mafic_volcanic , this . mafic_plutonic , this . age , ] ; this . mass_pools = [ this . sediment , this . sedimentary , this . metamorphic , this . felsic_plutonic , this . felsic_volcanic , this . mafic_volcanic , this . mafic_plutonic , ] ; this . conserved_pools = [ this . sediment , this . sedimentary , this . metamorphic , this . felsic_plutonic , this . felsic_volcanic , ] ; this . nonconserved_pools = [ this . mafic_volcanic , this . mafic_plutonic , this . age , ] ; }
It also provides functions for modeling properties of Crust
It also provides functions for modeling properties of Crust
// The following are the most fundamental fields to the tectonics model: // // "felsic" is the mass of the buoyant, unsubductable igneous component of the crust // AKA "sial", or "continental" crust //  // "sediment", "sedimentary", and "metamorphic" are forms of felsic rock that have been converted by weathering, lithification, or metamorphosis // together with felsic, they form a conserved quantity - felsic type rock is never created or destroyed without our explicit say-so // This is done to provide our model with a way to check for errors // // "mafic" is the mass of the denser, subductable igneous component of the crust // AKA "sima", or "oceanic" crust // mafic never undergoes conversion to the other rock types (sediment, sedimentary, or metamorphic) // this is due to a few reasons: //    1.) it's not performant //    2.) mafic is not conserved, so it's not as important to get right //    3.) mafic remains underocean most of the time so it isn't very noticeable // // "volcanic" rock is rock that was created by volcanic resurfacing // "plutonic" rock is rock that has  // by tracking plutonic/volcanic rock, we can identify the specific kind of rock that's in a region: //  //             volcanic     plutonic //     felsic     rhyolite     granite //     mafic     basalt         gabbro //  // // "age" is the age of the subductable, mafic component of the crust // we don't track the age of unsubductable crust because it doesn't affect model behavior