Represents a tree of groups. More...
#include <group.h>
Public Member Functions | |
| group (int nelem, const mesh &Mesh) | |
| Creates a base group, consisting of a given element. | |
| group (const mesh &Mesh) | |
| Creates a set of groups, encompassing all the elements in the mesh. This creates base groups for all the elemens in the mesh and adds them as children of this group. | |
| void | subdivide (mesh &m, double maxallowedarea) |
| Subdivides this group and its children. Subdivision is done until no base group has area, larger than maxallowedarea. | |
| void | makeSubdivided (const group &g1, const group &g2) |
| Makes this group "subdivided", preserving the initial size and other parameters. | |
| int | size () const |
| returns the number of sub-groups of this group. | |
| bool | isBase () const |
| Checks if this is a base group. | |
| int | getNElement () |
| Returns the number of underlying element for a base group. | |
| bool | isNear (const group &other, double maxangle) const |
| Checks if this group is near another. If any group is viewed from the position of the other at an angle, bigger than the specified threshold, the group is considered to be near. | |
| bool | isBigger (const group &other) |
| Checks if this group is bigger than the other. | |
| const moments & | getMpole () |
| Returns the multipole moments of this group. | |
| const moments & | getSmoothField () |
| Returns the smooth field Taylor expansion around the group center. | |
| bool | checkGroupCoverage (const mesh &m) |
| Checks that both partners and near partners of this group and its parents cover the whole particle exactly once. Should be called for a base group, otherwise result is always false. | |
| int | getGroupsStorageSize () |
| Returns the amount of RAM, occupied by this group and all of its subgroups. | |
Protected Member Functions | |
| void | cullPartners (mesh &m, double maxangle) |
| Recursively fills partners and near partnets lists. | |
| void | linkBaseGroups (mesh &m) |
| Link base groups to the element numbers in the mesh. | |
| void | precalcTaylor (const mesh &m, double g) |
| Recursively precalculates Taylor expansion basis. | |
| void | updateMoments (const mesh &m, const charges &chrgF, const charges &chrgV, const charges &chrgS) |
| Calculate moments in all groups Additionally to calculating moments this function also resets the smooth field. | |
| void | updateSmoothField (const mesh &m) |
| Calculate smooth field in each group. Calculates smooth fields, should be called after moments are updated. | |
| void | noteNearPartner (mesh &m, int whose) |
| Recursively registers this group as near partner of another in the specified mesh object. | |
| void | markPartnerDownToBase (bool *marks) |
| Recursively marks partners of this group in specified bit array. | |
Represents a tree of groups.
| group::group | ( | int | nelem, | |
| const mesh & | Mesh | |||
| ) |
Creates a base group, consisting of a given element.
| nelem | is the number of the base element for this group. | |
| Mesh | is mesh, containing the element. |
References chord::getCenter(), nanomagn::mesh::getConfTrans(), and chord::getRadius().
| group::group | ( | const mesh & | Mesh | ) |
Creates a set of groups, encompassing all the elements in the mesh. This creates base groups for all the elemens in the mesh and adds them as children of this group.
| Mesh | mesh with elements. |
References nanomagn::mesh::getConfTrans(), nanomagn::mesh::getNElements(), chord::getRadius(), conftrans::getSingAngle(), conftrans::nsing(), and conftrans::T().
| bool group::checkGroupCoverage | ( | const mesh & | m | ) |
Checks that both partners and near partners of this group and its parents cover the whole particle exactly once. Should be called for a base group, otherwise result is always false.
| m | mesh on which this group is defined. |
References matrixss::getI(), matrixss::getJ(), nanomagn::mesh::getNearInteractionIndices(), nanomagn::mesh::getNElements(), matrixss::getNValues(), and isBase().
| void group::cullPartners | ( | mesh & | m, | |
| double | maxangle | |||
| ) | [protected] |
Recursively fills partners and near partnets lists.
| m | is the mesh, containing the elements. | |
| maxangle | is the "viewing" angle, used to disting between "near" and "far". |
References getNElement(), isBase(), and isNear().
Referenced by fmm::fmm().
| int group::getGroupsStorageSize | ( | ) |
Returns the amount of RAM, occupied by this group and all of its subgroups.
References isBase().
| const moments& nanomagn::group::getMpole | ( | ) | [inline] |
Returns the multipole moments of this group.
| const moments& nanomagn::group::getSmoothField | ( | ) | [inline] |
Returns the smooth field Taylor expansion around the group center.
| bool nanomagn::group::isBase | ( | ) | const [inline] |
Checks if this is a base group.
Referenced by checkGroupCoverage(), cullPartners(), getGroupsStorageSize(), linkBaseGroups(), markPartnerDownToBase(), noteNearPartner(), subdivide(), and updateMoments().
| bool nanomagn::group::isBigger | ( | const group & | other | ) | [inline] |
Checks if this group is bigger than the other.
| other | is the other group. |
| bool group::isNear | ( | const group & | other, | |
| double | maxangle | |||
| ) | const |
Checks if this group is near another. If any group is viewed from the position of the other at an angle, bigger than the specified threshold, the group is considered to be near.
| other | is the other group. | |
| maxangle | maximum viewing angle for the group to be considered "far". |
Referenced by cullPartners().
| void group::linkBaseGroups | ( | mesh & | m | ) | [protected] |
Link base groups to the element numbers in the mesh.
| m | is the mesh, containing the elements. |
References nanomagn::mesh::clearBaseGroupLinks(), getNElement(), isBase(), and nanomagn::mesh::linkBaseGroup().
Makes this group "subdivided", preserving the initial size and other parameters.
| g1 | is the first group of the subdivision. | |
| g2 | is the second group of the subdivision. |
| void group::markPartnerDownToBase | ( | bool * | marks | ) | [protected] |
Recursively marks partners of this group in specified bit array.
| marks | is the array, holding the marks. |
References isBase().
| void group::noteNearPartner | ( | mesh & | m, | |
| int | whose | |||
| ) | [protected] |
Recursively registers this group as near partner of another in the specified mesh object.
| m | is the current mesh. | |
| whose | is the group, whose near partner this group is to be. |
References getNElement(), isBase(), and nanomagn::mesh::noteNearInt().
| void group::precalcTaylor | ( | const mesh & | m, | |
| double | g | |||
| ) | [protected] |
Recursively precalculates Taylor expansion basis.
| m | is the mesh, containing the elements. | |
| g | particle's aspect ratio. |
References nanomagn::mesh::getCMI(), cmindices::prepTaylorCalcS(), and cmindices::prepTaylorCalcV().
Referenced by fmm::setG().
| int nanomagn::group::size | ( | ) | const [inline] |
returns the number of sub-groups of this group.
Base groups (consisting of a single element) have no sub-groups.
| void group::subdivide | ( | mesh & | m, | |
| double | maxallowedarea | |||
| ) |
Subdivides this group and its children. Subdivision is done until no base group has area, larger than maxallowedarea.
| m | mesh, holding the elements. | |
| maxallowedarea | specifies the target granularity of subdivision. |
References nanomagn::mesh::area(), nanomagn::mesh::divideElement(), and isBase().
| void group::updateMoments | ( | const mesh & | m, | |
| const charges & | chrgF, | |||
| const charges & | chrgV, | |||
| const charges & | chrgS | |||
| ) | [protected] |
Calculate moments in all groups Additionally to calculating moments this function also resets the smooth field.
| m | is the mesh, containing the elements. | |
| chrgF | Face charges, assigned to elements (base groups). | |
| chrgV | Volume charges, assigned to elements (base groups). | |
| chrgV | Volume charges, assigned to boundary elements (base groups, touching the outer boundary). |
References moments::addShifted(), moments::chargeMul(), moments::erase(), nanomagn::mesh::getCMI(), nanomagn::mesh::getMoments(), getNElement(), isBase(), and nanomagn::mesh::isOuterBoundary().
Referenced by fmm::energyMS().
| void group::updateSmoothField | ( | const mesh & | m | ) | [protected] |
Calculate smooth field in each group. Calculates smooth fields, should be called after moments are updated.
| m | is the mesh, containing the elements. |
References moments::addShiftedTaylor(), moments::addTaylor(), nanomagn::mesh::getCMI(), cmindices::prepTaylorCalcS(), and cmindices::prepTaylorCalcV().
Referenced by fmm::energyMS().
1.6.3