#include <mrtr_interface.H>
Public Types | |
| 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 | |
Constructors and destructors | |
| 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. | |
Query methods | |
| 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::Node > | GetNodeView (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::Segment > | GetSegmentView (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. | |
Construction methods | |
| 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 | |
This class is used to construct a single conforming or non-conforming interface. The interface is constructed by creating an empty instance of this class and then filling it with nodes and segments from both sides of the interface using the methods AddSegment (MOERTEL::Segment &seg, int side) and AddNode (MOERTEL::Node &node, int side).
After all segment and all nodes of an interface are added, a call to Complete() finalizes the construction phase of the interface.
Once the interface is constructed and Complete() was called, it should be passed to an instance of the MOERTEL::Manager to handle the integration phase. It is highly recommended not to call any integration methods on the interface directly but leave this task to the MOERTEL::Manager class that takes care of assembly of integration results and the case were nodes appear on more then one interface.
Aspects of Interface geometry:
An interface can be either 2-dimensional (for 3D problems) or 1-dimensional (for 2D problems).
It can also be curved in space or straight. In the latter case, the Mortar method guarantees the patch test for linear functions in 3D and 2D problems.
With curved interfaces, the patch test is not guaranteed but approximation properties tend to be significantly better then with simple node-to-segment (or similar) approaches.
The two sides of an interface need not have conforming discretizations, need not discretize the same geometry and might overlap only partially. This means one side of an interface might be significantly larger then the other side. Also, end points of an interface side need not match.
1D Example (also holds for 2D interfaces):
o----------o----------o----------o----------o--------------o side 0 o-----o-----o-----o-----o-----o-----o-----o-----o-----o-----o-----o------o------o side 1
In the 1D interface case, end points of an interface are detected automatically while in the 2D interface case, the user has to supply information which nodes fall on the boundary of an interface.
In the case of more then one interface, each interface must have 2 distinct sides.
Also, each interface side must not overlap with any other interface side.
1D Example (also holds for 2D interfaces):
||
||
|o
||
Interface 3, side 1 --> o| <-- Interface 3, side 0
||
|o
o|
||
|o
o|
||
<-- Interface 1, side 0 --> ||<-- Interface 2, side 1 -->
o------o----------o----------o----------o-----------oo--o--o--o--o--o--o--o--o--o
o-----o-----o-----o-----o-----o-----o-----o-----o-----o-----o-----o------o------o-----o-----o
<-- Interface 1 side 1 -->
<-- Interface 2 side 0 -->
The example above shows a perfectly legal (though rather advanced an unsusal) case.
Aspects of parallelity:
The Moertel package can handle multiple interfaces in serial and in parallel. When running in serial, the Mortar package expects the Epetra_Comm argument in the construction of MOERTEL::Manager and MOERTEL::Interface to implement an Epetra_SerialComm.
When running in parallel the MOERTEL package epxects this Epetra-Comm to implement Epetra_MPIComm. In the parallel case the package mainly makes use of the communication methods of the Epetra_MPIComm but also performs direct MPI calls using the MPI communicator extracted from the Epetra_MPIComm.
Passing nodes and segments via AddNode and AddSegment to an Interface instance implicitly defines the processes ownership over those objects. Calls to these methods therefore are never collective! Passing a node or segment object to an Interface also results in the process taking part in the integration of this Interface. the call to Complete() will create a interface-local Epetra_MPIComm or Epetra_SerialComm as subset of the global Epetra_comm supplied by the user. All processes that passed segments or nodes to the interface will become member of that interface-local communicator. Processes not passing any data to the interface will not participate in the integration of that specific interface and the integration will be non-blocking to them.
Note that when defining several interfaces, the interface-local communicators might be overlapping subsets of the global communicator.
Example 1: Running on 6 processes
Process 0 has objects on interface 1 and 2
Process 1 has objects on interface 1
Process 2 has objects on interface 2
Process 3 has objects on interface 2
Process 4 has objects on interface 1
Process 5 has no objects on any interface
Result:
Processes 0,1,4 share integration on interface 1
Processes 2,3 share integration on interface 2
Process 5 is not blocked by the MOERTEL package
Interfaces 1,2 are computed completely in parallel as interface subsets are non-overlapping
Example 1: Running on 4 processes
Process 0 has objects on interface 1 and 2
Process 1 has objects on interface 1
Process 2 has objects on interface 2
Process 3 has no objects on any interface
Result:
Processes 0,1 share integration on interface 1
Process 2 does integration on interface 2 alone
Process 3 is not blocked by the MOERTEL package
Interfaces 1,2 are computed in serial as interface subsets are overlapping
All calls to the Interface(int Id, bool oneD, Epetra_Comm& comm, int outlevel) constructor are collective for all processes that are part of the Epetra_Comm comm.
The computation phase though will not be collective as computations are only shared among those processes that have ownership of a node or a segment on this interface. That is process that passed in a segment or a node to this interface and therefore become a member of the internally constructed interface-local Epetra_Comm lComm().
The computation is non-blocking for all other processes. This allows the parallel computation of several interfaces at the same time.
This approach assumes that the user will balance the underlying domain among processes but will not try to balance the layout of the interfaces. It can therefore be expected that interfaces will not be load balanced. Therefore, a single interface can be shared among an arbitrary subset of all processes in any geometrical configuration. It is though computationally advantageous when as few as possible processes work on a single interface and non-overlapping subsets of processes work on different interfaces at the same time.
The MOERTEL::Interface class supports the ostream& operator <<
|
|
Type of projections to be used to construct the Mortar projection from the mortar to the slave side.
|
|
||||||||||||||||||||
|
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
|
|
|
Copy-constructor. Constructs a deep copy. |
|
|
Destructor. Destroys this instance and all data it has ownership of |
|
||||||||||||
|
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
The MOERTEL::Interface class will not take ownership of the Node node,
No more nodes can be added after the interface has been completed with
|
|
||||||||||||
|
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
The MOERTEL::Interface class will not take ownership of the Segment seg,
No more segments can be added after the interface has been completed with
|
|
|
Finalizes the construction of the interface instance.
A call to this method is neccesary to finalize the construction of an interface. Whether Complete() has been called can be checked using IsComplete()
It is also a neccessary condition for several query methods to work, such as 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()
|
|
|
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. |
|
|
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 |
|
|
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. |
|
|
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() |
|
|
Get a view of a MOERTEL::Node (of either side) specifying node id.
Returns a view of a MOERTEL::Node of this interface.
|
|
|
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 |
|
|
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() |
|
|
Get a view of a MOERTEL::Segment (of either side) specifying segment id.
Returns a view of a MOERTEL::Segment of this interface.
|
|
|
Returns the side the MOERTEL::Node node with id nodeid is on ( 0 or 1 ). Returns -1 if
|
|
|
Returns the side the MOERTEL::Node node is on ( 0 or 1 ). Returns -1 if
|
|
|
Returns the side the MOERTEL::Segment seg is on ( 0 or 1 ). Returns -1 if
|
|
|
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
|
|
|
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
|
|
|
Returns the global number of segments on both sides of the interface.
Returns -1 if Complete() has not been called |
|
|
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
|
|
|
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 |
|
|
Returns the interface-local Epetra_Comm object associated with this interface. It returns NULL if Complete() has not been called.
|
|
||||||||||||
|
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
|
|
|
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
|
|
|
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
|
|
|
Returns the Mortar side of the interface.
It returns the mortar side of the interface, which is either 0 or 1 |
|
|
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 |
|
|
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
|
|
|
Returns the number of segments on both sides of the interface that are owned by the calling processor. Returns 0 if |
|
|
Returns the number of segments on the specified side ( 0 or 1) that are owned by the calling processor. Returns 0 if
|
|
|
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
|
|
|
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
|
|
|
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
|
|
||||||||||||||||
|
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
Currently the package makes use of functions with ids 0 (trace space) and 1 (mortar space)
|
|
|
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). |
|
||||||||||||
|
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.
As not all of these functions make sense as trace space or mortar space functions, |
|
|
Choose Mortar side of the interface.
It is neccessary to choose the mortar side on each interface. Choices are:
|
|
|
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
|
1.3.9.1