KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
convection_diffusion_settings.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ \.
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Riccardo Rossi
11 // Pablo Becker
12 //
13 
14 #if !defined(KRATOS_CONVECTION_DIFFUSION_SETTINGS_INCLUDED )
15 #define KRATOS_CONVECTION_DIFFUSION_SETTINGS_INCLUDED
16 
17 // System includes
18 #include <string>
19 #include <iostream>
20 
21 // External includes
22 
23 // Project includes
24 #include "containers/variable.h"
25 #include "includes/define.h"
26 
27 namespace Kratos {
28 
31 
35 
39 
43 
47 
49 
56 class KRATOS_API(KRATOS_CORE) ConvectionDiffusionSettings
57 {
58 public:
61 
64 
68 
71 
73  mpDensityVar(rOther.mpDensityVar),
74  mpDiffusionVar(rOther.mpDiffusionVar),
75  mpUnknownVar(rOther.mpUnknownVar),
76  mpVolumeSourceVar(rOther.mpVolumeSourceVar),
77  mpSurfaceSourceVar(rOther.mpSurfaceSourceVar),
78  mpProjectionVar(rOther. mpProjectionVar),
79  mpConvectionVar(rOther.mpConvectionVar),
80  mpGradientVar(rOther.mpGradientVar),
81  mpMeshVelocityVar(rOther.mpMeshVelocityVar),
82  mpTransferCoefficientVar(rOther.mpTransferCoefficientVar),
83  mpVelocityVar(rOther.mpVelocityVar),
84  mpSpecificHeatVar(rOther.mpSpecificHeatVar),
85  mpReactionVar(rOther.mpReactionVar),
86  mpReactionGradientVar(rOther.mpReactionGradientVar),
87  mis_defined_DensityVar(rOther.mis_defined_DensityVar),
88  mis_defined_DiffusionVar(rOther.mis_defined_DiffusionVar),
89  mis_defined_UnknownVar(rOther.mis_defined_UnknownVar),
90  mis_defined_VolumeSourceVar(rOther.mis_defined_VolumeSourceVar),
91  mis_defined_SurfaceSourceVar(rOther.mis_defined_SurfaceSourceVar),
92  mis_defined_ProjectionVar(rOther.mis_defined_ProjectionVar),
93  mis_defined_ConvectionVar(rOther.mis_defined_ConvectionVar),
94  mis_defined_GradientVar(rOther.mis_defined_GradientVar),
95  mis_defined_MeshVelocityVar(rOther.mis_defined_MeshVelocityVar),
96  mis_defined_TransferCoefficientVar(rOther.mis_defined_TransferCoefficientVar),
97  mis_defined_VelocityVar(rOther.mis_defined_VelocityVar),
98  mis_defined_SpecificHeatVar(rOther.mis_defined_SpecificHeatVar),
99  mis_defined_ReactionVar(rOther.mis_defined_ReactionVar),
100  mIsDefinedReactionGradientVar(rOther.mIsDefinedReactionGradientVar)
101  {
102  }
103 
106 
111  {
112  mpDensityVar = &rvar;
113  mis_defined_DensityVar=true;
114  }
116  {
117  return *mpDensityVar;
118  }
120  {
121  return mpDensityVar != nullptr;
122  }
123 
125  {
126  mpDiffusionVar = &rvar;
127  mis_defined_DiffusionVar=true;
128  }
130  {
131  return *mpDiffusionVar;
132  }
134  {
135  return mpDiffusionVar != nullptr;
136  }
137 
139  {
140  mpUnknownVar = &rvar;
141  mis_defined_UnknownVar=true;
142  }
144  {
145  return *mpUnknownVar;
146  }
148  {
149  return mpUnknownVar != nullptr;
150  }
151 
153  {
154  mpVolumeSourceVar = &rvar;
155  mis_defined_VolumeSourceVar=true;
156  }
158  {
159  return *mpVolumeSourceVar;
160  }
162  {
163  return mpVolumeSourceVar != nullptr;
164  }
165 
167  {
168  mpSurfaceSourceVar = &rvar;
169  mis_defined_SurfaceSourceVar=true;
170  }
172  {
173  return *mpSurfaceSourceVar;
174  }
176  {
177  return mpSurfaceSourceVar != nullptr;
178  }
179 
181  {
182  mpProjectionVar = &rvar;
183  mis_defined_ProjectionVar=true;
184  }
186  {
187  return *mpProjectionVar;
188  }
190  {
191  return mpProjectionVar != nullptr;
192  }
193 
195  {
196  mpConvectionVar = &rvar;
197  mis_defined_ConvectionVar=true;
198  }
200  {
201  return *mpConvectionVar;
202  }
204  {
205  return mpConvectionVar != nullptr;
206  }
207 
209  {
210  mpGradientVar = &rvar;
211  mis_defined_GradientVar=true;
212  }
214  {
215  return *mpGradientVar;
216  }
218  {
219  return mpGradientVar != nullptr;
220  }
221 
223  {
224  mpMeshVelocityVar = &rvar;
225  mis_defined_MeshVelocityVar=true;
226  }
228  {
229  return *mpMeshVelocityVar;
230  }
232  {
233  return mpMeshVelocityVar != nullptr;
234  }
235 
237  {
238  mpTransferCoefficientVar = &rvar;
239  mis_defined_TransferCoefficientVar=true;
240  }
242  {
243  return *mpTransferCoefficientVar;
244  }
246  {
247  return mpTransferCoefficientVar != nullptr;
248  }
249 
251  {
252  mpVelocityVar = &rvar;
253  mis_defined_VelocityVar=true;
254  }
256  {
257  return *mpVelocityVar;
258  }
260  {
261  return mpVelocityVar != nullptr;
262  }
263 
265  {
266  mpSpecificHeatVar = &rvar;
267  mis_defined_SpecificHeatVar=true;
268  }
270  {
271  return *mpSpecificHeatVar;
272  }
274  {
275  return mpSpecificHeatVar != nullptr;
276  }
277 
279  {
280  mpReactionVar = &rvar;
281  mis_defined_ReactionVar=true;
282  }
284  {
285  return *mpReactionVar;
286  }
288  {
289  return mpReactionVar != nullptr;
290  }
291 
293  {
294  mpReactionGradientVar = &rVar;
295  mIsDefinedReactionGradientVar=true;
296  }
298  {
299  return *mpReactionGradientVar;
300  }
302  {
303  return mpReactionGradientVar != nullptr;
304  }
305 
309 
310 
316  {
317  mpDensityVar = rOther.mpDensityVar;
318  mpDiffusionVar = rOther.mpDiffusionVar;
319  mpUnknownVar = rOther.mpUnknownVar;
320  mpVolumeSourceVar = rOther.mpVolumeSourceVar;
321  mpSurfaceSourceVar = rOther.mpSurfaceSourceVar;
322  mpProjectionVar = rOther.mpProjectionVar;
323  mpConvectionVar = rOther.mpConvectionVar;
324  mpGradientVar = rOther.mpGradientVar;
325  mpMeshVelocityVar = rOther.mpMeshVelocityVar;
326  mpTransferCoefficientVar = rOther.mpTransferCoefficientVar;
327  mpVelocityVar = rOther.mpVelocityVar;
328  mpSpecificHeatVar = rOther.mpSpecificHeatVar;
329  mpReactionVar = rOther.mpReactionVar;
330  mpReactionGradientVar = rOther.mpReactionGradientVar;
331  //now the is_defined
332  mis_defined_DensityVar = rOther.mis_defined_DensityVar;
333  mis_defined_DiffusionVar = rOther.mis_defined_DiffusionVar;
334  mis_defined_UnknownVar = rOther.mis_defined_UnknownVar;
335  mis_defined_VolumeSourceVar = rOther.mis_defined_VolumeSourceVar;
336  mis_defined_SurfaceSourceVar = rOther.mis_defined_SurfaceSourceVar;
337  mis_defined_ProjectionVar = rOther.mis_defined_ProjectionVar;
338  mis_defined_ConvectionVar = rOther.mis_defined_ConvectionVar;
339  mis_defined_GradientVar = rOther.mis_defined_GradientVar;
340  mis_defined_MeshVelocityVar = rOther.mis_defined_MeshVelocityVar;
341  mis_defined_TransferCoefficientVar = rOther.mis_defined_TransferCoefficientVar;
342  mis_defined_VelocityVar = rOther.mis_defined_VelocityVar;
343  mis_defined_SpecificHeatVar = rOther.mis_defined_SpecificHeatVar;
344  mis_defined_ReactionVar = rOther.mis_defined_ReactionVar;
345  mIsDefinedReactionGradientVar = rOther.mIsDefinedReactionGradientVar;
346 
347  return *this;
348  }
349 
350 
354 
355 
359 
361  virtual std::string Info() const
362  {
363  std::stringstream buffer;
364  buffer << "ConvectionDiffusionSettings #" ;
365  return buffer.str();
366  }
367 
369  virtual void PrintInfo(std::ostream& rOStream) const
370  {
371  rOStream << "ConvectionDiffusionSettings #";
372  }
373 
375  virtual void PrintData(std::ostream& rOStream) const
376  {
377  }
378 
379 
383 
384 
386 
387 protected:
390 
391 
395 
399 
400 
404 
405 
409 
410 
414 
415 
419 
420 
422 
423 private:
426 
427 
431 
432  const Variable<double>* mpDensityVar = nullptr;
433  const Variable<double>* mpDiffusionVar = nullptr;
434  const Variable<double>* mpUnknownVar = nullptr;
435  const Variable<double>* mpVolumeSourceVar = nullptr;
436  const Variable<double>* mpSurfaceSourceVar = nullptr;
437  const Variable<double>* mpProjectionVar = nullptr;
438  const Variable<array_1d<double,3> >* mpConvectionVar = nullptr;
439  const Variable<array_1d<double,3> >* mpGradientVar = nullptr;
440  const Variable<array_1d<double,3> >* mpMeshVelocityVar = nullptr;
441  const Variable<double>* mpTransferCoefficientVar = nullptr;
442  const Variable<array_1d<double,3> >* mpVelocityVar = nullptr;
443  const Variable<double>* mpSpecificHeatVar = nullptr;
444  const Variable<double>* mpReactionVar = nullptr;
445  const Variable<array_1d<double,3>>* mpReactionGradientVar = nullptr;
446  bool mis_defined_DensityVar = false;
447  bool mis_defined_DiffusionVar = false;
448  bool mis_defined_UnknownVar = false;
449  bool mis_defined_VolumeSourceVar = false;
450  bool mis_defined_SurfaceSourceVar = false;
451  bool mis_defined_ProjectionVar = false;
452  bool mis_defined_ConvectionVar = false;
453  bool mis_defined_GradientVar = false;
454  bool mis_defined_MeshVelocityVar = false;
455  bool mis_defined_TransferCoefficientVar = false;
456  bool mis_defined_VelocityVar = false;
457  bool mis_defined_SpecificHeatVar = false;
458  bool mis_defined_ReactionVar = false;
459  bool mIsDefinedReactionGradientVar = false;
460 
464 
468 
469  friend class Serializer;
470 
471 
472  virtual void save(Serializer& rSerializer) const;
473 
474  virtual void load(Serializer& rSerializer);
475 
479 
480 
484 
485 
489 
490 
494 
495 
496 
497 
498 
500 
501 }; // Class ConvectionDiffusionSettings
502 
504 
507 
508 
512 
513 
515 inline std::istream& operator >> (std::istream& rIStream,
517 {
518  return rIStream;
519 }
520 
522 inline std::ostream& operator << (std::ostream& rOStream,
523  const ConvectionDiffusionSettings& rThis)
524 {
525  rThis.PrintInfo(rOStream);
526  rOStream << std::endl;
527  rThis.PrintData(rOStream);
528 
529  return rOStream;
530 }
532 
533 #undef KRATOS_EXPORT_MACRO
534 #define KRATOS_EXPORT_MACRO KRATOS_API
535 
536 KRATOS_DEFINE_VARIABLE(ConvectionDiffusionSettings::Pointer, CONVECTION_DIFFUSION_SETTINGS)
537 
538 #undef KRATOS_EXPORT_MACRO
539 #define KRATOS_EXPORT_MACRO KRATOS_NO_EXPORT
540 
541 } // namespace Kratos.
542 
543 #endif // KRATOS_CONVECTION_DIFFUSION_SETTINGS_INCLUDED defined
Convection diffusion settings. This class contains information to be used by the convection diffusion...
Definition: convection_diffusion_settings.h:57
bool IsDefinedVolumeSourceVariable() const
Definition: convection_diffusion_settings.h:161
bool IsDefinedReactionVariable() const
Definition: convection_diffusion_settings.h:287
void SetDiffusionVariable(const Variable< double > &rvar)
Definition: convection_diffusion_settings.h:124
void SetSpecificHeatVariable(const Variable< double > &rvar)
Definition: convection_diffusion_settings.h:264
virtual std::string Info() const
Turn back information as a string.
Definition: convection_diffusion_settings.h:361
bool IsDefinedDiffusionVariable() const
Definition: convection_diffusion_settings.h:133
const Variable< array_1d< double, 3 > > & GetVelocityVariable() const
Definition: convection_diffusion_settings.h:255
bool IsDefinedConvectionVariable() const
Definition: convection_diffusion_settings.h:203
bool IsDefinedMeshVelocityVariable() const
Definition: convection_diffusion_settings.h:231
void SetVolumeSourceVariable(const Variable< double > &rvar)
Definition: convection_diffusion_settings.h:152
const Variable< double > & GetProjectionVariable() const
Definition: convection_diffusion_settings.h:185
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: convection_diffusion_settings.h:369
void SetDensityVariable(const Variable< double > &rvar)
Definition: convection_diffusion_settings.h:110
bool IsDefinedVelocityVariable() const
Definition: convection_diffusion_settings.h:259
const Variable< double > & GetSurfaceSourceVariable() const
Definition: convection_diffusion_settings.h:171
ConvectionDiffusionSettings()=default
Default constructor.
bool IsDefinedSurfaceSourceVariable() const
Definition: convection_diffusion_settings.h:175
const Variable< array_1d< double, 3 > > & GetReactionGradientVariable() const
Definition: convection_diffusion_settings.h:297
const Variable< double > & GetUnknownVariable() const
Definition: convection_diffusion_settings.h:143
virtual ~ConvectionDiffusionSettings()
Destructor.
Definition: convection_diffusion_settings.h:105
void SetVelocityVariable(const Variable< array_1d< double, 3 > > &rvar)
Definition: convection_diffusion_settings.h:250
const Variable< double > & GetVolumeSourceVariable() const
Definition: convection_diffusion_settings.h:157
void SetGradientVariable(const Variable< array_1d< double, 3 > > &rvar)
Definition: convection_diffusion_settings.h:208
const Variable< array_1d< double, 3 > > & GetMeshVelocityVariable() const
Definition: convection_diffusion_settings.h:227
bool IsDefinedDensityVariable() const
Definition: convection_diffusion_settings.h:119
const Variable< double > & GetSpecificHeatVariable() const
Definition: convection_diffusion_settings.h:269
void SetTransferCoefficientVariable(const Variable< double > &rvar)
Definition: convection_diffusion_settings.h:236
ConvectionDiffusionSettings & operator=(ConvectionDiffusionSettings const &rOther)
Definition: convection_diffusion_settings.h:315
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: convection_diffusion_settings.h:375
void SetReactionVariable(const Variable< double > &rvar)
Definition: convection_diffusion_settings.h:278
const Variable< double > & GetTransferCoefficientVariable() const
Definition: convection_diffusion_settings.h:241
void SetMeshVelocityVariable(const Variable< array_1d< double, 3 > > &rvar)
Definition: convection_diffusion_settings.h:222
ConvectionDiffusionSettings(const ConvectionDiffusionSettings &rOther)
Definition: convection_diffusion_settings.h:72
const Variable< double > & GetReactionVariable() const
Definition: convection_diffusion_settings.h:283
bool IsDefinedProjectionVariable() const
Definition: convection_diffusion_settings.h:189
bool IsDefinedSpecificHeatVariable() const
Definition: convection_diffusion_settings.h:273
bool IsDefinedReactionGradientVariable() const
Definition: convection_diffusion_settings.h:301
const Variable< array_1d< double, 3 > > & GetGradientVariable() const
Definition: convection_diffusion_settings.h:213
bool IsDefinedTransferCoefficientVariable() const
Definition: convection_diffusion_settings.h:245
void SetProjectionVariable(const Variable< double > &rvar)
Definition: convection_diffusion_settings.h:180
void SetUnknownVariable(const Variable< double > &rvar)
Definition: convection_diffusion_settings.h:138
bool IsDefinedUnknownVariable() const
Definition: convection_diffusion_settings.h:147
void SetSurfaceSourceVariable(const Variable< double > &rvar)
Definition: convection_diffusion_settings.h:166
void SetReactionGradientVariable(const Variable< array_1d< double, 3 >> &rVar)
Definition: convection_diffusion_settings.h:292
const Variable< double > & GetDensityVariable() const
Definition: convection_diffusion_settings.h:115
void SetConvectionVariable(const Variable< array_1d< double, 3 > > &rvar)
Definition: convection_diffusion_settings.h:194
const Variable< array_1d< double, 3 > > & GetConvectionVariable() const
Definition: convection_diffusion_settings.h:199
KRATOS_CLASS_POINTER_DEFINITION(ConvectionDiffusionSettings)
Pointer definition of ConvectionDiffusionSettings.
bool IsDefinedGradientVariable() const
Definition: convection_diffusion_settings.h:217
const Variable< double > & GetDiffusionVariable() const
Definition: convection_diffusion_settings.h:129
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
KRATOS_DEFINE_VARIABLE(Vector, BIOT_STRAIN_VECTOR)
def load(f)
Definition: ode_solve.py:307