v0.15.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
ElasticSchurExample Struct Reference
Inheritance diagram for ElasticSchurExample:
[legend]
Collaboration diagram for ElasticSchurExample:
[legend]

Public Member Functions

 ElasticSchurExample (MoFEM::Interface &field)
 
MoFEMErrorCode runProblem ()
 [Run problem]
 
- Public Member Functions inherited from ElasticExample
 ElasticExample (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 [Run problem]
 

Protected Member Functions

MoFEMErrorCode kspSetUpAndSolve (SmartPetscObj< KSP > solver)
 [Push operators to pipeline]
 
- Protected Member Functions inherited from ElasticExample
MoFEMErrorCode readMesh ()
 [Run problem]
 
MoFEMErrorCode setupProblem ()
 [Read mesh]
 
MoFEMErrorCode boundaryCondition ()
 [Set up problem]
 
MoFEMErrorCode assembleSystem ()
 [Boundary condition]
 
MoFEMErrorCode solveSystem ()
 [Solve]
 
MoFEMErrorCode outputResults ()
 [Solve]
 
MoFEMErrorCode checkResults ()
 [Postprocess results]
 

Additional Inherited Members

- Protected Attributes inherited from ElasticExample
MoFEM::InterfacemField
 
boost::shared_ptr< MatrixDouble > vectorFieldPtr = nullptr
 

Detailed Description

Examples
mofem/tutorials/vec-10/schur_elastic.cpp.

Definition at line 65 of file schur_elastic.cpp.

Constructor & Destructor Documentation

◆ ElasticSchurExample()

ElasticSchurExample::ElasticSchurExample ( MoFEM::Interface field)
inline

Definition at line 66 of file schur_elastic.cpp.

Member Function Documentation

◆ kspSetUpAndSolve()

MoFEMErrorCode ElasticSchurExample::kspSetUpAndSolve ( SmartPetscObj< KSP >  solver)
protectedvirtual

[Push operators to pipeline]

Reimplemented from ElasticExample.

Examples
mofem/tutorials/vec-10/schur_elastic.cpp.

Definition at line 143 of file schur_elastic.cpp.

143 {
145
146 MOFEM_LOG_CHANNEL("TIMER");
147 MOFEM_LOG_TAG("TIMER", "timer");
148
149 if (A == AssemblyType::BLOCK_SCHUR || A == AssemblyType::SCHUR) {
150 auto schur_ptr = SetUpSchur::createSetUpSchur(mField);
151 CHKERR schur_ptr->setUp(solver);
152 }
153
154
155 BOOST_LOG_SCOPED_THREAD_ATTR("Timeline", attrs::timer());
156 MOFEM_LOG("TIMER", Sev::inform) << "KSPSetUp";
157 CHKERR KSPSetUp(solver);
158 MOFEM_LOG("TIMER", Sev::inform) << "KSPSetUp <= Done";
159
160 DM dm;
161 CHKERR KSPGetDM(solver, &dm);
162 auto D = createDMVector(dm);
163 auto F = vectorDuplicate(D);
164
165 MOFEM_LOG("TIMER", Sev::inform) << "KSPSolve";
166 CHKERR KSPSolve(solver, F, D);
167 MOFEM_LOG("TIMER", Sev::inform) << "KSPSolve <= Done";
168
169 CHKERR VecGhostUpdateBegin(D, INSERT_VALUES, SCATTER_FORWARD);
170 CHKERR VecGhostUpdateEnd(D, INSERT_VALUES, SCATTER_FORWARD);
171 CHKERR DMoFEMMeshToLocalVector(dm, D, INSERT_VALUES, SCATTER_REVERSE);
172
174};
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
@ F
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
Definition DMMoFEM.cpp:514
auto createDMVector(DM dm)
Get smart vector from DM.
Definition DMMoFEM.hpp:1234
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
double D
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.
constexpr AssemblyType A
[Define dimension]
MoFEM::Interface & mField
static boost::shared_ptr< SetUpSchur > createSetUpSchur(MoFEM::Interface &m_field)

◆ runProblem()

MoFEMErrorCode ElasticSchurExample::runProblem ( )

[Run problem]

Examples
mofem/tutorials/vec-10/schur_elastic.cpp.

Definition at line 75 of file schur_elastic.cpp.

75 {
85}
MoFEMErrorCode solveSystem()
[Solve]
MoFEMErrorCode outputResults()
[Solve]
MoFEMErrorCode assembleSystem()
[Boundary condition]
MoFEMErrorCode setupProblem()
[Read mesh]
MoFEMErrorCode boundaryCondition()
[Set up problem]
MoFEMErrorCode checkResults()
[Postprocess results]
MoFEMErrorCode readMesh()
[Run problem]

The documentation for this struct was generated from the following file: