HydroFemPhysics
The GeMA Hydraulic FEM Physics Plugin
Loading...
Searching...
No Matches
gmpHydroFemPhysicsFactory.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
24#ifndef _GEMA_PLUGIN_HYDRO_FEM_PHYSICS_FACTORY_H_
25#define _GEMA_PLUGIN_HYDRO_FEM_PHYSICS_FACTORY_H_
26
27#include <QObject>
28
30
36#include "gmpHydraulicFlow.h"
37#include "gmpInterfaceFlow.h"
38#include "gmpHydraulicPipe.h"
42#include "gmpMaterialCubicLaw.h"
43#include "gmpMaterialShearLaw.h"
44#include "gmpMaterialPipeFlow.h"
48#include "gmpMaterialBrinkman.h"
52#include "gmpHydraulicEmbeddedFractureConductive.h"
54#include "gmpHydraulicMaterialEquivalentContinuum.h"
55#include "gmpHydraulicVersion.h"
56#include "gmpHydraulicNeuralNetwork.h"
57
58
59#include <gmpFemPhysicsCommonMaterial.h>
60#include <gmSimulationData.h>
61#include <gmPluginLoader.h>
62#include <gmPluginInfo.h>
63
64
67{
69 Q_PLUGIN_METADATA(IID GmPluginObjectFactoryInterfaceIID)
71
72public:
75
77 const GmpFemPhysicsCommonMaterialFactory* matFactory(GmSimulationData* simulation)
78 {
79 static GmpFemPhysicsCommonMaterialFactory matFactory;
80
81 // If this is the first time that instance() is called, lets register material types
82 if(matFactory.numMaterialTypes() == 0)
83 {
84 const GmPluginInfo* ourInfo = simulation->loader()->pluginInfo("HydroFemPhysics");
85 assert(ourInfo);
86 const QVariantMap& map = ourInfo->attributes().value("constants").value<QVariantMap>().value("materialModels").value<QVariantMap>();
87
88 matFactory.registerMaterial(map.value("saturated").toInt(), "saturated", GmpHydraulicMaterialSaturated::instance, true);
89 matFactory.registerMaterial(map.value("dualPorosity").toInt(), "dualPorosity", GmpHydraulicMaterialDualPorosity::instance);
90 matFactory.registerMaterial(map.value("cubicLaw").toInt(), "cubicLaw", GmpMaterialCubicLaw::instance);
91 matFactory.registerMaterial(map.value("shearLaw").toInt(), "shearLaw", GmpMaterialShearLaw::instance);
92 matFactory.registerMaterial(map.value("pipeFlow").toInt(), "pipeFlow", GmpMaterialPipeFlow::instance);
93 matFactory.registerMaterial(map.value("generalizedDualPorosity").toInt(), "generalizedDualPorosity", GmpHydraulicMaterialGeneralizedDualPorosity::instance);
94 matFactory.registerMaterial(map.value("enhancedDualPorosity").toInt(), "enhancedDualPorosity", GmpHydraulicMaterialEnhancedDualPorosity::instance);
95 matFactory.registerMaterial(map.value("brinkman").toInt(), "brinkman", GmpHydraulicMaterialBrinkman::instance);
96 matFactory.registerMaterial(map.value("equivalentContinuum").toInt(), "equivalentContinuum", GmpHydraulicMaterialEquivalentContinuum::instance);
97 matFactory.registerMaterial(map.value("twoPhaseFlow").toInt(), "twoPhaseFlow", GmpHydraulicMaterialTwoPhase::instance);
98 matFactory.registerMaterial(map.value("interfaceTwoPhaseFlow").toInt(), "interfaceTwoPhaseFlow", GmpMaterialInterfaceMultiPhaseFlow::instance);
99
100 assert(matFactory.checkTypeMap());
101 }
102
103 return &matFactory;
104 }
105
106 // See comments on the base class method declaration
107 virtual GmPluginObject* instance(QString category, QString objType, GmSimulationData* simulation,
108 QString id, QString description)
109 {
110 assert(category == GM_PLUGIN_PHYSICS);
111
112 // Instance the requested physics object
113 if(objType == "Flow")
114 return new GmpHydraulicFlow<GmpHydraulic>("Flow", simulation, id, description, matFactory(simulation), logger());
115 else if (objType == "AxFlow")
116 return new GmpHydraulicAxFlow<GmpHydraulic>("AxFlow", simulation, id, description, matFactory(simulation), logger());
117 else if (objType == "Interface")
118 return new GmpInterfaceFlow<GmpHydraulicInterface>("Interface", simulation, id, description, matFactory(simulation), logger());
119 else if (objType == "AxInterface")
120 return new GmpInterfaceAxFlow<GmpHydraulicInterface>("AxInterface", simulation, id, description, matFactory(simulation), logger());
121 else if (objType == "DualFlow")
122 return new GmpHydraulicFlow<GmpHydraulicDualFlow>("DualFlow", simulation, id, description, matFactory(simulation), logger());
123 else if (objType == "Pipe")
124 return new GmpHydraulicPipe("Pipe", simulation, id, description, matFactory(simulation), logger());
125 else if (objType == "MultiPhaseFlow")
126 return new GmpHydraulicFlow<GmpHydraulicMultiPhaseFlow>("MultiPhaseFlow", simulation, id, description, matFactory(simulation), logger());
127 else if (objType == "TwoPhaseFlow")
128 return new GmpHydraulicFlow<GmpHydraulicTwoPhaseFlow>("TwoPhaseFlow", simulation, id, description, matFactory(simulation), logger());
129 else if (objType == "AxTwoPhaseFlow")
130 return new GmpHydraulicAxFlow<GmpHydraulicTwoPhaseFlow>("AxTwoPhaseFlow", simulation, id, description, matFactory(simulation), logger());
131 else if (objType == "TwoPhaseFlowPgPc")
132 return new GmpHydraulicFlow<GmpHydraulicTwoPhaseFlowPgPc>("TwoPhaseFlowPgPc", simulation, id, description, matFactory(simulation), logger());
133 else if (objType == "AxTwoPhaseFlowPgPc")
134 return new GmpHydraulicAxFlow<GmpHydraulicTwoPhaseFlowPgPc>("AxTwoPhaseFlowPgPc", simulation, id, description, matFactory(simulation), logger());
135 else if (objType == "TwoPhaseFlowInterface")
136 return new GmpInterfaceFlow<GmpHydraulicInterfaceTwoPhaseFlow>("TwoPhaseFlowInterface", simulation, id, description, matFactory(simulation), logger());
137 else if (objType == "Brinkman")
138 return new GmpHydraulicBrinkman<GmpHydraulicBrinkmanFlow>("Brinkman", simulation, id, description, matFactory(simulation), logger());
139 else if (objType == "EmbeddedFracture")
140 return new GmpHydraulicFlow<GmpHydraulicEmbeddedFracture>("EmbeddedFracture", simulation, id, description, matFactory(simulation), logger());
141 else if (objType == "EmbeddedFractureConductive")
142 return new GmpHydraulicFlow<GmpHydraulicEmbeddedFractureConductive>("EmbeddedFractureConductive", simulation, id, description, matFactory(simulation), logger());
143 else if (objType == "EnhancedDualFlow")
144 return new GmpHydraulicFlow<GmpHydraulicEnhancedDualFlow>("EnhancedDualFlow", simulation, id, description, matFactory(simulation), logger());
145 else if (objType == "NeuralNetworkFlow")
146 return new GmpHydraulicFlow<GmpHydraulicNeuralNetwork>("NeuralNetworkFlow", simulation, id, description, matFactory(simulation), logger());
147 else
148 return NULL;
149 }
150
152 virtual const QMap<QString, QString>& versionInfo() const { return GmpHydroFemPhysicsVersionInfo(); }
153
155 virtual const QStringList& depVersionInfo() const { return GmpHydroFemPhysicsRevisionDependencies(); }
156};
157
158#endif
const QVariantMap & attributes() const
GmPluginInfo * pluginInfo(QString pluginName) const
const GmLogCategory & logger()
GmPluginLoader * loader() const
Hydraulic Axissymetric.
Definition gmpHydraulicFlow.h:56
Hydraulic 2D & 3D for Quad, Tri, Hex and Tet.
Definition gmpHydraulicFlow.h:91
Hydraulic 2D & 3D for Quad, Tri, Hex and Tet.
Definition gmpHydraulicFlow.h:36
static GmpFemPhysicsCommonMaterial * instance(GmSimulationData *simulation, int typeIndex, QString typeName, const GmLogCategory &logger)
A "factory" function used to register the material with the physics material factory.
Definition gmpMaterialBrinkman.h:56
static GmpFemPhysicsCommonMaterial * instance(GmSimulationData *simulation, int typeIndex, QString typeName, const GmLogCategory &logger)
A "factory" function used to register the material with the physics material factory.
Definition gmpMaterialDualPorosity.h:62
static GmpFemPhysicsCommonMaterial * instance(GmSimulationData *simulation, int typeIndex, QString typeName, const GmLogCategory &logger)
A "factory" function used to register the material with the physics material factory.
Definition gmpMaterialEnhancedDualPorosity.h:59
static GmpFemPhysicsCommonMaterial * instance(GmSimulationData *simulation, int typeIndex, QString typeName, const GmLogCategory &logger)
A "factory" function used to register the material with the physics material factory.
Definition gmpHydraulicMaterialEquivalentContinuum.h:52
static GmpFemPhysicsCommonMaterial * instance(GmSimulationData *simulation, int typeIndex, QString typeName, const GmLogCategory &logger)
A "factory" function used to register the material with the physics material factory.
Definition gmpMaterialGeneralizedDualPorosity.h:53
static GmpFemPhysicsCommonMaterial * instance(GmSimulationData *simulation, int typeIndex, QString typeName, const GmLogCategory &logger)
A "factory" function used to register the material with the physics material factory.
Definition gmpMaterialSaturated.h:49
static GmpFemPhysicsCommonMaterial * instance(GmSimulationData *simulation, int typeIndex, QString typeName, const GmLogCategory &logger)
A "factory" function used to register the material with the physics material factory.
Definition gmpHydraulicMaterialTwoPhase.h:80
Basic class for the hydraulic interface element plugin object.
Definition gmpHydraulicPipe.h:39
Implementation of the HydroFemPhysics factory plugin.
Definition gmpHydroFemPhysicsFactory.h:67
virtual const QMap< QString, QString > & versionInfo() const
Retuns version information for the plugin. See comments on the base class.
Definition gmpHydroFemPhysicsFactory.h:152
const GmpFemPhysicsCommonMaterialFactory * matFactory(GmSimulationData *simulation)
Returns the single material factory used by created physics.
Definition gmpHydroFemPhysicsFactory.h:77
virtual const QStringList & depVersionInfo() const
Retuns dependency version information for the plugin. See comments on the base class.
Definition gmpHydroFemPhysicsFactory.h:155
GmpHydroFemPhysicsFactory()
Default constructor.
Definition gmpHydroFemPhysicsFactory.h:74
Hydraulic Axissymetric interface.
Definition gmpInterfaceFlow.h:55
Hydraulic zero-thickness interface 2D & 3D for Int2dl4, Int2dl6, and Int3dl8.
Definition gmpInterfaceFlow.h:34
static GmpFemPhysicsCommonMaterial * instance(GmSimulationData *simulation, int typeIndex, QString typeName, const GmLogCategory &logger)
A "factory" function used to register the material with the physics material factory.
Definition gmpMaterialCubicLaw.h:51
static GmpFemPhysicsCommonMaterial * instance(GmSimulationData *simulation, int typeIndex, QString typeName, const GmLogCategory &logger)
A "factory" function used to register the material with the physics material factory.
Definition gmpMaterialInterfaceMultiPhaseFlow.h:66
static GmpFemPhysicsCommonMaterial * instance(GmSimulationData *simulation, int typeIndex, QString typeName, const GmLogCategory &logger)
A "factory" function used to register the material with the physics material factory.
Definition gmpMaterialPipeFlow.h:72
static GmpFemPhysicsCommonMaterial * instance(GmSimulationData *simulation, int typeIndex, QString typeName, const GmLogCategory &logger)
A "factory" function used to register the material with the physics material factory.
Definition gmpMaterialShearLaw.h:51
#define GmPluginObjectFactoryInterfaceIID
Declaration of the GmpHydraulicBrinkmanFlow classes.
Declaration of the GmpHydraulicDualFlow classes.
Declaration of the gmpHydraulicEmbeddedFracture classes.
Declaration of the GmpHydraulicEnhancedDualFlow classes.
Declaration of the gmpHydraulicFlow classes.
Declaration of the GmpHydraulicInterfaceTwoPhaseFlow classes.
Declaration of the GmpHydraulicMaterialMultiPhase class.
Declaration of the GmpHydraulicMaterialTwoPhase class.
Declaration of the gmpHydraulicMultiPhaseFlow classes.
Declaration of the GmpHydraulicPipe classes.
Declaration of the gmpHydraulicTwoPhaseFlow classes.
Declaration of the gmpHydraulicTwoPhaseFlowPgPc classes.
Declaration of the gmpInterfaceXxxxFlow classes.
Declaration of the GmpHydraulicMaterialBrinkman class.
Declaration of the GmpHydraulicMaterialCubicLaw class.
Declaration of the GmpHydraulicMaterialDualPorosity class.
Declaration of the GmpHydraulicMaterialEnhancedDualPorosity class.
Declaration of the GmpHydraulicMaterialGeneralizedDualPorosity class.
Declaration of the GmpMaterialInterfaceMultiPhaseFlow class.
Declaration of the GmpMaterialPipeFlow class.
Declaration of the GmpHydraulicMaterialSaturated class.
Declaration of the GmpMaterialShearLaw class.
Q_INTERFACES(...)
Q_OBJECTQ_OBJECT