nanomagn::group Class Reference

Represents a tree of groups. More...

#include <group.h>

Inheritance diagram for nanomagn::group:
chord nanomagn::exchange fmm

List of all members.

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.

Detailed Description

Represents a tree of groups.

Author:
Konstantin L. Metlov <metlov@kinetic.ac.donetsk.ua>

Constructor & Destructor Documentation

group::group ( int  nelem,
const mesh &  Mesh 
)

Creates a base group, consisting of a given element.

Parameters:
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.

Parameters:
Mesh mesh with elements.

References nanomagn::mesh::getConfTrans(), nanomagn::mesh::getNElements(), chord::getRadius(), conftrans::getSingAngle(), conftrans::nsing(), and conftrans::T().


Member Function Documentation

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.

Parameters:
m mesh on which this group is defined.
Returns:
true if the assertion holds.

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.

Parameters:
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.

Returns:
The amount of RAM in bytes.

References isBase().

const moments& nanomagn::group::getMpole (  )  [inline]

Returns the multipole moments of this group.

Returns:
multipole moments of the group
const moments& nanomagn::group::getSmoothField (  )  [inline]

Returns the smooth field Taylor expansion around the group center.

Returns:
Taylor expansion coefficients.
bool nanomagn::group::isBase (  )  const [inline]

Checks if this is a base group.

Returns:
true if this group is the 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.

Parameters:
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.

Parameters:
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.

Parameters:
m is the mesh, containing the elements.

References nanomagn::mesh::clearBaseGroupLinks(), getNElement(), isBase(), and nanomagn::mesh::linkBaseGroup().

void group::makeSubdivided ( const group &  g1,
const group &  g2 
)

Makes this group "subdivided", preserving the initial size and other parameters.

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Returns:
the number of sub groups this group has.
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.

Parameters:
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.

Parameters:
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.

Parameters:
m is the mesh, containing the elements.

References moments::addShiftedTaylor(), moments::addTaylor(), nanomagn::mesh::getCMI(), cmindices::prepTaylorCalcS(), and cmindices::prepTaylorCalcV().

Referenced by fmm::energyMS().


The documentation for this class was generated from the following files:
Generated on Mon Oct 8 18:26:45 2012 for nanomagnFMM by  doxygen 1.6.3