v0.15.5
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
MoFEM::PipelineGraph Struct Reference

#include "src/interfaces/PipelineGraph.hpp"

Inheritance diagram for MoFEM::PipelineGraph:
[legend]
Collaboration diagram for MoFEM::PipelineGraph:
[legend]

Public Member Functions

MoFEMErrorCode query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const
 Query interface for type-safe casting.
 
 PipelineGraph (const MoFEM::Core &core)
 
- Public Member Functions inherited from MoFEM::UnknownInterface
template<class IFACE >
MoFEMErrorCode registerInterface (bool error_if_registration_failed=true)
 Register interface.
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface reference to pointer of interface.
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface.
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface.
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface.
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface.
 
virtual ~UnknownInterface ()=default
 

Static Public Member Functions

static MoFEMErrorCode writeGraphGraphviz (std::string filename, std::string pip_name, const boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip)
 Pipeline graph to Graphviz file.
 
static MoFEMErrorCode writeKSPGraphGraphviz (KspCtx *ksp_ctx, std::string filename)
 KSP graph to Graphviz file.
 
static MoFEMErrorCode writeSNESGraphGraphviz (SnesCtx *snes_ctx, std::string file_name)
 SNES graph to Graphviz file.
 
static MoFEMErrorCode writeTSGraphGraphviz (TsCtx *ts_ctx, std::string file_name)
 TS graph to Graphviz file.
 
static MoFEMErrorCode writePiplineManagerGraphGraphviz (std::string filename, PipelineManager *pip_mng)
 Write pipeline manager graph to Graphviz file.
 
- Static Public Member Functions inherited from MoFEM::UnknownInterface
static MoFEMErrorCode getLibVersion (Version &version)
 Get library version.
 
static MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version)
 Get database major version.
 
static MoFEMErrorCode setFileVersion (moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD))
 Get database major version.
 
static MoFEMErrorCode getInterfaceVersion (Version &version)
 Get database major version.
 

Private Attributes

MoFEM::CorecOre
 Reference to MoFEM core instance.
 

Detailed Description

Definition at line 16 of file PipelineGraph.hpp.

Constructor & Destructor Documentation

◆ PipelineGraph()

MoFEM::PipelineGraph::PipelineGraph ( const MoFEM::Core core)

Definition at line 390 of file PipelineGraph.cpp.

391 : cOre(const_cast<Core &>(core)) {}
CoreTmp< 0 > Core
Definition Core.hpp:1148
MoFEM::Core & cOre
Reference to MoFEM core instance.

Member Function Documentation

◆ query_interface()

MoFEMErrorCode MoFEM::PipelineGraph::query_interface ( boost::typeindex::type_index  type_index,
UnknownInterface **  iface 
) const
virtual

Query interface for type-safe casting.

Parameters
type_indexType index of the requested interface
ifacePointer to interface pointer to be set
Returns
MoFEMErrorCode Error code (0 on success)

Implements MoFEM::UnknownInterface.

Definition at line 384 of file PipelineGraph.cpp.

385 {
386 *iface = const_cast<PipelineGraph *>(this);
387 return 0;
388}
PipelineGraph(const MoFEM::Core &core)

◆ writeGraphGraphviz()

MoFEMErrorCode MoFEM::PipelineGraph::writeGraphGraphviz ( std::string  filename,
std::string  pip_name,
const boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &  pip 
)
static

Pipeline graph to Graphviz file.

Parameters
filename
pip_name
pip
Returns
MoFEMErrorCode

Definition at line 145 of file PipelineGraph.cpp.

147 {
149 boost::shared_ptr<Graph> g_ptr(new Graph());
150 auto vname = get(boost::vertex_name, *g_ptr);
151 auto root_vertex = boost::add_vertex(*g_ptr);
152 vname[root_vertex] = {"Finite Element Pipeline Graph", "ellipse", "solid",
153 "black"};
154 plot_pipeline_graph_impl(pip, pip_name, g_ptr, root_vertex);
155 write_graphviz_impl(file_name, g_ptr);
157};
boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, boost::property< boost::vertex_name_t, VertexData >, boost::property< boost::edge_name_t, std::string > > Graph
#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()
static void write_graphviz_impl(std::string file_name, boost::shared_ptr< Graph > g_ptr)
static VertexDescriptor plot_pipeline_graph_impl(const boost::ptr_deque< UserDataOperator > &pip, std::string pip_name, boost::shared_ptr< Graph > g_ptr, VertexDescriptor root_vertex)

◆ writeKSPGraphGraphviz()

MoFEMErrorCode MoFEM::PipelineGraph::writeKSPGraphGraphviz ( KspCtx ksp_ctx,
std::string  filename 
)
static

KSP graph to Graphviz file.

Parameters
ts
filename
Returns
MoFEMErrorCode

Definition at line 210 of file PipelineGraph.cpp.

211 {
213 boost::shared_ptr<Graph> g_ptr(new Graph());
214 auto &g = *g_ptr;
215
216 auto vname = get(boost::vertex_name, g);
217 auto ename = get(boost::edge_name, g);
218
219 auto root_vertex = boost::add_vertex(g);
220 vname[root_vertex] = {"KSP Graph", "ellipse", "solid", "black"};
221
222 auto lhs_vertex = boost::add_vertex(g);
223 vname[lhs_vertex] = {"Lhs", "box3d", "filled", "lightgrey"};
224 add_edge(root_vertex, lhs_vertex, g);
225 add_stages(ksp_ctx->getPreProcSetOperators(), ksp_ctx->getSetOperators(),
226 ksp_ctx->getPostProcSetOperators(), lhs_vertex, g_ptr);
227
228 auto rhs_vertex = boost::add_vertex(g);
229 vname[rhs_vertex] = {"Rhs", "box3d", "filled", "lightgrey"};
230 add_edge(root_vertex, rhs_vertex, g);
231 add_stages(ksp_ctx->getPreProcComputeRhs(), ksp_ctx->getComputeRhs(),
232 ksp_ctx->getPostProcComputeRhs(), rhs_vertex, g_ptr);
233
234 write_graphviz_impl(file_name, g_ptr);
236}
static void add_stages(BasicMethodsSequence &pre, FEMethodsSequence &op, BasicMethodsSequence &post, VertexDescriptor start_vertex, boost::shared_ptr< Graph > g_ptr)
constexpr double g

◆ writePiplineManagerGraphGraphviz()

MoFEMErrorCode MoFEM::PipelineGraph::writePiplineManagerGraphGraphviz ( std::string  filename,
PipelineManager pip_mng 
)
static

Write pipeline manager graph to Graphviz file.

Parameters
filename
Returns
MoFEMErrorCode

Definition at line 322 of file PipelineGraph.cpp.

323 {
325 boost::shared_ptr<Graph> g_ptr(new Graph());
326 auto vname = get(boost::vertex_name, *g_ptr);
327 auto root_vertex = boost::add_vertex(*g_ptr);
328 vname[root_vertex] = {"Pipeline Manager Graph", "ellipse", "solid", "black"};
329
330 // lhs
331 if (pip_mng->getDomainLhsFE())
332 plot_pipeline_graph_impl(pip_mng->getOpDomainLhsPipeline(),
333 "DomainLhsPipeline", g_ptr, root_vertex);
334 if (pip_mng->getBoundaryLhsFE())
335 plot_pipeline_graph_impl(pip_mng->getOpBoundaryLhsPipeline(),
336 "BoundaryLhsPipeline", g_ptr, root_vertex);
337 if (pip_mng->getSkeletonLhsFE())
338 plot_pipeline_graph_impl(pip_mng->getOpSkeletonLhsPipeline(),
339 "SkeletonLhsPipeline", g_ptr, root_vertex);
340
341 // rhs
342 if (pip_mng->getDomainRhsFE())
343 plot_pipeline_graph_impl(pip_mng->getOpDomainRhsPipeline(),
344 "DomainRhsPipeline", g_ptr, root_vertex);
345 if (pip_mng->getBoundaryRhsFE())
346 plot_pipeline_graph_impl(pip_mng->getOpBoundaryRhsPipeline(),
347 "BoundaryRhsPipeline", g_ptr, root_vertex);
348
349 if (pip_mng->getSkeletonRhsFE())
350 plot_pipeline_graph_impl(pip_mng->getOpSkeletonRhsPipeline(),
351 "SkeletonRhsPipeline", g_ptr, root_vertex);
352 // rhs explict
353 if (pip_mng->getDomainExplicitRhsFE())
354 plot_pipeline_graph_impl(pip_mng->getOpDomainExplicitRhsPipeline(),
355 "DomainRhsExplicitPipeline", g_ptr,
356 root_vertex);
357 if (pip_mng->getBoundaryExplicitRhsFE())
358 plot_pipeline_graph_impl(pip_mng->getOpBoundaryExplicitRhsPipeline(),
359 "BoundaryRhsExplicitPipeline", g_ptr,
360 root_vertex);
361 if (pip_mng->getSkeletonExplicitRhsFE())
362 plot_pipeline_graph_impl(pip_mng->getOpSkeletonExplicitRhsPipeline(),
363 "SkeletonRhsExplicitPipeline", g_ptr,
364 root_vertex);
365
366 // meshset
367 if (pip_mng->getMeshsetLhsFE())
368 plot_pipeline_graph_impl(pip_mng->getOpMeshsetLhsPipeline(),
369 "MeshsetLhsPipeline", g_ptr, root_vertex);
370 if (pip_mng->getMeshsetRhsFE())
371 plot_pipeline_graph_impl(pip_mng->getOpMeshsetRhsPipeline(),
372 "MeshsetRhsPipeline", g_ptr, root_vertex);
373 if (pip_mng->getMeshsetExplicitRhsFE())
374 plot_pipeline_graph_impl(pip_mng->getOpMeshsetExplicitRhsPipeline(),
375 "MeshsetRhsExplicitPipeline", g_ptr,
376 root_vertex);
377
378 write_graphviz_impl(file_name, g_ptr);
379
381}

◆ writeSNESGraphGraphviz()

MoFEMErrorCode MoFEM::PipelineGraph::writeSNESGraphGraphviz ( SnesCtx snes_ctx,
std::string  file_name 
)
static

SNES graph to Graphviz file.

Parameters
snes_ctx
file_name
Returns
MoFEMErrorCode

Definition at line 239 of file PipelineGraph.cpp.

240 {
242 boost::shared_ptr<Graph> g_ptr(new Graph());
243 auto &g = *g_ptr;
244
245 auto vname = get(boost::vertex_name, g);
246 auto ename = get(boost::edge_name, g);
247
248 auto root_vertex = boost::add_vertex(g);
249 vname[root_vertex] = {"SNES Graph", "ellipse", "solid", "black"};
250
251 auto lhs_vertex = boost::add_vertex(g);
252 vname[lhs_vertex] = {"Lhs", "box3d", "filled", "lightgrey"};
253 add_edge(root_vertex, lhs_vertex, g);
254 add_stages(snes_ctx->getPreProcSetOperators(), snes_ctx->getSetOperators(),
255 snes_ctx->getPostProcSetOperators(), lhs_vertex, g_ptr);
256
257 auto rhs_vertex = boost::add_vertex(g);
258 vname[rhs_vertex] = {"Rhs", "box3d", "filled", "lightgrey"};
259 add_edge(root_vertex, rhs_vertex, g);
260 add_stages(snes_ctx->getPreProcComputeRhs(), snes_ctx->getComputeRhs(),
261 snes_ctx->getPostProcComputeRhs(), rhs_vertex, g_ptr);
262
263 auto load_vertex = boost::add_vertex(g);
264 vname[load_vertex] = {"LoadTangent", "box3d", "filled", "lightgrey"};
265 add_edge(root_vertex, load_vertex, g);
266 add_stages(snes_ctx->getPreProcLoadTangent(), snes_ctx->getLoadTangent(),
267 snes_ctx->getPostProcLoadTangent(), load_vertex, g_ptr);
268
269 write_graphviz_impl(file_name, g_ptr);
270
272}

◆ writeTSGraphGraphviz()

MoFEMErrorCode MoFEM::PipelineGraph::writeTSGraphGraphviz ( TsCtx ts_ctx,
std::string  file_name 
)
static

TS graph to Graphviz file.

Parameters
snes_ctx
file_name
Returns
MoFEMErrorCode

Definition at line 275 of file PipelineGraph.cpp.

276 {
278 boost::shared_ptr<Graph> g_ptr(new Graph());
279 auto &g = *g_ptr;
280
281 auto vname = get(boost::vertex_name, g);
282 auto ename = get(boost::edge_name, g);
283
284 auto root_vertex = boost::add_vertex(g);
285 vname[root_vertex] = {"TS Graph", "ellipse", "solid", "black"};
286
287 auto ifunction_vertex = boost::add_vertex(g);
288 vname[ifunction_vertex] = {"IFunction", "box3d", "filled", "lightgrey"};
289 add_edge(root_vertex, ifunction_vertex, g);
291 ts_ctx->getPostProcessIFunction(), ifunction_vertex, g_ptr);
292
293 auto rhsfunction_vertex = boost::add_vertex(g);
294 vname[rhsfunction_vertex] = {"RHSFunction", "box3d", "filled", "lightgrey"};
295 add_edge(root_vertex, rhsfunction_vertex, g);
297 ts_ctx->getPostProcessRHSFunction(), rhsfunction_vertex, g_ptr);
298
299 auto ijjacobian_vertex = boost::add_vertex(g);
300 vname[ijjacobian_vertex] = {"IJacobian", "box3d", "filled", "lightgrey"};
301 add_edge(root_vertex, ijjacobian_vertex, g);
303 ts_ctx->getPostProcessIJacobian(), ijjacobian_vertex, g_ptr);
304
305 auto rhsjacobian_vertex = boost::add_vertex(g);
306 vname[rhsjacobian_vertex] = {"RHSJacobian", "box3d", "filled", "lightgrey"};
307 add_edge(root_vertex, rhsjacobian_vertex, g);
309 ts_ctx->getPostProcessRHSJacobian(), rhsjacobian_vertex, g_ptr);
310
311 auto monitor_vertex = boost::add_vertex(g);
312 vname[monitor_vertex] = {"Monitor", "box3d", "filled", "lightgrey"};
313 add_edge(root_vertex, monitor_vertex, g);
315 ts_ctx->getPostProcessMonitor(), monitor_vertex, g_ptr);
316
317 write_graphviz_impl(file_name, g_ptr);
319}
MoFEM::TsCtx * ts_ctx
BasicMethodsSequence & getPostProcessRHSFunction()
Get the postProcess to do RHSFunction object.
Definition TsCtx.hpp:182
BasicMethodsSequence & getPostProcessIJacobian()
Get the postProcess to do IJacobian object.
Definition TsCtx.hpp:132
FEMethodsSequence & getLoopsMonitor()
Get the loops to do Monitor object.
Definition TsCtx.hpp:102
BasicMethodsSequence & getPreProcessMonitor()
Get the preProcess to do Monitor object.
Definition TsCtx.hpp:141
BasicMethodsSequence & getPostProcessRHSJacobian()
Get the postProcess to do RHSJacobian object.
Definition TsCtx.hpp:164
BasicMethodsSequence & getPostProcessIFunction()
Get the postProcess to do IFunction object.
Definition TsCtx.hpp:116
BasicMethodsSequence & getPreProcessRHSFunction()
Get the preProcess to do RHSFunction object.
Definition TsCtx.hpp:173
FEMethodsSequence & getLoopsIFunction()
Get the loops to do IFunction object.
Definition TsCtx.hpp:63
FEMethodsSequence & getLoopsRHSJacobian()
Get the loops to do RHSJacobian object.
Definition TsCtx.hpp:93
BasicMethodsSequence & getPreProcessIFunction()
Get the preProcess to do IFunction object.
Definition TsCtx.hpp:109
FEMethodsSequence & getLoopsRHSFunction()
Get the loops to do RHSFunction object.
Definition TsCtx.hpp:73
FEMethodsSequence & getLoopsIJacobian()
Get the loops to do IJacobian object.
Definition TsCtx.hpp:83
BasicMethodsSequence & getPreProcessRHSJacobian()
Get the preProcess to do RHSJacobian object.
Definition TsCtx.hpp:155
BasicMethodsSequence & getPostProcessMonitor()
Get the postProcess to do Monitor object.
Definition TsCtx.hpp:148
BasicMethodsSequence & getPreProcessIJacobian()
Get the preProcess to do IJacobian object.
Definition TsCtx.hpp:125

Member Data Documentation

◆ cOre

MoFEM::Core& MoFEM::PipelineGraph::cOre
private

Reference to MoFEM core instance.

Definition at line 82 of file PipelineGraph.hpp.


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