NeoPZ
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
TPZDohrSubstructCondense< TVar > Class Template Reference

To condense matrix divided in sub structures. Sub Structure. More...

#include <tpzdohrsubstructCondense.h>

Inheritance diagram for TPZDohrSubstructCondense< TVar >:
[legend]
Collaboration diagram for TPZDohrSubstructCondense< TVar >:
[legend]

Public Types

enum  EWeightType { CorrectWeight, Uniform }
 
enum  ENumbering { Submesh, InternalFirst, ExternalFirst }
 

Public Member Functions

int ClassId () const override
 Define the class id associated with the class. More...
 
 TPZDohrSubstructCondense ()
 
 ~TPZDohrSubstructCondense ()
 
int NumEquations ()
 Return the number of equations which contribute to the global system. More...
 
void AdjustResidual (TPZFMatrix< TVar > &r_global)
 Adjust the residual to reflect a static condensation. More...
 
void Contribute_rc_local (TPZFMatrix< TVar > &residual_local, TPZFMatrix< TVar > &rc_local) const
 It computes the local contribution to r(c). More...
 
void Contribute_Kc (TPZMatrix< TVar > &Kc, TPZVec< int > &coarseindex)
 It computes the local contribution to K(c) More...
 
void Contribute_v1_local (TPZFMatrix< TVar > &v1_local, TPZFMatrix< TVar > &invKc_rc) const
 It computes the local contribution to v1. More...
 
void Contribute_v2_local (TPZFMatrix< TVar > &residual_local, TPZFMatrix< TVar > &v2_local)
 It computes the local contribution to v2. More...
 
void Contribute_v3_local (TPZFMatrix< TVar > &v3, TPZFMatrix< TVar > &v1Plusv2) const
 It computes the local contribution to v(3) More...
 
void Print (std::ostream &out) const
 
void ContributeKULocal (const TVar alpha, const TPZFMatrix< TVar > &u, TPZFMatrix< TVar > &z) const
 compute the multiplication of the local stiffness matrix with the vector u More...
 
void ContributeDiagonalLocal (TPZFMatrix< TVar > &StiffnessDiag)
 Computes the contribution of each substructure node to global Stiffness diagonal (or something like that). More...
 
void ComputeWeightsLocal (TPZFMatrix< TVar > &StiffnessDiagLocal)
 Computes the weight matrix. More...
 
void ContributeRhs (TPZFMatrix< TVar > &rhs)
 Computes the condensed right hand side for the substructure. More...
 
void UGlobal (TPZFMatrix< TVar > &Uext, TPZFMatrix< TVar > &UGlobal)
 Computes the global solution based on the interface solution. More...
 
void Initialize ()
 Initializes the substructure. More...
 
void GetCoarseResidual (TPZFMatrix< TVar > &rc, TPZVec< int > &indices)
 Assemble the contribution to the coarse residual. More...
 
void GetCoarseStiffness (TPZMatrix< TVar > &stiff, TPZVec< int > &indices)
 Assemble the coarse dof stiffness matrix. More...
 
void Write (TPZStream &buf, int withclassid) const override
 method for streaming the object to a stream More...
 
void Read (TPZStream &input, void *context) override
 method for reading the object for a stream More...
 
void PrepareSystems ()
 It prepares the datas for solving systems for phi and zi. More...
 
void SolveSystemPhi ()
 Solves the system for Phi and for v2
It stores the results in fPhiC and fzi. More...
 
void AddInternalSolution (TPZFMatrix< TVar > &sol)
 Add the internal solution to the final result. More...
 
void ReallocMatRed ()
 
TPZVec< int > & GatherVec (ENumbering origin, ENumbering destination)
 
TPZVec< int > & ScatterVec (ENumbering origin, ENumbering destination)
 
const TPZVec< int > & GatherVec (ENumbering origin, ENumbering destination) const
 
const TPZVec< int > & ScatterVec (ENumbering origin, ENumbering destination) const
 
- Public Member Functions inherited from TPZSavable
 TPZSavable ()
 
virtual ~TPZSavable ()
 
virtual std::list< std::map< std::string, uint64_t > > VersionHistory () const
 
virtual std::pair< std::string, uint64_t > Version () const
 
virtual bool Compare (TPZSavable *copy, bool override=false)
 Compares the object for identity with the object pointed to, eventually copy the object. More...
 
virtual bool Compare (TPZSavable *copy, bool override=false) const
 Compares the object for identity with the object pointed to, eventually copy the object. More...
 
- Public Member Functions inherited from TPZRegisterClassId
template<typename T >
 TPZRegisterClassId (int(T::*)() const)
 
 TPZRegisterClassId ()=default
 

Static Public Member Functions

static void PermuteScatter (const TPZVec< int > &permute, const TPZFMatrix< TVar > &input, TPZFMatrix< TVar > &output, int first, int last)
 Apply a scatter permutation to the input vector using a scatter permutation output[permute[i]] = input[i-first], first <= i < last. More...
 
static void PermuteGather (const TPZVec< int > &permute, const TPZFMatrix< TVar > &input, TPZFMatrix< TVar > &output, int first, int last)
 Apply a gather permutation to the input vector using a scatter permutation output[i-first] = input[permute[i]], first <= i < last. More...
 
- Static Public Member Functions inherited from TPZSavable
static std::set< TPZRestoreClassBase * > & RestoreClassSet ()
 This static function guarantees that the gMap object is available when needed. More...
 
static std::map< int, TPZRestore_t > & ClassIdMap ()
 This static function guarantees that the gMap object is available when needed. More...
 
static std::pair< std::string, uint64_t > NeoPZVersion ()
 
static void Register (TPZRestoreClassBase *restore)
 
static void RegisterClassId (int classid, TPZRestore_t fun)
 
static TPZSavableCreateInstance (const int &classId)
 

Public Attributes

TPZAutoPointer< TPZMatRed< TVar, TPZFMatrix< TVar > > > fMatRedComplete
 Matrix problem which solves the phi and zi problems. More...
 
int fNEquations
 Number of equations of the substructure. More...
 
int fNumInternalEquations
 Number of internal equations of the substructure. More...
 
int fNumExternalEquations
 Number of equations which connect to the global structure. More...
 
TPZVec< int > fCoarseNodes
 
TPZFMatrix< TVar > fPhiC
 Vectors associated with each constraint. More...
 
TPZFMatrix< TVar > fPhiC_Weighted_Condensed
 Phi * W matrix and condensed to the equations which are part of the global system. More...
 
TPZManVector< TVar > fWeights
 Weights associated with each variable/equation. More...
 
TPZFMatrix< TVar > fKCi
 Stiffness matrix associated with the constraints. More...
 
std::map< std::pair< ENumbering, ENumbering >, TPZVec< int > > fPermutationsScatter
 Permutation vectors. More...
 
bool wasRealloc
 
TPZAutoPointer< TPZMatRed< TVar, TPZFMatrix< TVar > > > fMatRed
 Inverted (LU or Cholesky or LDLt) stiffness matrix for the internal degrees of freedom Calculado. More...
 
TPZFMatrix< TVar > fLocalLoad
 Local load vector. More...
 
TPZFMatrix< TVar > fLocalWeightedResidual
 Local weighted residual - $ W(i)*R(i)*r $. More...
 
TPZFMatrix< TVar > fAdjustSolution
 Solution vector which needs to be added to the converged system solution. More...
 

Static Public Attributes

static EWeightType fWeightType
 

Detailed Description

template<class TVar>
class TPZDohrSubstructCondense< TVar >

To condense matrix divided in sub structures. Sub Structure.

Author
Philippe Devloo

Definition at line 22 of file tpzdohrsubstructCondense.h.

Member Enumeration Documentation

◆ ENumbering

template<class TVar>
enum TPZDohrSubstructCondense::ENumbering
Enumerator
Submesh 
InternalFirst 
ExternalFirst 

Definition at line 36 of file tpzdohrsubstructCondense.h.

◆ EWeightType

template<class TVar>
enum TPZDohrSubstructCondense::EWeightType
Enumerator
CorrectWeight 
Uniform 

Definition at line 34 of file tpzdohrsubstructCondense.h.

Constructor & Destructor Documentation

◆ TPZDohrSubstructCondense()

template<class TVar >
TPZDohrSubstructCondense< TVar >::TPZDohrSubstructCondense ( )

Definition at line 23 of file tpzdohrsubstructCondense.cpp.

◆ ~TPZDohrSubstructCondense()

template<class TVar >
TPZDohrSubstructCondense< TVar >::~TPZDohrSubstructCondense ( )

Definition at line 29 of file tpzdohrsubstructCondense.cpp.

Member Function Documentation

◆ AddInternalSolution()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::AddInternalSolution ( TPZFMatrix< TVar > &  sol)

Add the internal solution to the final result.

Add the internal solution to the final result

Definition at line 428 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ AdjustResidual()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::AdjustResidual ( TPZFMatrix< TVar > &  r_global)

Adjust the residual to reflect a static condensation.

The residual corresponding to the internal nodes will be zeroed

Adjust the residual to reflect a static condensation The residual corresponding to the internal nodes will be zeroed

Definition at line 419 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ ClassId()

template<class TVar >
int TPZDohrSubstructCondense< TVar >::ClassId ( ) const
overridevirtual

Define the class id associated with the class.

This id has to be unique for all classes A non unique id is flagged at the startup of the program

Implements TPZSavable.

Definition at line 219 of file tpzdohrsubstructCondense.h.

◆ ComputeWeightsLocal()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::ComputeWeightsLocal ( TPZFMatrix< TVar > &  StiffnessDiagLocal)

Computes the weight matrix.

Parameters
StiffnessDiagLocalis the diagonal of the global matrix (local numbering)

Definition at line 206 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ Contribute_Kc()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::Contribute_Kc ( TPZMatrix< TVar > &  Kc,
TPZVec< int > &  coarseindex 
)

It computes the local contribution to K(c)

Definition at line 45 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ Contribute_rc_local()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::Contribute_rc_local ( TPZFMatrix< TVar > &  residual_local,
TPZFMatrix< TVar > &  rc_local 
) const

It computes the local contribution to r(c).

The method LoadWeightedResidual must be called before this one.

It computes the local contribution to r(c). The method LoadWeightedResidual must be called before this one.

Definition at line 39 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ Contribute_v1_local()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::Contribute_v1_local ( TPZFMatrix< TVar > &  v1_local,
TPZFMatrix< TVar > &  invKc_rc 
) const

It computes the local contribution to v1.

Parameters
v1_local
invKc_rcis the product K(c)_inverted*r(c) Of course r(c) must be computed, using Contribute_rc(), before calling this method

Definition at line 58 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ Contribute_v2_local()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::Contribute_v2_local ( TPZFMatrix< TVar > &  residual_local,
TPZFMatrix< TVar > &  v2_local 
)

It computes the local contribution to v2.

It computes the local contribution to v2.

Definition at line 68 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ Contribute_v3_local()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::Contribute_v3_local ( TPZFMatrix< TVar > &  v3,
TPZFMatrix< TVar > &  v1Plusv2 
) const

It computes the local contribution to v(3)

Parameters
v3
v1Plusv2is the sum "v1 + v2"

Definition at line 123 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ ContributeDiagonalLocal()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::ContributeDiagonalLocal ( TPZFMatrix< TVar > &  StiffnessDiag)

Computes the contribution of each substructure node to global Stiffness diagonal (or something like that).

Parameters
StiffnessDiagis the diagonal of the stiffness matrix

Definition at line 183 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ ContributeKULocal()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::ContributeKULocal ( const TVar  alpha,
const TPZFMatrix< TVar > &  u,
TPZFMatrix< TVar > &  z 
) const

compute the multiplication of the local stiffness matrix with the vector u

Definition at line 338 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ ContributeRhs()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::ContributeRhs ( TPZFMatrix< TVar > &  rhs)

Computes the condensed right hand side for the substructure.

Parameters
rhsthe right hand side ordered external first

Computes the condensed right hand side for the substructure

Parameters
rhsthe right hand side ordered external first

Definition at line 245 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ GatherVec() [1/2]

template<class TVar>
TPZVec<int>& TPZDohrSubstructCondense< TVar >::GatherVec ( ENumbering  origin,
ENumbering  destination 
)
inline

◆ GatherVec() [2/2]

template<class TVar >
const TPZVec< int > & TPZDohrSubstructCondense< TVar >::GatherVec ( ENumbering  origin,
ENumbering  destination 
) const

Definition at line 464 of file tpzdohrsubstructCondense.cpp.

◆ GetCoarseResidual()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::GetCoarseResidual ( TPZFMatrix< TVar > &  rc,
TPZVec< int > &  indices 
)

Assemble the contribution to the coarse residual.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ GetCoarseStiffness()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::GetCoarseStiffness ( TPZMatrix< TVar > &  stiff,
TPZVec< int > &  indices 
)

Assemble the coarse dof stiffness matrix.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ Initialize()

template<class TVar >
void TPZDohrSubstructCondense< TVar >::Initialize ( )

Initializes the substructure.

Definition at line 404 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ NumEquations()

template<class TVar>
int TPZDohrSubstructCondense< TVar >::NumEquations ( )
inline

Return the number of equations which contribute to the global system.

Definition at line 41 of file tpzdohrsubstructCondense.h.

◆ PermuteGather()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::PermuteGather ( const TPZVec< int > &  permute,
const TPZFMatrix< TVar > &  input,
TPZFMatrix< TVar > &  output,
int  first,
int  last 
)
static

Apply a gather permutation to the input vector using a scatter permutation output[i-first] = input[permute[i]], first <= i < last.

This method does not resize the elements

Apply a gather permutation to the input vector using a scatter permutation output[i-first] = input[permute[i]], first <= i < last this method does not resize the elements

Definition at line 453 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::ContributeKULocal(), TPZDohrSubstructCondense< TTVar >::ContributeRhs(), and TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ PermuteScatter()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::PermuteScatter ( const TPZVec< int > &  permute,
const TPZFMatrix< TVar > &  input,
TPZFMatrix< TVar > &  output,
int  first,
int  last 
)
static

Apply a scatter permutation to the input vector using a scatter permutation output[permute[i]] = input[i-first], first <= i < last.

This method does not resize the elements

Apply a scatter permutation to the input vector using a scatter permutation output[permute[i]] = input[i-first], first <= i < last this method does not resize the elements

Definition at line 438 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::ContributeKULocal(), TPZDohrSubstructCondense< TTVar >::ContributeRhs(), TPZDohrSubstructCondense< TTVar >::NumEquations(), and TPZDohrSubstructCondense< TTVar >::UGlobal().

◆ PrepareSystems()

template<class TVar >
void TPZDohrSubstructCondense< TVar >::PrepareSystems ( )

It prepares the datas for solving systems for phi and zi.

Definition at line 411 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::Initialize(), and TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ Print()

template<class TVar >
void TPZDohrSubstructCondense< TVar >::Print ( std::ostream &  out) const

◆ Read()

template<class TVar >
void TPZDohrSubstructCondense< TVar >::Read ( TPZStream input,
void *  context 
)
overridevirtual

method for reading the object for a stream

Reimplemented from TPZSavable.

Definition at line 559 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ ReallocMatRed()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::ReallocMatRed ( )
inline

Remove this - PerfTests Only

Definition at line 177 of file tpzdohrsubstructCondense.h.

◆ ScatterVec() [1/2]

template<class TVar>
TPZVec<int>& TPZDohrSubstructCondense< TVar >::ScatterVec ( ENumbering  origin,
ENumbering  destination 
)
inline

◆ ScatterVec() [2/2]

template<class TVar >
const TPZVec< int > & TPZDohrSubstructCondense< TVar >::ScatterVec ( ENumbering  origin,
ENumbering  destination 
) const

Definition at line 481 of file tpzdohrsubstructCondense.cpp.

◆ SolveSystemPhi()

template<class TVar >
void TPZDohrSubstructCondense< TVar >::SolveSystemPhi ( )

Solves the system for Phi and for v2
It stores the results in fPhiC and fzi.

Definition at line 151 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::Initialize(), and TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ UGlobal()

template<class TVar>
void TPZDohrSubstructCondense< TVar >::UGlobal ( TPZFMatrix< TVar > &  UGlob,
TPZFMatrix< TVar > &  USub 
)

Computes the global solution based on the interface solution.

Computes the global solution based on the interface solution

Definition at line 299 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::Contribute_v2_local(), and TPZDohrSubstructCondense< TTVar >::NumEquations().

◆ Write()

template<class TVar >
void TPZDohrSubstructCondense< TVar >::Write ( TPZStream buf,
int  withclassid 
) const
overridevirtual

method for streaming the object to a stream

Reimplemented from TPZSavable.

Definition at line 499 of file tpzdohrsubstructCondense.cpp.

Referenced by TPZDohrSubstructCondense< TTVar >::NumEquations().

Member Data Documentation

◆ fAdjustSolution

template<class TVar>
TPZFMatrix<TVar> TPZDohrSubstructCondense< TVar >::fAdjustSolution

Solution vector which needs to be added to the converged system solution.

This variable is initialized and set in the AdjustResidual method

Definition at line 215 of file tpzdohrsubstructCondense.h.

Referenced by TPZDohrSubstructCondense< TTVar >::Print(), TPZDohrSubstructCondense< TTVar >::Read(), and TPZDohrSubstructCondense< TTVar >::Write().

◆ fCoarseNodes

template<class TVar>
TPZVec<int> TPZDohrSubstructCondense< TVar >::fCoarseNodes

◆ fKCi

template<class TVar>
TPZFMatrix<TVar> TPZDohrSubstructCondense< TVar >::fKCi

◆ fLocalLoad

template<class TVar>
TPZFMatrix<TVar> TPZDohrSubstructCondense< TVar >::fLocalLoad

◆ fLocalWeightedResidual

template<class TVar>
TPZFMatrix<TVar> TPZDohrSubstructCondense< TVar >::fLocalWeightedResidual

◆ fMatRed

template<class TVar>
TPZAutoPointer<TPZMatRed<TVar, TPZFMatrix<TVar> > > TPZDohrSubstructCondense< TVar >::fMatRed
mutable

◆ fMatRedComplete

template<class TVar>
TPZAutoPointer<TPZMatRed<TVar, TPZFMatrix<TVar> > > TPZDohrSubstructCondense< TVar >::fMatRedComplete

◆ fNEquations

template<class TVar>
int TPZDohrSubstructCondense< TVar >::fNEquations

◆ fNumExternalEquations

template<class TVar>
int TPZDohrSubstructCondense< TVar >::fNumExternalEquations

◆ fNumInternalEquations

template<class TVar>
int TPZDohrSubstructCondense< TVar >::fNumInternalEquations

◆ fPermutationsScatter

template<class TVar>
std::map<std::pair<ENumbering, ENumbering> , TPZVec<int> > TPZDohrSubstructCondense< TVar >::fPermutationsScatter

Permutation vectors.

This map holds all permutation vectors for the equations The format of a permutation is that permute[ind] corresponds to the destination index of the element index ind of the original vector solout[permute[ind]] = solin[ind], ind = 0, n, 1

Definition at line 172 of file tpzdohrsubstructCondense.h.

Referenced by TPZDohrSubstructCondense< TTVar >::ContributeKULocal(), TPZDohrSubstructCondense< TTVar >::ContributeRhs(), TPZDohrSubstructCondense< TTVar >::GatherVec(), TPZDohrSubstructCondense< TTVar >::Read(), TPZDohrSubstructCondense< TTVar >::ScatterVec(), TPZDohrSubstructCondense< TTVar >::UGlobal(), and TPZDohrSubstructCondense< TTVar >::Write().

◆ fPhiC

template<class TVar>
TPZFMatrix<TVar> TPZDohrSubstructCondense< TVar >::fPhiC

◆ fPhiC_Weighted_Condensed

template<class TVar>
TPZFMatrix<TVar> TPZDohrSubstructCondense< TVar >::fPhiC_Weighted_Condensed

◆ fWeights

template<class TVar>
TPZManVector<TVar> TPZDohrSubstructCondense< TVar >::fWeights

◆ fWeightType

template<class TVar>
TPZDohrSubstructCondense< TVar >::EWeightType TPZDohrSubstructCondense< TVar >::fWeightType
static

Definition at line 38 of file tpzdohrsubstructCondense.h.

◆ wasRealloc

template<class TVar>
bool TPZDohrSubstructCondense< TVar >::wasRealloc

Definition at line 174 of file tpzdohrsubstructCondense.h.


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