Shiokaze Framework
A research-oriented fluid solver for computer graphics
array_core3 Class Referenceabstract

Core module class for three dimensional array designed to be used in array3 class. More...

#include <array_core3.h>

Inheritance diagram for array_core3:
recursive_configurable_module recursive_configurable module configurable credit messageable

Public Member Functions

virtual void initialize (unsigned nx, unsigned ny, unsigned nz, unsigned element_size)=0
 Allocate grid memory with value. More...
 
virtual void get (unsigned &nx, unsigned &ny, unsigned &nz, unsigned &element_size) const =0
 Get grid information. More...
 
virtual size_t count (const parallel_driver &parallel) const =0
 Count the number of active cells. More...
 
virtual void copy (const array_core3 &array, std::function< void(void *target, const void *src)> copy_func, const parallel_driver &parallel)=0
 Copy grid. More...
 
virtual void set (int i, int j, int k, std::function< void(void *value_ptr, bool &active)> func)=0
 Set a value of a cell. More...
 
virtual const void * operator() (int i, int j, int k, bool &filled) const =0
 Get a value of a cell. More...
 
virtual void parallel_actives (std::function< void(int i, int j, int k, void *value_ptr, bool &active, const bool &filled, int thread_index)> func, const parallel_driver &parallel)=0
 Loop over all the active cells in parallel. More...
 
virtual void serial_actives (std::function< bool(int i, int j, int k, void *value_ptr, bool &active, const bool &filled)> func)=0
 Loop over all the active cells in serial order. More...
 
virtual void const_parallel_actives (std::function< void(int i, int j, int k, const void *value_ptr, const bool &filled, int thread_index)> func, const parallel_driver &parallel) const =0
 Loop over all the active cells in parallel by read-only fashion. More...
 
virtual void const_serial_actives (std::function< bool(int i, int j, int k, const void *value_ptr, const bool &filled)> func) const =0
 Loop over all the active cells in serial order by read-only fashion. More...
 
virtual void parallel_all (std::function< void(int i, int j, int k, void *value_ptr, bool &active, const bool &filled, int thread_index)> func, const parallel_driver &parallel)=0
 Loop over all the cells in parallel. More...
 
virtual void serial_all (std::function< bool(int i, int j, int k, void *value_ptr, bool &active, const bool &filled)> func)=0
 Loop over all the cells in serial order. More...
 
virtual void const_parallel_all (std::function< void(int i, int j, int k, const void *value_ptr, const bool &active, const bool &filled, int thread_index)> func, const parallel_driver &parallel) const =0
 Loop over all the cells in parallel by read-only fashion. More...
 
virtual void const_serial_all (std::function< bool(int i, int j, int k, const void *value_ptr, const bool &active, const bool &filled)> func) const =0
 Loop over all the cells in serial order by read-only fashion. More...
 
virtual void dilate (std::function< void(int i, int j, int k, void *value_ptr, bool &active, const bool &filled, int thread_index)> func, const parallel_driver &parallel)=0
 Dilate cells. More...
 
virtual void flood_fill (std::function< bool(void *value_ptr)> inside_func, const parallel_driver &parallel)=0
 Perform flood fill. More...
 
virtual void const_parallel_inside (std::function< void(int i, int j, int k, const void *value_ptr, const bool &active, int thread_index)> func, const parallel_driver &parallel) const =0
 Loop over all the filled cells in parallel by read-only fashion. More...
 
virtual void const_serial_inside (std::function< bool(int i, int j, int k, const void *value_ptr, const bool &active)> func) const =0
 Loop over all the filled cells in serial order by read-only fashion. More...
 
- Public Member Functions inherited from recursive_configurable_module
virtual void recursive_load (configuration &config) override
 Start recursively load configurables. More...
 
virtual void recursive_configure (configuration &config) override
 Recursively call configure. More...
 
- Public Member Functions inherited from recursive_configurable
 recursive_configurable ()=default
 Default constructor.
 
virtual void recursive_initialize (const configurable::environment_map &environment=configurable::environment_map())
 Initialize the program itself and relay the same to its children. Used to get things ready for actual use. More...
 
virtual bool is_ready () const
 Get if the instance is initialized. More...
 
virtual void add_child (configurable *child)
 Add a child instance. More...
 
virtual void add_child (recursive_configurable *child)
 Add a child instance. More...
 
virtual void remove_child (configurable *child)
 Remove a child instance. More...
 
virtual void remove_child (recursive_configurable *child)
 Remove a child instance. More...
 
virtual void setup_now (configuration &config=get_global_configuration()) override
 Run recursive_load - recursive_configure - recursive_initialize processes.
 
virtual bool not_recursive () override
 Check if this instance is not derived from recursive_configurable. More...
 
void set_environment (std::string name, const void *value)
 Set the pointer to an environmental value associated with an input name. More...
 
- Public Member Functions inherited from configurable
virtual void load (configuration &config)
 Load the program. Used to load files and libraries into memory. More...
 
virtual void configure (configuration &config)
 Configure the program. Used to load and set parameters. More...
 
- Public Member Functions inherited from module
 module ()
 Default constructor for module.
 
virtual ~module ()
 Default destructor for module.
 
virtual std::string get_module_name () const
 Get the module name. More...
 
- Public Member Functions inherited from credit
 credit ()=default
 Default constructor.
 
 credit (std::string name, std::string argument_name)
 Constructor for credit. More...
 
virtual void set_name (std::string name, std::string argument_name="")
 Set name (and perhaps, argument name together) More...
 
virtual std::string get_name () const
 Get the name.
 
virtual void set_argument_name (std::string argument_name)
 Set an argument name. More...
 
virtual std::string get_argument_name () const
 Get an argument name. More...
 
virtual double get_version () const
 Get version. More...
 
virtual std::string get_author () const
 Get author's name. More...
 
virtual std::tuple< int, int, int > get_date () const
 Get currently set date. More...
 
virtual std::string get_email_address () const
 Get email address. More...
 
- Public Member Functions inherited from messageable
virtual bool send_message (std::string message, void *ptr=nullptr)
 Send a message. More...
 
virtual bool const_send_message (std::string message, void *ptr=nullptr) const
 Send a message. More...
 

Protected Member Functions

 array_core3 (const array_core3 &)=delete
 
void operator= (const array_core3 &)=delete
 
- Protected Member Functions inherited from configurable
bool check_set (const environment_map &environment, std::vector< std::string > names)
 Check if the values for a variable keys exist. More...
 

Additional Inherited Members

- Public Types inherited from configurable
using environment_map = std::map< std::string, const void * >
 Type for environment_map.
 
- Static Public Member Functions inherited from configurable
static configurationset_global_configuration (const configuration &config)
 Assign the global settings of the program. More...
 
static configurationget_global_configuration ()
 Get the global settings of the program. More...
 
template<class T >
static const T & get_env (const environment_map &environment, std::string key)
 Extract an specified type of pointer from the input environment. More...
 
- Static Public Member Functions inherited from module
static std::string module_libpath (std::string module_name)
 Get the path to the dynamic library. e.g., "mylib" -> "symlink-public/lib/libshiokaze_mylib.dylib". More...
 
static modulealloc_module (configuration &config, std::string arg_name, std::string default_module_name, std::string description)
 Automatically reads the parameter "arg_name" to fetch the name for the library, and allocate the library. More...
 
static modulealloc_module (std::string path)
 Reads the dynamic library of a class module, allocate, and return the pointer to it. More...
 
static unsigned close_all_handles ()
 Close all the handles that are still unloaded. More...
 
template<class T >
static std::unique_ptr< T > unique_alloc_module (configuration &config, std::string arg_name, std::string default_module_name, std::string description)
 Allocate the module and cast to the a specified class T. More...
 
static unsigned count_open_modules ()
 Count all the open modules. More...
 
- Protected Attributes inherited from credit
std::string m_name
 Name of credit.
 
std::string m_argument_name
 Argument name.
 

Detailed Description

Core module class for three dimensional array designed to be used in array3 class.

Member Function Documentation

◆ const_parallel_actives()

virtual void array_core3::const_parallel_actives ( std::function< void(int i, int j, int k, const void *value_ptr, const bool &filled, int thread_index)>  func,
const parallel_driver parallel 
) const
pure virtual

Loop over all the active cells in parallel by read-only fashion.

Parameters
[in]funcFunction that processes a cell.

◆ const_parallel_all()

virtual void array_core3::const_parallel_all ( std::function< void(int i, int j, int k, const void *value_ptr, const bool &active, const bool &filled, int thread_index)>  func,
const parallel_driver parallel 
) const
pure virtual

Loop over all the cells in parallel by read-only fashion.

Parameters
[in]funcFunction that processes a cell.
[in]parallelInstance to a parallel driver.

◆ const_parallel_inside()

virtual void array_core3::const_parallel_inside ( std::function< void(int i, int j, int k, const void *value_ptr, const bool &active, int thread_index)>  func,
const parallel_driver parallel 
) const
pure virtual

Loop over all the filled cells in parallel by read-only fashion.

Parameters
[in]funcFunction that processes a cell.
[in]parallelInstance to a parallel driver.

◆ const_serial_actives()

virtual void array_core3::const_serial_actives ( std::function< bool(int i, int j, int k, const void *value_ptr, const bool &filled)>  func) const
pure virtual

Loop over all the active cells in serial order by read-only fashion.

Parameters
[in]funcFunction that processes a cell.

◆ const_serial_all()

virtual void array_core3::const_serial_all ( std::function< bool(int i, int j, int k, const void *value_ptr, const bool &active, const bool &filled)>  func) const
pure virtual

Loop over all the cells in serial order by read-only fashion.

Parameters
[in]funcFunction that processes a cell.
[in]parallelInstance to a parallel driver.

◆ const_serial_inside()

virtual void array_core3::const_serial_inside ( std::function< bool(int i, int j, int k, const void *value_ptr, const bool &active)>  func) const
pure virtual

Loop over all the filled cells in serial order by read-only fashion.

Parameters
[in]funcFunction that processes a cell.

◆ copy()

virtual void array_core3::copy ( const array_core3 array,
std::function< void(void *target, const void *src)>  copy_func,
const parallel_driver parallel 
)
pure virtual

Copy grid.

Parameters
[in]arraySource grid to copy.
[in]copy_funcFunction that performs copy of an element.
[in]parallelInstance to a parallel driver.

◆ count()

virtual size_t array_core3::count ( const parallel_driver parallel) const
pure virtual

Count the number of active cells.

Parameters
[in]parallelInstance to a parallel driver.
Returns
Count of active cells.

◆ dilate()

virtual void array_core3::dilate ( std::function< void(int i, int j, int k, void *value_ptr, bool &active, const bool &filled, int thread_index)>  func,
const parallel_driver parallel 
)
pure virtual

Dilate cells.

Parameters
[in]funcFunction that specifies what value to assign on dilated cells.
[in]parallelInstance to a parallel driver.

◆ flood_fill()

virtual void array_core3::flood_fill ( std::function< bool(void *value_ptr)>  inside_func,
const parallel_driver parallel 
)
pure virtual

Perform flood fill.

Parameters
[in]inside_funcFunction that determines if the cell is inside.
[in]parallelInstance to a parallel driver.

◆ get()

virtual void array_core3::get ( unsigned &  nx,
unsigned &  ny,
unsigned &  nz,
unsigned &  element_size 
) const
pure virtual

Get grid information.

Parameters
[out]nxGrid width.
[out]nyGrid height.
[out]nzGrid depth.
[out]element_sizebytes per element

◆ initialize()

virtual void array_core3::initialize ( unsigned  nx,
unsigned  ny,
unsigned  nz,
unsigned  element_size 
)
pure virtual

Allocate grid memory with value.

Parameters
[in]nxGrid width.
[in]nyGrid height.
[in]nzGrid depth.
[in]element_sizebytes per element

◆ operator()()

virtual const void* array_core3::operator() ( int  i,
int  j,
int  k,
bool &  filled 
) const
pure virtual

Get a value of a cell.

Parameters
[in]iPosition on x coordinate
[in]jPosition on y coordinate
[in]kPosition on z coordinate
[out]filledWhether the position is filled.
Returns
Pointer to the value of the cell.

◆ parallel_actives()

virtual void array_core3::parallel_actives ( std::function< void(int i, int j, int k, void *value_ptr, bool &active, const bool &filled, int thread_index)>  func,
const parallel_driver parallel 
)
pure virtual

Loop over all the active cells in parallel.

Parameters
[in]funcFunction that processes a cell.
[in]parallelInstance to a parallel driver.

◆ parallel_all()

virtual void array_core3::parallel_all ( std::function< void(int i, int j, int k, void *value_ptr, bool &active, const bool &filled, int thread_index)>  func,
const parallel_driver parallel 
)
pure virtual

Loop over all the cells in parallel.

Parameters
[in]funcFunction that processes a cell.
[in]parallelInstance to a parallel driver.

◆ serial_actives()

virtual void array_core3::serial_actives ( std::function< bool(int i, int j, int k, void *value_ptr, bool &active, const bool &filled)>  func)
pure virtual

Loop over all the active cells in serial order.

Parameters
[in]funcFunction that processes a cell.

◆ serial_all()

virtual void array_core3::serial_all ( std::function< bool(int i, int j, int k, void *value_ptr, bool &active, const bool &filled)>  func)
pure virtual

Loop over all the cells in serial order.

Parameters
[in]funcFunction that processes a cell.
[in]parallelInstance to a parallel driver.

◆ set()

virtual void array_core3::set ( int  i,
int  j,
int  k,
std::function< void(void *value_ptr, bool &active)>  func 
)
pure virtual

Set a value of a cell.

Parameters
[in]iPosition on x coordinate
[in]jPosition on y coordinate
[in]kPosition on z coordinate
[in]funcFunction that sets a value.

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