G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsThermoAssembler.hpp
Go to the documentation of this file.
1
16#pragma once
17
19
22
23namespace gismo
24{
25
26template <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
43template <class T>
44void gsThermoAssembler<T>::assemble(bool saveEliminationMatrix)
45{
46 GISMO_UNUSED(saveEliminationMatrix);
47 Base::assemble(false);
48 elastRhs = gsAssembler<T>::m_system.rhs();
49 assembledElasticity = true;
50
51 assembleThermo();
52}
53
54template <class T>
56{
57 for (std::vector< patchSide >::iterator side = m_pde_ptr->domain().bBegin(); side != m_pde_ptr->domain().bEnd(); ++side)
58 {
59 std::pair<index_t,boxSide> temp(side->patch,side->index());
60
61 typename gsBoundaryConditions<T>::const_iterator it = m_pde_ptr->bc().dirichletBegin();
62 for ( ; it != m_pde_ptr->bc().dirichletEnd(); ++it )
63 if (temp.first == it->patch() && temp.second == it->side())
64 goto exitLabel;
65
66 nonDirichletSides.push_back(temp);
67 exitLabel:;
68 }
69}
70
71template <class T>
73{
74 GISMO_ENSURE(assembledElasticity, "gsElThermoAssembler::assemble() hasn't been called!");
75 gsAssembler<T>::m_system.rhs().setZero();
76
77 gsVisitorThermo<T> visitor(m_temperatureField);
78 gsAssembler<T>::template push<gsVisitorThermo<T> >(visitor);
79
80 for (std::vector<std::pair<index_t,boxSide> >::const_iterator it = nonDirichletSides.begin();
81 it != nonDirichletSides.end(); ++it)
82 {
83 gsVisitorThermoBoundary<T> bVisitor(it->second,m_temperatureField);
84 gsAssembler<T>::template apply<gsVisitorThermoBoundary<T> >(bVisitor,it->first,it->second);
85 }
86 gsAssembler<T>::m_system.rhs() += elastRhs;
87}
88
89} // namespace ends
The assembler class provides generic routines for volume and boundary integrals that are used for for...
Definition gsAssembler.h:266
const gsMatrix< T > & rhs() const
Returns the left-hand side vector(s) ( multiple right hand sides possible )
Definition gsAssembler.h:618
gsOptionList m_options
Options.
Definition gsAssembler.h:285
Class containing a set of boundary conditions.
Definition gsBoundaryConditions.h:342
Assembles the stiffness matrix and the right-hand side vector for linear and nonlinear elasticity for...
Definition gsElasticityAssembler.h:32
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition gsFunctionSet.h:219
A function from a n-dimensional domain to an m-dimensional image.
Definition gsFunction.h:60
Holds a set of patch-wise bases and their topology information.
Definition gsMultiBasis.h:37
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition gsMultiPatch.h:100
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
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
virtual void assemble()
Main assemble routine, to be implemented in derived classes.
Definition gsThermoAssembler.h:45
void findNonDirichletSides()
Marks all non-Dirichlet sides for assembly of the boundary thermal stresses.
Definition gsThermoAssembler.hpp:55
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 assembleThermo()
Assembles the thermal expanstion contribution to the RHS.
Definition gsThermoAssembler.hpp:72
#define GISMO_UNUSED(x)
Definition gsDebug.h:112
#define GISMO_ENSURE(cond, message)
Definition gsDebug.h:102
Provides a thermal expansion solver for 2D plain strain and 3D continua.
Visitor class for surface integration of the thermal stress.
Visitor class for volumetric integration of the thermal stress.
The G+Smo namespace, containing all definitions for the library.