OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::ParallelContext Class Reference

This class provides an communication context for distributed memory parallelism. More...

#include <parallelcontext.h>

+ Collaboration diagram for oofem::ParallelContext:

Public Member Functions

 ParallelContext (EngngModel *e)
 Creates a context belonging to a system of equations in a given engineering model. More...
 
 ~ParallelContext ()
 
void init (int newDi)
 Initiates the mapping for given domain. More...
 
int giveNumberOfLocalEqs ()
 
int giveNumberOfGlobalEqs ()
 
int giveNumberOfNaturalEqs ()
 
Natural2GlobalOrderinggiveN2Gmap ()
 
Natural2LocalOrderinggiveN2Lmap ()
 
Convenience functions for working with distributed arrays.
bool isLocal (DofManager *dman)
 
double localNorm (const FloatArray &src)
 Norm for a locally distributed array. More...
 
double dotProduct (const FloatArray &a, const FloatArray &b)
 Dot product for a distributed array. More...
 
double localDotProduct (const FloatArray &a, const FloatArray &b)
 Dot product for a locally distributed array. More...
 
double accumulate (double local)
 Accumulates the global value. More...
 
void accumulate (const FloatArray &local, FloatArray &global)
 Accumulates the global value. More...
 

Protected Attributes

int di
 
EngngModelemodel
 
Natural2GlobalOrdering n2g
 
Natural2LocalOrdering n2l
 

Detailed Description

This class provides an communication context for distributed memory parallelism.

Tasks:

  • Keeping track of the parallel communicator.
  • Determining owner for shared dof managers.

Definition at line 54 of file parallelcontext.h.

Constructor & Destructor Documentation

oofem::ParallelContext::ParallelContext ( EngngModel e)

Creates a context belonging to a system of equations in a given engineering model.

Parameters
eEngineering model to work with.

Definition at line 43 of file parallelcontext.C.

oofem::ParallelContext::~ParallelContext ( )

Definition at line 51 of file parallelcontext.C.

Member Function Documentation

void oofem::ParallelContext::accumulate ( const FloatArray local,
FloatArray global 
)

Accumulates the global value.

Todo:
Why aren't we using the C++ MPI functions?

Definition at line 184 of file parallelcontext.C.

References emodel, oofem::EngngModel::giveParallelComm(), oofem::FloatArray::givePointer(), oofem::FloatArray::giveSize(), oofem::EngngModel::isParallel(), and oofem::FloatArray::resize().

double oofem::ParallelContext::dotProduct ( const FloatArray a,
const FloatArray b 
)

Dot product for a distributed array.

Common for convergence criterion and such.

Natural2LocalOrdering* oofem::ParallelContext::giveN2Lmap ( )
inline
int oofem::ParallelContext::giveNumberOfGlobalEqs ( )
int oofem::ParallelContext::giveNumberOfLocalEqs ( )
int oofem::ParallelContext::giveNumberOfNaturalEqs ( )
void oofem::ParallelContext::init ( int  newDi)

Initiates the mapping for given domain.

Parameters
diDomain index.
Todo:
Should we even do this here? The user of the requested ParallelContext will just set this manually instead.
Todo:
This shouldn't be hardcoded to just the default numbering schemes. In fact, this shouldn't even have "prescribed" and "free", just use the given numbering.

Definition at line 55 of file parallelcontext.C.

References di, emodel, giveNumberOfGlobalEqs(), giveNumberOfLocalEqs(), giveNumberOfNaturalEqs(), oofem::EngngModel::giveRank(), oofem::Natural2GlobalOrdering::init(), oofem::Natural2LocalOrdering::init(), oofem::EngngModel::isParallel(), n2g, and n2l.

double oofem::ParallelContext::localDotProduct ( const FloatArray a,
const FloatArray b 
)

Member Data Documentation

int oofem::ParallelContext::di
protected
EngngModel* oofem::ParallelContext::emodel
protected
Natural2GlobalOrdering oofem::ParallelContext::n2g
protected

Definition at line 60 of file parallelcontext.h.

Referenced by giveNumberOfGlobalEqs(), giveNumberOfLocalEqs(), and init().

Natural2LocalOrdering oofem::ParallelContext::n2l
protected

Definition at line 61 of file parallelcontext.h.

Referenced by init(), localDotProduct(), and localNorm().


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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:39 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011