G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsThermoAssembler.hpp
Go to the documentation of this file.
1 
16 #pragma once
17 
19 
22 
23 namespace gismo
24 {
25 
26 template <class T>
28  const gsMultiBasis<T> & bases,
29  const gsBoundaryConditions<T> & b_conditions,
30  const gsFunction<T> & body_force,
31  const gsFunctionSet<T> & temperature_field)
32  :gsElasticityAssembler<T>(patches,bases,b_conditions,body_force),
33  m_temperatureField(temperature_field),
34  assembledElasticity(false)
35 {
36  m_options.addReal("InitTemp","Initial temperature of the object",20.);
37  m_options.addReal("ThExpCoef","Coefficient of thermal expansion of the material",20.);
38  m_options.addSwitch("ParamTemp","Yes if the temperature field is parametric",true);
39 
41 }
42 
43 template <class T>
44 void gsThermoAssembler<T>::assemble(bool saveEliminationMatrix)
45 {
47  elastRhs = gsAssembler<T>::m_system.rhs();
48  assembledElasticity = true;
49 
50  assembleThermo();
51 }
52 
53 template <class T>
55 {
56  for (std::vector< patchSide >::iterator side = m_pde_ptr->domain().bBegin(); side != m_pde_ptr->domain().bEnd(); ++side)
57  {
58  std::pair<index_t,boxSide> temp(side->patch,side->index());
59 
60  typename gsBoundaryConditions<T>::const_iterator it = m_pde_ptr->bc().dirichletBegin();
61  for ( ; it != m_pde_ptr->bc().dirichletEnd(); ++it )
62  if (temp.first == it->patch() && temp.second == it->side())
63  goto exitLabel;
64 
65  nonDirichletSides.push_back(temp);
66  exitLabel:;
67  }
68 }
69 
70 template <class T>
72 {
73  GISMO_ENSURE(assembledElasticity, "gsElThermoAssembler::assemble() hasn't been called!");
74  gsAssembler<T>::m_system.rhs().setZero();
75 
76  gsVisitorThermo<T> visitor(m_temperatureField);
77  gsAssembler<T>::template push<gsVisitorThermo<T> >(visitor);
78 
79  for (std::vector<std::pair<index_t,boxSide> >::const_iterator it = nonDirichletSides.begin();
80  it != nonDirichletSides.end(); ++it)
81  {
82  gsVisitorThermoBoundary<T> bVisitor(it->second,m_temperatureField);
83  gsAssembler<T>::template apply<gsVisitorThermoBoundary<T> >(bVisitor,it->first,it->second);
84  }
85  gsAssembler<T>::m_system.rhs() += elastRhs;
86 }
87 
88 } // namespace ends
gsThermoAssembler(const gsMultiPatch< T > &patches, const gsMultiBasis< T > &bases, const gsBoundaryConditions< T > &b_conditions, const gsFunction< T > &body_force, const gsFunctionSet< T > &temperature_field)
Constructor of the assembler object.
Definition: gsThermoAssembler.hpp:27
void findNonDirichletSides()
Marks all non-Dirichlet sides for assembly of the boundary thermal stresses.
Definition: gsThermoAssembler.hpp:54
gsOptionList m_options
Options.
Definition: gsAssembler.h:285
const gsMatrix< T > & rhs() const
Returns the left-hand side vector(s) ( multiple right hand sides possible )
Definition: gsAssembler.h:618
#define GISMO_ENSURE(cond, message)
Definition: gsDebug.h:102
A function from a n-dimensional domain to an m-dimensional image.
Definition: gsFunction.h:59
Provides a thermal expansion solver for 2D plain strain and 3D continua.
Visitor class for volumetric integration of the thermal stress.
Assembles the stiffness matrix and the right-hand side vector for linear and nonlinear elasticity for...
Definition: gsElasticityAssembler.h:31
Holds a set of patch-wise bases and their topology information.
Definition: gsMultiBasis.h:36
Visitor class for surface integration of the thermal stress.
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
void assembleThermo()
Assembles the thermal expanstion contribution to the RHS.
Definition: gsThermoAssembler.hpp:71
Class containing a set of boundary conditions.
Definition: gsBoundaryConditions.h:341
void addReal(const std::string &label, const std::string &desc, const Real &value)
Adds a option named label, with description desc and value value.
Definition: gsOptionList.cpp:211
The assembler class provides generic routines for volume and boundary integrals that are used for for...
Definition: gsAssembler.h:265
virtual void assemble()
Main assemble routine, to be implemented in derived classes.
Definition: gsAssembler.hpp:51
void addSwitch(const std::string &label, const std::string &desc, const bool &value)
Adds a option named label, with description desc and value value.
Definition: gsOptionList.cpp:235