ASPECT
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
aspect::Particle::Generator::ProbabilityDensityFunction< dim > Class Template Reference
Inheritance diagram for aspect::Particle::Generator::ProbabilityDensityFunction< dim >:
Inheritance graph
[legend]

Public Member Functions

virtual void initialize ()
 
virtual void generate_particles (std::multimap< types::LevelInd, Particle< dim > > &particles)
 
virtual void parse_parameters (ParameterHandler &prm)
 
- Public Member Functions inherited from aspect::Particle::Generator::Interface< dim >
 Interface ()
 
virtual ~Interface ()
 
std::pair< types::LevelInd, Particle< dim > > generate_particle (const typename parallel::distributed::Triangulation< dim >::active_cell_iterator &cell, const types::particle_index id)
 
- Public Member Functions inherited from aspect::SimulatorAccess< dim >
 SimulatorAccess ()
 
 SimulatorAccess (const Simulator< dim > &simulator_object)
 
virtual ~SimulatorAccess ()
 
virtual void initialize_simulator (const Simulator< dim > &simulator_object)
 
template<typename PostprocessorType >
PostprocessorType * find_postprocessor () const
 
const Introspection< dim > & introspection () const
 
const Simulator< dim > & get_simulator () const
 
const Parameters< dim > & get_parameters () const
 
SimulatorSignals< dim > & get_signals () const
 
MPI_Comm get_mpi_communicator () const
 
TimerOutputget_computing_timer () const
 
const ConditionalOStreamget_pcout () const
 
double get_time () const
 
double get_timestep () const
 
double get_old_timestep () const
 
unsigned int get_timestep_number () const
 
unsigned int get_nonlinear_iteration () const
 
const parallel::distributed::Triangulation< dim > & get_triangulation () const
 
double get_volume () const
 
const Mapping< dim > & get_mapping () const
 
std::string get_output_directory () const
 
bool include_adiabatic_heating () const
 
bool include_latent_heat () const
 
bool include_melt_transport () const
 
int get_stokes_velocity_degree () const
 
double get_adiabatic_surface_temperature () const
 
double get_surface_pressure () const
 
bool convert_output_to_years () const
 
unsigned int get_pre_refinement_step () const
 
unsigned int n_compositional_fields () const
 
void get_refinement_criteria (Vector< float > &estimated_error_per_cell) const
 
void get_artificial_viscosity (Vector< float > &viscosity_per_cell, const bool skip_interior_cells=false) const
 
void get_artificial_viscosity_composition (Vector< float > &viscosity_per_cell, const unsigned int compositional_variable) const
 
const LinearAlgebra::BlockVectorget_current_linearization_point () const
 
const LinearAlgebra::BlockVectorget_solution () const
 
const LinearAlgebra::BlockVectorget_old_solution () const
 
const LinearAlgebra::BlockVectorget_old_old_solution () const
 
const LinearAlgebra::BlockVectorget_reaction_vector () const
 
const LinearAlgebra::BlockVectorget_mesh_velocity () const
 
const DoFHandler< dim > & get_dof_handler () const
 
const FiniteElement< dim > & get_fe () const
 
const LinearAlgebra::BlockSparseMatrixget_system_matrix () const
 
const LinearAlgebra::BlockSparseMatrixget_system_preconditioner_matrix () const
 
const MaterialModel::Interface< dim > & get_material_model () const
 
void compute_material_model_input_values (const LinearAlgebra::BlockVector &input_solution, const FEValuesBase< dim, dim > &input_finite_element_values, const typename DoFHandler< dim >::active_cell_iterator &cell, const bool compute_strainrate, MaterialModel::MaterialModelInputs< dim > &material_model_inputs) const
 
const GravityModel::Interface< dim > & get_gravity_model () const
 
const InitialTopographyModel::Interface< dim > & get_initial_topography_model () const
 
const GeometryModel::Interface< dim > & get_geometry_model () const
 
const AdiabaticConditions::Interface< dim > & get_adiabatic_conditions () const
 
bool has_boundary_temperature () const
 
DEAL_II_DEPRECATED const BoundaryTemperature::Interface< dim > & get_boundary_temperature () const
 
const BoundaryTemperature::Manager< dim > & get_boundary_temperature_manager () const
 
const BoundaryHeatFlux::Interface< dim > & get_boundary_heat_flux () const
 
bool has_boundary_composition () const
 
DEAL_II_DEPRECATED const BoundaryComposition::Interface< dim > & get_boundary_composition () const
 
const BoundaryComposition::Manager< dim > & get_boundary_composition_manager () const
 
const std::map< types::boundary_id, std::shared_ptr< BoundaryTraction::Interface< dim > > > & get_boundary_traction () const
 
DEAL_II_DEPRECATED const InitialTemperature::Interface< dim > & get_initial_temperature () const
 
const InitialTemperature::Manager< dim > & get_initial_temperature_manager () const
 
DEAL_II_DEPRECATED const InitialComposition::Interface< dim > & get_initial_composition () const
 
const InitialComposition::Manager< dim > & get_initial_composition_manager () const
 
const std::set< types::boundary_id > & get_fixed_temperature_boundary_indicators () const
 
const std::set< types::boundary_id > & get_fixed_heat_flux_boundary_indicators () const
 
const std::set< types::boundary_id > & get_fixed_composition_boundary_indicators () const
 
const std::set< types::boundary_id > & get_free_surface_boundary_indicators () const
 
DEAL_II_DEPRECATED const std::map< types::boundary_id, std::shared_ptr< BoundaryVelocity::Interface< dim > > > get_prescribed_boundary_velocity () const
 
const BoundaryVelocity::Manager< dim > & get_boundary_velocity_manager () const
 
const HeatingModel::Manager< dim > & get_heating_model_manager () const
 
const MeshRefinement::Manager< dim > & get_mesh_refinement_manager () const
 
const MeltHandler< dim > & get_melt_handler () const
 
const NewtonHandler< dim > & get_newton_handler () const
 
const WorldBuilder::World & get_world_builder () const
 
const FreeSurfaceHandler< dim > & get_free_surface_handler () const
 
const LateralAveraging< dim > & get_lateral_averaging () const
 
const ConstraintMatrix & get_current_constraints () const
 
bool simulator_is_initialized () const
 
double get_pressure_scaling () const
 
bool pressure_rhs_needs_compatibility_modification () const
 
bool model_has_prescribed_stokes_solution () const
 
TableHandlerget_statistics_object () const
 
template<typename PostprocessorType >
DEAL_II_DEPRECATED PostprocessorType * find_postprocessor () const
 
const Postprocess::Manager< dim > & get_postprocess_manager () const
 

Static Public Member Functions

static void declare_parameters (ParameterHandler &prm)
 
- Static Public Member Functions inherited from aspect::Particle::Generator::Interface< dim >
static void declare_parameters (ParameterHandler &prm)
 
- Static Public Member Functions inherited from aspect::SimulatorAccess< dim >
static void get_composition_values_at_q_point (const std::vector< std::vector< double > > &composition_values, const unsigned int q, std::vector< double > &composition_values_at_q_point)
 

Protected Member Functions

virtual double get_cell_weight (typename DoFHandler< dim >::active_cell_iterator &cell) const
 
- Protected Member Functions inherited from aspect::Particle::Generator::Interface< dim >
std::pair< types::LevelInd, Particle< dim > > generate_particle (const Point< dim > &position, const types::particle_index id) const
 

Private Member Functions

void generate_particles_in_subdomain (const std::vector< unsigned int > &particles_per_cell, const types::particle_index local_start_id, const types::particle_index n_local_particles, std::multimap< types::LevelInd, Particle< dim > > &particles)
 
std::vector< double > compute_local_accumulated_cell_weights () const
 

Private Attributes

types::particle_index n_particles
 
bool random_cell_selection
 
unsigned int random_number_seed
 
Functions::ParsedFunction< dim > function
 

Additional Inherited Members

- Protected Attributes inherited from aspect::Particle::Generator::Interface< dim >
boost::mt19937 random_number_generator
 

Detailed Description

template<int dim>
class aspect::Particle::Generator::ProbabilityDensityFunction< dim >

Generates a random distribution of particles over the simulation domain. The particle density is determined by a user-defined probability density function in the parameter file. This is done using a "roulette wheel" style selection. Every cell is weighted by the value of the provided function at its center multiplied with the cell volume. Then a map between the accumulated cell weight and the cell index of the current cell is constructed. Consequently, a random number between zero and the global integral of the probability density function uniquely defines one particular cell. Afterwards, every process generates n_global_particles random numbers, but only generates a particle if it is the owner of the active cell that is associated with this random number.

Definition at line 66 of file probability_density_function.h.

Member Function Documentation

§ initialize()

template<int dim>
virtual void aspect::Particle::Generator::ProbabilityDensityFunction< dim >::initialize ( )
virtual

Initialization function for the random number generator.

Reimplemented from aspect::Particle::Generator::Interface< dim >.

§ generate_particles()

template<int dim>
virtual void aspect::Particle::Generator::ProbabilityDensityFunction< dim >::generate_particles ( std::multimap< types::LevelInd, Particle< dim > > &  particles)
virtual

Generate a set of particles in the current particle world. The particle density is set by an analytically prescribed density function that is set as an input parameter. This function builds a list of probabilities for all local cells and then calls generate_particles_in_subdomain() to generate the local particles.

Parameters
[in,out]particlesA multimap between cells and their particles. This map will be filled in this function.

Implements aspect::Particle::Generator::Interface< dim >.

§ declare_parameters()

template<int dim>
static void aspect::Particle::Generator::ProbabilityDensityFunction< dim >::declare_parameters ( ParameterHandler prm)
static

Declare the parameters this class takes through input files.

§ parse_parameters()

template<int dim>
virtual void aspect::Particle::Generator::ProbabilityDensityFunction< dim >::parse_parameters ( ParameterHandler prm)
virtual

Read the parameters this class declares from the parameter file.

Reimplemented from aspect::Particle::Generator::Interface< dim >.

§ get_cell_weight()

template<int dim>
virtual double aspect::Particle::Generator::ProbabilityDensityFunction< dim >::get_cell_weight ( typename DoFHandler< dim >::active_cell_iterator cell) const
protectedvirtual

Returns the weight of one cell, which is interpreted as the probability to generate particles in this cell.

Reimplemented in aspect::Particle::Generator::RandomUniform< dim >.

§ generate_particles_in_subdomain()

template<int dim>
void aspect::Particle::Generator::ProbabilityDensityFunction< dim >::generate_particles_in_subdomain ( const std::vector< unsigned int > &  particles_per_cell,
const types::particle_index  local_start_id,
const types::particle_index  n_local_particles,
std::multimap< types::LevelInd, Particle< dim > > &  particles 
)
private

Generate a set of particles distributed within the local domain according to the probability density function.

Parameters
[in]particles_per_cellA vector with n_locally_owned_cells entries that determines how many particles are generated in each cell.
[in]local_start_idThe starting ID to assign to generated particles of the local process.
[in]n_local_particlesThe total number of particles to generate locally.
[out]particlesA map between cells and all generated particles.

§ compute_local_accumulated_cell_weights()

template<int dim>
std::vector<double> aspect::Particle::Generator::ProbabilityDensityFunction< dim >::compute_local_accumulated_cell_weights ( ) const
private

This function loops over all active cells in the local subdomain and returns a vector of accumulated cell weights with the size n_locally_owned_active_cells(). This vector is calculated by looping over all locally owned cells and accumulating the return value of get_cell_weight(cell).

Member Data Documentation

§ n_particles

Number of particles to create

Definition at line 119 of file probability_density_function.h.

§ random_cell_selection

template<int dim>
bool aspect::Particle::Generator::ProbabilityDensityFunction< dim >::random_cell_selection
private

If true, particle numbers per cell are calculated randomly according to their respective probability density. If false, first determine how many particles each cell should have based on the integral of the density over each of the cells, and then once we know how many particles we want on each cell, choose their locations randomly within each cell.

Definition at line 129 of file probability_density_function.h.

§ random_number_seed

template<int dim>
unsigned int aspect::Particle::Generator::ProbabilityDensityFunction< dim >::random_number_seed
private

The seed for the random number generator that controls the particle generation.

Definition at line 135 of file probability_density_function.h.

§ function

A function object representing the particle location probability density.

Definition at line 141 of file probability_density_function.h.


The documentation for this class was generated from the following file: