OOFEM 3.0
Loading...
Searching...
No Matches
oofem::ParallelContext Class Reference

#include <parallelcontext.h>

Collaboration diagram for oofem::ParallelContext:

Public Member Functions

 ParallelContext (EngngModel *e)
 ~ParallelContext ()
void init (int newDi)
int giveNumberOfLocalEqs ()
int giveNumberOfGlobalEqs ()
int giveNumberOfNaturalEqs ()
Convenience functions for working with distributed arrays.
bool isLocal (DofManager *dman)
double localNorm (const FloatArray &src)
double dotProduct (const FloatArray &a, const FloatArray &b)
double localDotProduct (const FloatArray &a, const FloatArray &b)
double accumulate (double local)
void accumulate (const FloatArray &local, FloatArray &global)
Natural2GlobalOrderinggiveN2Gmap ()
Natural2LocalOrderinggiveN2Lmap ()

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

◆ ParallelContext()

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.

References emodel, n2g, and n2l.

◆ ~ParallelContext()

oofem::ParallelContext::~ParallelContext ( )

Definition at line 51 of file parallelcontext.C.

Member Function Documentation

◆ accumulate() [1/2]

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::FloatArray::givePointer(), oofem::FloatArray::giveSize(), and oofem::FloatArray::resize().

◆ accumulate() [2/2]

double oofem::ParallelContext::accumulate ( double local)

◆ dotProduct()

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

Dot product for a distributed array. Common for convergence criterion and such.

References accumulate(), and localDotProduct().

◆ giveN2Gmap()

Natural2GlobalOrdering * oofem::ParallelContext::giveN2Gmap ( )
inline

◆ giveN2Lmap()

Natural2LocalOrdering * oofem::ParallelContext::giveN2Lmap ( )
inline

◆ giveNumberOfGlobalEqs()

int oofem::ParallelContext::giveNumberOfGlobalEqs ( )

Definition at line 91 of file parallelcontext.C.

References di, emodel, and n2g.

Referenced by init().

◆ giveNumberOfLocalEqs()

int oofem::ParallelContext::giveNumberOfLocalEqs ( )

Definition at line 75 of file parallelcontext.C.

References di, emodel, and n2g.

Referenced by init().

◆ giveNumberOfNaturalEqs()

int oofem::ParallelContext::giveNumberOfNaturalEqs ( )

◆ init()

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(), n2g, and n2l.

◆ isLocal()

bool oofem::ParallelContext::isLocal ( DofManager * dman)

◆ localDotProduct()

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

Dot product for a locally distributed array. Common for convergence criterion and such.

Definition at line 148 of file parallelcontext.C.

References oofem::FloatArray::dotProduct(), emodel, giveN2Lmap(), oofem::FloatArray::giveSize(), and n2l.

Referenced by dotProduct().

◆ localNorm()

double oofem::ParallelContext::localNorm ( const FloatArray & src)

Member Data Documentation

◆ di

int oofem::ParallelContext::di
protected

◆ emodel

◆ n2g

Natural2GlobalOrdering oofem::ParallelContext::n2g
protected

◆ n2l

Natural2LocalOrdering oofem::ParallelContext::n2l
protected

Definition at line 61 of file parallelcontext.h.

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


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

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011