PLaSK library

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
plask::edge::Strategy Struct Referenceabstract

Base, abstract for all classes which describe what do with points outside geometry in calculation space. More...

`#include <plask/geometry/edge.hpp>`

Inheritance diagram for plask::edge::Strategy:
[legend]

## Public Types
enum | Type { DEFAULT , SIMPLE , EXTEND , PERIODIC , MIRROR }
| Enum holding strategy types. More...

## Public Member Functions
virtual | ~Strategy ()
virtual Type | type () const =0
virtual void | applyLo (double bbox_lo, double bbox_hi, double &p, shared_ptr< Material > &result_material, const Strategy *opposite) const =0
| Apply strategy to given point `p`.
virtual void | applyHi (double bbox_lo, double bbox_hi, double &p, shared_ptr< Material > &result_material, const Strategy *opposite) const =0
| Apply strategy to given point `p`.
virtual bool | canMoveOutsideBoundingBox () const
| Check if this strategy can move point p to place outside bounding box.
virtual Strategy * | clone () const =0
| Clone this strategy.
virtual std::string | str () const =0
| Get string representation of this strategy.

## Static Public Member Functions
static Strategy * | fromStr (const std::string &str, const MaterialsDB &materialsDB=MaterialsDB::getDefault())
| Create new strategy (using operator new) described by string `str`.
static std::unique_ptr< Strategy > | fromStrUnique (const std::string &str, const MaterialsDB &materialsDB=MaterialsDB::getDefault())
| Create new strategy described by string `str`.

## Detailed Description

Base, abstract for all classes which describe what do with points outside geometry in calculation space.

Definition at line 29 of file edge.hpp.

## Member Enumeration Documentation

## ◆ Type

enum plask::edge::Strategy::Type

Enum holding strategy types.

Enumerator
DEFAULT |
SIMPLE |
EXTEND |
PERIODIC |
MIRROR |

Definition at line 32 of file edge.hpp.

## Constructor & Destructor Documentation

## ◆ ~Strategy()

virtual plask::edge::Strategy::~Strategy | ( |  | ) |
| inline virtual

Definition at line 40 of file edge.hpp.

## Member Function Documentation

## ◆ applyHi()

virtual void plask::edge::Strategy::applyHi | ( | double | bbox_lo,
|  | double | bbox_hi,
|  | double & | p,
|  | shared_ptr< Material > & | result_material,
|  | const Strategy * | opposite
| ) |  | const
| pure virtual

Apply strategy to given point `p`.

Parameters

  [in] | bbox_lo,bbox_hi | coordinates of geometry object bounding box in strategy working direction
  [in,out] | p | coordinate of point in strategy working direction, it's (must be) higher than `bbox_hi`, this method can move this point
  [out] | result_material | optionally, this method can assign to it material which should be used
  [in] | opposite | strategy at opposite side (if known)

Implemented in plask::edge::Null, plask::edge::SimpleMaterial, plask::edge::Extend, plask::edge::Periodic, and plask::edge::Mirror.

## ◆ applyLo()

virtual void plask::edge::Strategy::applyLo | ( | double | bbox_lo,
|  | double | bbox_hi,
|  | double & | p,
|  | shared_ptr< Material > & | result_material,
|  | const Strategy * | opposite
| ) |  | const
| pure virtual

Apply strategy to given point `p`.

Parameters

  [in] | bbox_lo,bbox_hi | coordinates of geometry object bounding box in strategy working direction
  [in,out] | p | coordinate of point in strategy working direction, it's (must be) lower than `bbox_lo`, this method can move this point
  [out] | result_material | optionally, this method can assign to it material which should be used
  [in] | opposite | strategy at opposite side (if known)

Implemented in plask::edge::Null, plask::edge::SimpleMaterial, plask::edge::Extend, plask::edge::Periodic, and plask::edge::Mirror.

## ◆ canMoveOutsideBoundingBox()

bool plask::edge::Strategy::canMoveOutsideBoundingBox | ( |  | ) | const
| virtual

Check if this strategy can move point p to place outside bounding box.

Default implementation return `false`.

Returns
  `true` if this strategy can move point p to place outside bounding box, `false` if this strategy always move point p to bounding box or doesn't move p at all

Reimplemented in plask::edge::Mirror.

Definition at line 23 of file edge.cpp.

## ◆ clone()

virtual Strategy * plask::edge::Strategy::clone | ( |  | ) | const
| pure virtual

Clone this strategy.

Returns
  strategy identical to this one, constructed using operator new

Implemented in plask::edge::Null, plask::edge::SimpleMaterial, plask::edge::Extend, plask::edge::Periodic, plask::edge::Mirror, and plask::edge::UniversalStrategy.

## ◆ fromStr()

Strategy * plask::edge::Strategy::fromStr | ( | const std::string & | str,
|  | const MaterialsDB & | materialsDB = `MaterialsDB::getDefault()`
| ) |  |
| static

Create new strategy (using operator new) described by string `str`.

Throw exception if `str` not describe strategy.

Parameters

  str | string which represent strategy, one of: "null", "periodic", "extend", "mirror", or material.
  materialsDB | source of materials, typically material database, used to get material

Returns
  created strategy

Definition at line 27 of file edge.cpp.

## ◆ fromStrUnique()

static std::unique_ptr< Strategy > plask::edge::Strategy::fromStrUnique | ( | const std::string & | str,
|  | const MaterialsDB & | materialsDB = `MaterialsDB::getDefault()`
| ) |  |
| inline static

Create new strategy described by string `str`.

Throw exception if `str` not describe strategy.

Parameters

  str | string which represent strategy, one of: "null", "periodic", "extend", "mirror", or material.
  materialsDB | source of materials, typically material database, used to get material

Returns
  created strategy managed by unique_ptr, same as `std::unique_ptr<Strategy>(fromStr(str, materialsDB))`

Definition at line 114 of file edge.hpp.

## ◆ str()

virtual std::string plask::edge::Strategy::str | ( |  | ) | const
| pure virtual

Get string representation of this strategy.

Returns
  string representation of this strategy

Implemented in plask::edge::Null, plask::edge::SimpleMaterial, plask::edge::Extend, plask::edge::Periodic, and plask::edge::Mirror.

## ◆ type()

virtual Type plask::edge::Strategy::type | ( |  | ) | const
| pure virtual

Returns
  strategy type

Implemented in plask::edge::Null, plask::edge::SimpleMaterial, plask::edge::Extend, plask::edge::Periodic, and plask::edge::Mirror.

The documentation for this struct was generated from the following files:

- plask/geometry/edge.hpp
- plask/geometry/edge.cpp