MOERTEL::Interface Class Reference

A class to construct a single interface. More...

#include <mrtr_interface.H>

List of all members.

Public Types

 proj_none
 proj_continousnormalfield
 proj_orthogonal
enum  ProjectionType { proj_none, proj_continousnormalfield, proj_orthogonal }
 Type of projections to be used to construct the Mortar projection from the mortar to the slave side. More...

Public Member Functions

 Interface (int Id, bool oneD, Epetra_Comm &comm, int outlevel)
 Creates an (empty) instance of this class.
 Interface (MOERTEL::Interface &old)
 Copy-constructor.
virtual ~Interface ()
 Destructor.
int OutLevel () const
 Returns the level of output to stdout generated by this class ( 0 - 10 ).
bool IsOneDimensional () const
 Returns true if this interface is a 1D-interface of a 2D-problem.
bool Print () const
 Prints complete interface information to stdout.
bool IsComplete () const
 Returns true if Complete() has been called and false otherwise.
bool IsIntegrated () const
 Returns true if this interface has been successfully integrated and false otherwise.
int Id () const
 Returns the unique interface id associated with this instance and chosen by the user.
const Epetra_Comm & gComm () const
 Returns the Epetra_Comm object associated with this interface.
const Epetra_Comm * lComm () const
 Returns the interface-local Epetra_Comm object associated with this interface.
int MortarSide () const
 Returns the Mortar side of the interface.
int OtherSide (int side) const
 Returns 0 if side is 1 and returns 1 if side is 0 .
ProjectionType GetProjectionType () const
 Return the projection type to be used and as set by the user.
int GetSide (MOERTEL::Segment *seg)
 Returns the side the MOERTEL::Segment seg is on ( 0 or 1 ).
int GetSide (MOERTEL::Node *node)
 Returns the side the MOERTEL::Node node is on ( 0 or 1 ).
int GetSide (int nodeid)
 Returns the side the MOERTEL::Node node with id nodeid is on ( 0 or 1 ).
int MyNsegment (int side)
 Returns the number of segments on the specified side ( 0 or 1) that are owned by the calling processor.
int GlobalNsegment (int side)
 Returns the total number of segments on the specified side ( 0 or 1) that are owned by ALL processors that are a member of the interface-local Epetra_Comm lComm().
int MyNsegment ()
 Returns the number of segments on both sides of the interface that are owned by the calling processor.
int GlobalNsegment ()
 Returns the global number of segments on both sides of the interface.
int MyNnode (int side)
 Returns local number of nodes on interface side 0 or 1.
int MyNnode ()
 Returns local total number of nodes on interface on both sides.
int GlobalNnode (int side)
 Returns global number of nodes on interface on side 0 or 1.
int GlobalNnode ()
 Returns global number of nodes on interface on both sides.
int NodePID (int nid) const
 Returns the local PID of the owner of the node with Id nid.
int SegPID (int sid) const
 Returns the local PID of the owner of the segment with Id sid.
RefCountPtr< MOERTEL::NodeGetNodeView (int nid)
 Get a view of a MOERTEL::Node (of either side) specifying node id.
MOERTEL::Node ** GetNodeView ()
 Get a view of all nodes on this interface.
bool GetNodeView (vector< MOERTEL::Node * > &nodes)
 Get a view of all nodes on this interface (both sides).
RefCountPtr< MOERTEL::SegmentGetSegmentView (int sid)
 Get a view of a MOERTEL::Segment (of either side) specifying segment id.
MOERTEL::Segment ** GetSegmentView ()
 Get a view of all segments on this interface.
bool Complete ()
 Finalizes the construction of the interface instance.
bool AddSegment (MOERTEL::Segment &seg, int side)
 Add a segment to the interface on either side 1 or 0.
bool AddNode (MOERTEL::Node &node, int side)
 Add a node to the interface on either side 1 or 0.
bool SetMortarSide (int side)
 Choose Mortar side of the interface.
bool SetFunctionAllSegmentsSide (int side, int id, MOERTEL::Function *func)
 Set shape function to all segments on a specified side.
bool Mortar_Integrate_2D (RefCountPtr< Teuchos::ParameterList > intparams)
 Integrate the mortar integrals on this interface (1D interface).
bool Mortar_Integrate (RefCountPtr< Teuchos::ParameterList > intparams)
 Integrate the mortar integrals on this interface (2D interface).
bool Mortar_Assemble (Epetra_CrsMatrix &D, Epetra_CrsMatrix &M)
 Assemble coupling matrices D and M after integration.
void SetProjectionType (MOERTEL::Interface::ProjectionType typ)
 Set type of projection to be used for the mortar projection.
bool Project ()
 Build averaged nodal normals and projects nodes to other side.
bool BuildNormals ()
 Build averaged nodal normals.
int SetLMDofs (int minLMGID)
 Choose degrees of freedom for Lagrange multipliers.
vector< int > * MyLMIds ()
 Return vector of all Lagrange multiplier degrees of freedom on this interface.
bool DetectEndSegmentsandReduceOrder ()
 Makes neccessary boundary modification for 1D and 2D interfaces.
bool SetFunctionTypes (MOERTEL::Function::FunctionType primal, MOERTEL::Function::FunctionType dual)
 Set types of shape functions to be used.
bool SetFunctionsFromFunctionTypes ()
 Set functions from function types.

Friends

class Integrator
 the MOERTEL::Integrator class is a friend to the interface class


Detailed Description

A class to construct a single interface.

Date:
Last update do Doxygen: 20-March-06


Member Enumeration Documentation

enum MOERTEL::Interface::ProjectionType

Type of projections to be used to construct the Mortar projection from the mortar to the slave side.

Parameters:
proj_none default value
proj_continousnormalfield Projection using a C0-continuous field of normals of the slave side.
proj_orthogonal Orthogonal projection onto interface segments (Only with 1D interfaces))


Constructor & Destructor Documentation

MOERTEL::Interface::Interface ( int  Id,
bool  oneD,
Epetra_Comm &  comm,
int  outlevel 
) [explicit]

Creates an (empty) instance of this class.

Constructs an empty instance of this class that is then filled buy the user with information about the nodes and segments on this interface
This is a collective call for all processors associated with the Epetra_Comm.

Parameters:
Id : A unique positive interface id. Does not need to be continous among several interfaces
oneD : true if this interface is a 1D-interface of a 2D problem
comm : An Epetra_Comm object handle
outlevel : Level of output information written to stdout ( 0 - 10 )

MOERTEL::Interface::Interface ( MOERTEL::Interface old  ) 

Copy-constructor.

Constructs a deep copy.

MOERTEL::Interface::~Interface (  )  [virtual]

Destructor.

Destroys this instance and all data it has ownership of


Member Function Documentation

bool MOERTEL::Interface::AddNode ( MOERTEL::Node node,
int  side 
)

Add a node to the interface on either side 1 or 0.

Adds a node MOERTEL::Node to this interface class on side 0 or 1

This is not a collective call, the process that is adding the node will become
owner of that node and will therefore be member of the interface-local
Epetra_Comm lComm()

The MOERTEL::Interface class will not take ownership of the Node node,
instead it will create a deep copy of it so the user can destroy the
node instance immediately after passing it to this method.

No more nodes can be added after the interface has been completed with
a call to Complete()

Parameters:
node : Node to be stored in this interface instance
side,: side of interface (0 or 1) this segment belongs to
Warning:
The user is responsible for passing in nodes only once and on one process.
Also, each node must have a unique, positive but not neccessarily contigous id.
Returns:
True if successful, false otherwise

bool MOERTEL::Interface::AddSegment ( MOERTEL::Segment seg,
int  side 
)

Add a segment to the interface on either side 1 or 0.

Adds a segment MOERTEL::Segment to this interface class on side 0 or 1

This is not a collective call, the process that is adding the segment will become
owner of that segment and will therefore be member of the interface-local
Epetra_Comm lComm()

The MOERTEL::Interface class will not take ownership of the Segment seg,
instead it will create a deep copy of it so the user can destroy the
seg instance immediately after passing it to this method.

No more segments can be added after the interface has been completed with
a call to Complete()

Parameters:
seg : Segment to be stored in this interface instance
side,: side of interface (0 or 1) this segment belongs to
Warning:
The user is responsible for passing in segments only once and on one process.
Also, each segment must have a unique, positive but not neccessarily contigous id.
Returns:
True if successful, false otherwise

bool MOERTEL::Interface::Complete (  ) 

Finalizes the construction of the interface instance.

A call to this method is neccesary to finalize the construction of an interface.
After a call to Complete() no nodes or segments can be added any more.

Whether Complete() has been called can be checked using IsComplete()

It is also a neccessary condition for several query methods to work, such as
lComm() , GetSide(MOERTEL::Segment* seg) GetSide(MOERTEL::Node* node)
GetSide(int nodeid) , GlobalNsegment(int side) , GlobalNsegment() ,
GlobalNnode(int side) , GlobalNnode() , NodePID(int nid) const ,
NodePID(int nid) const , Mortar_Integrate() , Mortar_Integrate(Epetra_CrsMatrix& D, Epetra_CrsMatrix& M)

Complete() has to be called before adding the interface to the MOERTEL::Manager

No nodes or segments can be added to the interface anymore after a call to Complete()

Warning:
This is a collective call for all processes that are member of gComm()
Returns:
True if successful, false otherwise

bool MOERTEL::Interface::DetectEndSegmentsandReduceOrder (  ) 

Makes neccessary boundary modification for 1D and 2D interfaces.

Shape functions of segments close to the boundary of a 1D or 2D interface need to be modified to ensure stability of the method.

const Epetra_Comm& MOERTEL::Interface::gComm (  )  const [inline]

Returns the Epetra_Comm object associated with this interface.

Note that all interfaces to be used in ONE MOERTEL::Manager should share the same Epetra_Comm object with that MOERTEL::Manager

bool MOERTEL::Interface::GetNodeView ( vector< MOERTEL::Node * > &  nodes  ) 

Get a view of all nodes on this interface (both sides).

Returns false if calling process is not part of the intra-communicator of the interface.

MOERTEL::Node ** MOERTEL::Interface::GetNodeView (  ) 

Get a view of all nodes on this interface.

A vector of ptrs to all nodes on this interface is allocated and returned to the user. The user is responsible for deleting this vector. NULL is returned if Complete() was not called or the calling processor is not a member of lComm()

RefCountPtr< MOERTEL::Node > MOERTEL::Interface::GetNodeView ( int  nid  ) 

Get a view of a MOERTEL::Node (of either side) specifying node id.

Returns a view of a MOERTEL::Node of this interface.
Returns Teuchos::null if calling processor is not member of lComm() or
a node with id nid does not exist on this interface.
The method returns a Teuchos::RefCountPtr<MOERTEL::Node> to the node, see Teuchos documentation

Parameters:
nid : id of node to get a view from

ProjectionType MOERTEL::Interface::GetProjectionType (  )  const [inline]

Return the projection type to be used and as set by the user.

Return the projection type to be used and as set by the user with SetProjectionType

MOERTEL::Segment ** MOERTEL::Interface::GetSegmentView (  ) 

Get a view of all segments on this interface.

A vector of ptrs to all segments on this interface is allocated and returned to the user. The user is responsible for deleting this vector. NULL is returned if Complete() was not called or the calling processor is not a member of lComm()

RefCountPtr< MOERTEL::Segment > MOERTEL::Interface::GetSegmentView ( int  sid  ) 

Get a view of a MOERTEL::Segment (of either side) specifying segment id.

Returns a view of a MOERTEL::Segment of this interface.
Returns Teuchos::null if calling processor is not member of lComm() or
a segment with id sid does not exist on this interface.
The method returns a Teuchos::RefCountPtr<MOERTEL::Segment> to the node, see Teuchos documentation

Parameters:
sid : id of segment to get a view from

int MOERTEL::Interface::GetSide ( int  nodeid  ) 

Returns the side the MOERTEL::Node node with id nodeid is on ( 0 or 1 ).

Returns -1 if

Parameters:
nodeid : node id of node to return the side it is on for

int MOERTEL::Interface::GetSide ( MOERTEL::Node node  ) 

Returns the side the MOERTEL::Node node is on ( 0 or 1 ).

Returns -1 if

Parameters:
node : MOERTEL::Node to return the side it is on for

int MOERTEL::Interface::GetSide ( MOERTEL::Segment seg  ) 

Returns the side the MOERTEL::Segment seg is on ( 0 or 1 ).

Returns -1 if

Parameters:
seg : MOERTEL::Segment to return the side it is on for

int MOERTEL::Interface::GlobalNnode (  ) 

Returns global number of nodes on interface on both sides.

Returns the number of global nodes on both sides of the interface

Returns -1 if

Returns 0 if

int MOERTEL::Interface::GlobalNnode ( int  side  ) 

Returns global number of nodes on interface on side 0 or 1.

Returns the number of global nodes on side 0 or 1 of the interface

Returns -1 if

Returns 0 if

Parameters:
side : Side of interface (0 or 1)

int MOERTEL::Interface::GlobalNsegment (  ) 

Returns the global number of segments on both sides of the interface.

Returns -1 if Complete() has not been called
Returns 0 if the calling processor is not member of the interface-local communicator lComm()

int MOERTEL::Interface::GlobalNsegment ( int  side  ) 

Returns the total number of segments on the specified side ( 0 or 1) that are owned by ALL processors that are a member of the interface-local Epetra_Comm lComm().

Returns -1 if

Returns 0 if

Parameters:
side : side of interface (0 or 1)

int MOERTEL::Interface::Id (  )  const [inline]

Returns the unique interface id associated with this instance and chosen by the user.

Note that interface ids have to be positive and unique but do not need to be continous

const Epetra_Comm* MOERTEL::Interface::lComm (  )  const [inline]

Returns the interface-local Epetra_Comm object associated with this interface.

It returns NULL if Complete() has not been called.

Warning:
This Epetra_Comm object is for communication among processors that have business on this instance. It is NULL for all other processors.

bool MOERTEL::Interface::Mortar_Assemble ( Epetra_CrsMatrix &  D,
Epetra_CrsMatrix &  M 
)

Assemble coupling matrices D and M after integration.

This method is used by the MOERTEL::Manager to assemble values from the integration to the coupling matrices D and M

Returns:
True if successful, false otherwise

bool MOERTEL::Interface::Mortar_Integrate ( RefCountPtr< Teuchos::ParameterList >  intparams  ) 

Integrate the mortar integrals on this interface (2D interface).

The method performs the integration of the mortar integral on this interface. the user should not call this method directly but use a MOERTEL::Manager to control the integration to make sure all neccessary prerequisites are fulfilled

Parameters:
intparams : parameter list from the MOERTEL::Manager holding integration parameters
Warning:
Complete() has to be called before integration
Returns:
True if successful, false otherwise

bool MOERTEL::Interface::Mortar_Integrate_2D ( RefCountPtr< Teuchos::ParameterList >  intparams  ) 

Integrate the mortar integrals on this interface (1D interface).

The method performs the integration of the mortar integral on this interface. the user should not call this method directly but use a MOERTEL::Manager to perform the integration to make sure all neccessary prerequisites are fulfilled

Parameters:
intparams : parameter list from the MOERTEL::Manager holding integration parameters
Warning:
Complete() has to be called before integration
Returns:
True if successful, false otherwise

int MOERTEL::Interface::MortarSide (  )  const [inline]

Returns the Mortar side of the interface.

It returns the mortar side of the interface, which is either 0 or 1
It returns -1 if the mortar side was not yet set by the user
It returns -2 if the user expects the mortar side to be chosen automatically by the MOERTEL::Manager . (That is, the user dis set -2 as the mortar side using SetMortarSide )

int MOERTEL::Interface::MyNnode (  )  [inline]

Returns local total number of nodes on interface on both sides.

Returns the number of nodes owned by the calling processor on both sides of the interface

Returns 0 if

int MOERTEL::Interface::MyNnode ( int  side  )  [inline]

Returns local number of nodes on interface side 0 or 1.

Returns the number of nodes owned by the calling processor on a side of the interface

Returns 0 if

Parameters:
side : Side of interface (0 or 1)

int MOERTEL::Interface::MyNsegment (  )  [inline]

Returns the number of segments on both sides of the interface that are owned by the calling processor.

Returns 0 if

int MOERTEL::Interface::MyNsegment ( int  side  )  [inline]

Returns the number of segments on the specified side ( 0 or 1) that are owned by the calling processor.

Returns 0 if

Parameters:
side : Side of interface (0 or 1)

int MOERTEL::Interface::NodePID ( int  nid  )  const

Returns the local PID of the owner of the node with Id nid.

Returns the PID (process id) in the interface-local Epetra_Comm lComm() of the local process that owns the node with the id nid

Returns -1 if

Parameters:
nid : Unique node Id

int MOERTEL::Interface::OtherSide ( int  side  )  const

Returns 0 if side is 1 and returns 1 if side is 0 .

Issues a warning and returns -1 if side is neither 0 or 1

Parameters:
side : side (0 or 1) to return the other side for

int MOERTEL::Interface::SegPID ( int  sid  )  const

Returns the local PID of the owner of the segment with Id sid.

Returns the PID (process id) in the interface-local Epetra_Comm lComm() of the local process that owns the segment with the id sid

Returns -1 if

Parameters:
nid : Unique node Id

bool MOERTEL::Interface::SetFunctionAllSegmentsSide ( int  side,
int  id,
MOERTEL::Function func 
)

Set shape function to all segments on a specified side.

The user has to specify the type of shape functions he wants to use as discretization of the trace space and the Lagrange multiplier space manually. This is done by attaching one or two MOERTEL::Function derived classes to the segments.

The MOERTEL::Interface class does not take ownership of func and the instance func can be destroyed directly after a call to this method

Parameters:
side : Side of the interface (0 or 1) the function is to be attached to
id : Function id. The trace space shape function has to have id=0, the mortar space shape function has to have id=1. Therefore, on the mortar side, only one function with id=0 is neccessary while on the slave side (where the Lagrange multipliers 'live') 2 functions with id=0 and id=1 are neccessary.
func : MOERTEL::Function derived function class to be associated with the shape functions of the trace soace or the mortar space
For future extension of this package, any number of functions can be associated with one segment as long as each function has a unique positive id.
Currently the package makes use of functions with ids 0 (trace space) and 1 (mortar space)

Warning:
In case the Mortar side is unknown to the user as he wishes to leave the choice of the Mortar side to the MOERTEL::Manager, he can not set the mortar space shape functions to the slave side (as the slave side is unknown). In this case SetFunctionTypes(MOERTEL::Function::FunctionType primal, MOERTEL::Function::FunctionType dual) should be used to specify the types of shape functions on wishes to use. The MOERTEL::Manager will then associate the approbiate shape functions with the segments on the approbiate sides once the mortar side was chosen. This though only works when derived function classes and types are used that are known to the MOERTEL::Manager. If the user want to create his/her own shae functions and use them, he/she needs to set them manually using this method.
Returns:
True if successful, false otherwise

bool MOERTEL::Interface::SetFunctionsFromFunctionTypes (  ) 

Set functions from function types.

Set the functions from the function types chosen by the user with SetFunctionTypes(MOERTEL::Function::FunctionType primal, MOERTEL::Function::FunctionType dual).
This method is called by the MOERTEL::Manager and should not be used directly.

bool MOERTEL::Interface::SetFunctionTypes ( MOERTEL::Function::FunctionType  primal,
MOERTEL::Function::FunctionType  dual 
)

Set types of shape functions to be used.

If the user wishes not to set the shape functions for the trace space and the mortar space himself he can use this method to set just the types of functions to be used. Also, if the user does not choose the Mortar side of the interface but leaves the choice to the MOERTEL::Manager class he has to specify the types of functions intended to be used. They will be set to the interfaces once the MOERTEL::Manager chose the mortar side.

This only works for supported shape functions, not for user created shape functions.
Supported shape functions are:
MOERTEL::Function_Constant1D
MOERTEL::Function_Linear1D
MOERTEL::Function_DualLinear1D
MOERTEL::Function_LinearTri
MOERTEL::Function_DualLinearTri
MOERTEL::Function_ConstantTri

As not all of these functions make sense as trace space or mortar space functions,
an error or a warning will be issued for some choices. E.g. setting dual shape functions as primal functions is a bad idea.

bool MOERTEL::Interface::SetMortarSide ( int  side  ) 

Choose Mortar side of the interface.

It is neccessary to choose the mortar side on each interface.
(Note that the discretization of the Lagrange mutlipliers is equal to the non-Mortar side)

Choices are:

Parameters:
side,: side of interface which is to become mortar side
Returns:
True if successful, false otherwise

void MOERTEL::Interface::SetProjectionType ( MOERTEL::Interface::ProjectionType  typ  )  [inline]

Set type of projection to be used for the mortar projection.

the user needs to choose the type of projection to be used to project nodes from the mortar side to the slave side ('mesh imprinting')

Choices are


The documentation for this class was generated from the following files:
Generated on Tue Jul 13 09:37:14 2010 for Moertel by  doxygen 1.4.7