29#include <unordered_set>
34template<
short_t d,
class T,
bool bending>
44 m_spaceBasis(&m_basis),
46 m_forceFun(&surface_force),
47 m_materialMatrices(materialMatrices)
50 m_parametricForce = (surface_force.
domainDim()==2 && (d==2||d==3));
52 this->_defaultOptions();
57template<
short_t d,
class T,
bool bending>
70template<
short_t d,
class T,
bool bending>
82 m_forceFun(&surface_force)
85 GISMO_ASSERT(materialMatrix!=
nullptr,
"Material matrix is incomplete!");
86 GISMO_ASSERT(materialMatrix->initialized(),
"Material matrix is incomplete!");
87 for (
size_t p=0; p!=m_patches.nPatches(); p++)
88 m_materialMatrices.set(p,materialMatrix);
91 m_parametricForce = (surface_force.
domainDim()==2 && (d==2||d==3));
93 this->_defaultOptions();
98template<
short_t d,
class T,
bool bending>
103 m_mapper=other.m_mapper;
104 m_assembler=other.m_assembler;
105 m_evaluator=other.m_evaluator;
106 m_patches=other.m_patches;
107 m_itpatches=other.m_itpatches;
108 m_basis=other.m_basis;
109 m_spaceBasis=other.m_spaceBasis;
111 m_ddofs=other.m_ddofs;
113 m_parametricForce=other.m_parametricForce;
114 m_forceFun=other.m_forceFun;
115 m_foundFun=other.m_foundFun;
116 m_pressFun=other.m_pressFun;
117 m_materialMatrices=other.m_materialMatrices;
118 m_pLoads=other.m_pLoads;
119 m_pMass=other.m_pMass;
120 m_solvector=other.m_solvector;
122 m_options=other.m_options;
123 m_foundInd=other.m_foundInd;
124 m_pressInd=other.m_pressInd;
125 m_continuity=other.m_continuity;
126 m_alpha_d_bc=other.m_alpha_d_bc;
127 m_alpha_r_bc=other.m_alpha_r_bc;
128 m_alpha_d_ifc=other.m_alpha_d_ifc;
129 m_alpha_r_ifc=other.m_alpha_r_ifc;
130 m_IfcDefault=other.m_IfcDefault;
131 m_inPlane=other.m_inPlane;
132 m_outPlane=other.m_outPlane;
133 m_uncoupled=other.m_uncoupled;
134 m_strongC0=other.m_strongC0;
135 m_weakC0=other.m_weakC0;
136 m_strongC1=other.m_strongC1;
137 m_weakC1=other.m_weakC1;
138 m_unassigned=other.m_unassigned;
141 m_assembler.setIntegrationElements(m_basis);
142 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
143 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
148template<
short_t d,
class T,
bool bending>
151 m_mapper=
give(other.m_mapper);
152 m_assembler=
give(other.m_assembler);
153 m_evaluator=
give(other.m_evaluator);
154 m_patches=
give(other.m_patches);
155 m_itpatches=
give(other.m_itpatches);
156 m_basis=
give(other.m_basis);
157 m_spaceBasis=
give(other.m_spaceBasis);
158 m_bcs=
give(other.m_bcs);
159 m_ddofs=
give(other.m_ddofs);
160 m_mass=
give(other.m_mass);
161 m_parametricForce=
give(other.m_parametricForce);
162 m_forceFun=
give(other.m_forceFun);
163 m_foundFun=
give(other.m_foundFun);
164 m_pressFun=
give(other.m_pressFun);
165 m_materialMatrices=
give(other.m_materialMatrices);
166 m_pLoads=
give(other.m_pLoads);
167 m_pMass=
give(other.m_pMass);
168 m_solvector=
give(other.m_solvector);
169 m_rhs=
give(other.m_rhs);
170 m_options=
give(other.m_options);
171 m_foundInd=
give(other.m_foundInd);
172 m_pressInd=
give(other.m_pressInd);
173 m_continuity=
give(other.m_continuity);
174 m_alpha_d_bc=
give(other.m_alpha_d_bc);
175 m_alpha_r_bc=
give(other.m_alpha_r_bc);
176 m_alpha_d_ifc=
give(other.m_alpha_d_ifc);
177 m_alpha_r_ifc=
give(other.m_alpha_r_ifc);
178 m_IfcDefault=
give(other.m_IfcDefault);
179 m_inPlane=
give(other.m_inPlane);
180 m_outPlane=
give(other.m_outPlane);
181 m_uncoupled=
give(other.m_uncoupled);
182 m_strongC0=
give(other.m_strongC0);
183 m_weakC0=
give(other.m_weakC0);
184 m_strongC1=
give(other.m_strongC1);
185 m_weakC1=
give(other.m_weakC1);
186 m_unassigned=
give(other.m_unassigned);
188 m_assembler.setIntegrationElements(m_basis);
189 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
190 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
194template<
short_t d,
class T,
bool bending>
197 m_options.addReal(
"WeakDirichlet",
"Penalty parameter weak dirichlet conditions",1e3);
198 m_options.addReal(
"WeakClamped",
"Penalty parameter weak clamped conditions",1e3);
199 m_options.addInt(
"Continuity",
"Set the continuity for the space",-1);
201 m_options.addReal(
"IfcPenalty",
"Penalty parameter weak coupling conditions on the interface",1e3);
202 m_options.addInt(
"IfcDefault",
"Default weak(!) interface coupling; C^k, k={-1,0,1}",1);
203 m_options.addString(
"Solver",
"Sparse linear solver",
"CGDiagonal");
207 m_options.
update(assemblerOptions,gsOptionList::addIfUnknown);
213template <
short_t d,
class T,
bool bending>
214void gsThinShellAssembler<d, T, bending>::_getOptions()
217 index_t continuity = m_continuity;
218 m_continuity = m_options.getInt(
"Continuity");
219 if (continuity != m_options.getInt(
"Continuity"))
222 m_alpha_d_bc = m_options.getReal(
"WeakDirichlet");
223 m_alpha_r_bc = m_options.getReal(
"WeakClamped");
224 m_alpha_d_ifc = m_alpha_r_ifc = m_options.getReal(
"IfcPenalty");
225 m_IfcDefault = m_options.getInt(
"IfcDefault");
228template<
short_t d,
class T,
bool bending>
233 index_t continuity = m_options.getInt(
"Continuity");
235 m_options.update(options,gsOptionList::ignoreIfUnknown);
238 if (continuity != m_options.getInt(
"Continuity"))
242template<
short_t d,
class T,
bool bending>
248 m_assembler.setIntegrationElements(m_basis);
249 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
250 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
252 GISMO_ASSERT(m_bcs.hasGeoMap(),
"No geometry map was assigned to the boundary conditions. Use bc.setGeoMap to assign one!");
259 space m_space = m_assembler.getSpace(*m_spaceBasis, d, 0);
261 this->_assembleDirichlet();
263 m_ddofs = m_space.fixedPart();
264 m_mapper = m_space.mapper();
271 GISMO_ASSERT(m_forceFun->targetDim()==d,
"Force must have " << d<<
" dimensions but has "<<m_forceFun->targetDim());
281template<
short_t d,
class T,
bool bending>
284 m_strongC0 = interfaces;
287template<
short_t d,
class T,
bool bending>
288void gsThinShellAssembler<d, T, bending>::addStrongC1(
const gsBoxTopology::ifContainer & interfaces)
290 m_strongC1 = interfaces;
293template<
short_t d,
class T,
bool bending>
294void gsThinShellAssembler<d, T, bending>::addWeakC0(
const gsBoxTopology::ifContainer & interfaces)
296 m_weakC0 = interfaces;
299template<
short_t d,
class T,
bool bending>
300void gsThinShellAssembler<d, T, bending>::addWeakC1(
const gsBoxTopology::ifContainer & interfaces)
302 m_weakC1 = interfaces;
305template<
short_t d,
class T,
bool bending>
306void gsThinShellAssembler<d, T, bending>::addUncoupled(
const gsBoxTopology::ifContainer & interfaces)
308 m_uncoupled = interfaces;
311template<
short_t d,
class T,
bool bending>
312void gsThinShellAssembler<d, T, bending>::initInterfaces()
316 for (gsBoxTopology::const_iiterator it = m_patches.topology().iBegin(); it!=m_patches.topology().iEnd(); it++)
319 std::find(m_strongC0.begin(), m_strongC0.end(), *it) == m_strongC0.end()
320 && std::find(m_strongC1.begin(), m_strongC1.end(), *it) == m_strongC1.end()
321 && std::find(m_weakC0.begin(), m_weakC0.end(), *it) == m_weakC0.end()
322 && std::find(m_weakC1.begin(), m_weakC1.end(), *it) == m_weakC1.end()
323 && std::find(m_uncoupled.begin(), m_uncoupled.end(), *it) == m_uncoupled.end()
326 if (m_IfcDefault==-1)
328 else if (m_IfcDefault==0)
329 m_weakC0.push_back(*it);
330 else if (m_IfcDefault==1)
331 m_weakC1.push_back(*it);
340template<
short_t d,
class T,
bool bending>
341void gsThinShellAssembler<d, T, bending>::_assembleNeumann()
343 _assembleNeumann_impl<d>();
346template <
short_t d,
class T,
bool bending>
348typename std::enable_if<(_d==3),
void>::type
349gsThinShellAssembler<d, T, bending>::_assembleNeumann_impl()
351 geometryMap m_ori = m_assembler.getMap(m_patches);
353 space m_space = m_assembler.trialSpace(0);
354 auto g_N = m_assembler.getBdrFunction(m_ori);
355 m_assembler.assembleBdr(m_bcs.get(
"Neumann"),m_space * g_N *
meas(m_ori));
358template <
short_t d,
class T,
bool bending>
360typename std::enable_if<!(_d==3),
void>::type
361gsThinShellAssembler<d, T, bending>::_assembleNeumann_impl()
363 geometryMap m_ori = m_assembler.getMap(m_patches);
365 space m_space = m_assembler.trialSpace(0);
366 auto g_N = m_assembler.getBdrFunction(m_ori);
367 m_assembler.assembleBdr(m_bcs.get(
"Neumann"), m_space * g_N *
meas(m_ori));
370template<
short_t d,
class T,
bool bending>
371template<
bool _matrix>
372void gsThinShellAssembler<d, T, bending>::_assemblePressure(
const gsFunction<T> & pressFun)
375 _assemblePressure_impl<d,_matrix>(pressFun);
378template <
short_t d,
class T,
bool bending>
379template <
short_t _d,
bool matrix>
380typename std::enable_if<(_d==3) && matrix,
void>::type
381gsThinShellAssembler<d, T, bending>::_assemblePressure_impl(
const gsFunction<T> &)
386template <
short_t d,
class T,
bool bending>
387template <
short_t _d,
bool _matrix>
388typename std::enable_if<(_d==3) && !_matrix,
void>::type
389gsThinShellAssembler<d, T, bending>::_assemblePressure_impl(
const gsFunction<T> & pressFun)
391 gsMultiPatch<T> & defpatches = m_patches;
392 geometryMap m_ori = m_assembler.getMap(m_patches);
393 geometryMap m_def = m_assembler.getMap(defpatches);
395 space m_space = m_assembler.trialSpace(0);
397 auto m_pressure = m_assembler.getCoeff(pressFun, m_ori);
398 GISMO_ASSERT(pressFun.targetDim()==1,
"Pressure function has dimension "<<pressFun.targetDim()<<
", but expected 1");
400 m_assembler.assemble(
401 m_pressure.val() * m_space * usn(m_def) *
meas(m_ori)
405template <
short_t d,
class T,
bool bending>
406template <
short_t _d,
bool _matrix>
407typename std::enable_if<!(_d==3),
void>::type
408gsThinShellAssembler<d, T, bending>::_assemblePressure_impl(
const gsFunction<T> &)
413template<
short_t d,
class T,
bool bending>
414template<
bool _matrix>
415void gsThinShellAssembler<d, T, bending>::_assemblePressure(
const gsFunction<T> & pressFun,
const gsFunctionSet<T> & deformed)
418 _assemblePressure_impl<d,_matrix>(pressFun,deformed);
422template <
short_t d,
class T,
bool bending>
423template <
short_t _d,
bool matrix>
424typename std::enable_if<(_d==3) && matrix,
void>::type
425gsThinShellAssembler<d, T, bending>::_assemblePressure_impl(
const gsFunction<T> & pressFun,
const gsFunctionSet<T> & deformed)
427 geometryMap m_ori = m_assembler.getMap(m_patches);
428 geometryMap m_def = m_assembler.getMap(deformed);
430 space m_space = m_assembler.trialSpace(0);
432 auto m_pressure = m_assembler.getCoeff(pressFun, m_ori);
433 GISMO_ASSERT(pressFun.targetDim()==1,
"Pressure function has dimension "<<pressFun.targetDim()<<
", but expected 1");
435 m_assembler.assemble(
436 -m_pressure.val() * m_space * var1(m_space,m_def).tr()*
meas(m_ori)
442template <
short_t d,
class T,
bool bending>
443template <
short_t _d,
bool _matrix>
444typename std::enable_if<(_d==3) && !_matrix,
void>::type
445gsThinShellAssembler<d, T, bending>::_assemblePressure_impl(
const gsFunction<T> & pressFun,
const gsFunctionSet<T> & deformed)
447 geometryMap m_ori = m_assembler.getMap(m_patches);
448 geometryMap m_def = m_assembler.getMap(deformed);
450 space m_space = m_assembler.trialSpace(0);
452 auto m_pressure = m_assembler.getCoeff(pressFun, m_ori);
453 GISMO_ASSERT(pressFun.targetDim()==1,
"Pressure function has dimension "<<pressFun.targetDim()<<
", but expected 1");
456 m_assembler.assemble(
457 m_pressure.val() * m_space * sn(m_def).normalized() *
meas(m_ori)
461template <
short_t d,
class T,
bool bending>
462template <
short_t _d,
bool _matrix>
463typename std::enable_if<!(_d==3),
void>::type
464gsThinShellAssembler<d, T, bending>::_assemblePressure_impl(
const gsFunction<T> & ,
const gsFunctionSet<T> & )
469template<
short_t d,
class T,
bool bending>
470template<
bool _matrix>
471void gsThinShellAssembler<d, T, bending>::_assembleFoundation(
const gsFunction<T> & foundFun)
474 _assembleFoundation_impl<d,_matrix>(foundFun);
477template <
short_t d,
class T,
bool bending>
478template <
short_t _d,
bool _matrix>
479typename std::enable_if<(_d==3) && _matrix,
void>::type
480gsThinShellAssembler<d, T, bending>::_assembleFoundation_impl(
const gsFunction<T> & foundFun)
482 geometryMap m_ori = m_assembler.getMap(m_patches);
484 space m_space = m_assembler.trialSpace(0);
486 auto m_foundation = m_assembler.getCoeff(foundFun, m_ori);
487 GISMO_ASSERT(foundFun.targetDim()==3,
"Foundation function has dimension "<<foundFun.targetDim()<<
", but expected 3");
489 m_assembler.assemble(
490 m_space * m_foundation.asDiag() * m_space.tr() *
meas(m_ori)
495template <
short_t d,
class T,
bool bending>
496template <
short_t _d,
bool _matrix>
497typename std::enable_if<(_d==3) && !_matrix,
void>::type
498gsThinShellAssembler<d, T, bending>::_assembleFoundation_impl(
const gsFunction<T> & )
503template <
short_t d,
class T,
bool bending>
504template <
short_t _d,
bool _matrix>
505typename std::enable_if<!(_d==3),
void>::type
506gsThinShellAssembler<d, T, bending>::_assembleFoundation_impl(
const gsFunction<T> & )
511template<
short_t d,
class T,
bool bending>
512template<
bool _matrix>
513void gsThinShellAssembler<d, T, bending>::_assembleFoundation(
const gsFunction<T> & foundFun,
const gsFunctionSet<T> & deformed)
516 _assembleFoundation_impl<d,_matrix>(foundFun,deformed);
520template <
short_t d,
class T,
bool bending>
521template <
short_t _d,
bool matrix>
522typename std::enable_if<(_d==3) && matrix,
void>::type
523gsThinShellAssembler<d, T, bending>::_assembleFoundation_impl(
const gsFunction<T> & foundFun,
const gsFunctionSet<T> & )
525 geometryMap m_ori = m_assembler.getMap(m_patches);
527 space m_space = m_assembler.trialSpace(0);
529 auto m_foundation = m_assembler.getCoeff(foundFun, m_ori);
530 GISMO_ASSERT(foundFun.targetDim()==3,
"Foundation function has dimension "<<foundFun.targetDim()<<
", but expected 3");
532 m_assembler.assemble(
533 m_space * m_foundation.asDiag() * m_space.tr() *
meas(m_ori)
537template <
short_t d,
class T,
bool bending>
538template <
short_t _d,
bool _matrix>
539typename std::enable_if<(_d==3) && !_matrix,
void>::type
540gsThinShellAssembler<d, T, bending>::_assembleFoundation_impl(
const gsFunction<T> & foundFun,
const gsFunctionSet<T> & deformed)
542 geometryMap m_ori = m_assembler.getMap(m_patches);
543 geometryMap m_def = m_assembler.getMap(deformed);
545 space m_space = m_assembler.trialSpace(0);
547 auto m_foundation = m_assembler.getCoeff(foundFun, m_ori);
548 GISMO_ASSERT(foundFun.targetDim()==3,
"Foundation function has dimension "<<foundFun.targetDim()<<
", but expected 3");
551 m_assembler.assemble(
552 m_space * m_foundation.asDiag() * (m_def - m_ori) *
meas(m_ori)
556template <
short_t d,
class T,
bool bending>
557template <
short_t _d,
bool _matrix>
558typename std::enable_if<!(_d==3),
void>::type
559gsThinShellAssembler<d, T, bending>::_assembleFoundation_impl(
const gsFunction<T> & ,
const gsFunctionSet<T> & )
564template<
short_t d,
class T,
bool bending>
565template<
bool _matrix>
566void gsThinShellAssembler<d, T, bending>::_assembleWeakBCs()
569 _assembleWeakBCs_impl<d,_matrix>();
572template <
short_t d,
class T,
bool bending>
573template <
short_t _d,
bool _matrix>
574typename std::enable_if<(_d==3) && _matrix,
void>::type
575gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl()
577 gsMultiPatch<T> & defpatches = m_patches;
578 geometryMap m_ori = m_assembler.getMap(m_patches);
580 space m_space = m_assembler.trialSpace(0);
583 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&defpatches);
584 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&defpatches);
585 auto mmA = m_assembler.getCoeff(m_mmA);
586 auto mmD = m_assembler.getCoeff(m_mmD);
588 auto cart2cov = cartcov(m_ori);
589 auto con2cartI = cartcon(m_ori).inv();
591 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
592 auto mmDcart = (con2cartI *
reshape(mmD,3,3) * cart2cov);
594 element el = m_assembler.getElement();
595 auto alpha_d = m_alpha_d_bc *
reshape(mmAcart,9,1).max().val() / el.area(m_ori);
596 auto alpha_r = m_alpha_r_bc *
reshape(mmDcart,9,1).max().val() / el.area(m_ori);
599 m_assembler.assembleBdr
601 m_bcs.get(
"Weak Dirichlet")
603 -(alpha_d * m_space * m_space.tr()) *
meas(m_ori)
607 m_assembler.assembleBdr
609 m_bcs.get(
"Weak Clamped")
612 alpha_r * ( ( var1(m_space,m_ori) * unv(m_ori) ) * ( var1(m_space,m_ori) * unv(m_ori) ).tr() )
617template <
short_t d,
class T,
bool bending>
618template <
short_t _d,
bool _matrix>
619typename std::enable_if<(_d==3) && !_matrix,
void>::type
620gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl()
622 gsMultiPatch<T> & defpatches = m_patches;
623 geometryMap m_ori = m_assembler.getMap(m_patches);
625 space m_space = m_assembler.trialSpace(0);
626 auto g_N = m_assembler.getBdrFunction(m_ori);
628 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&defpatches);
629 auto mmA = m_assembler.getCoeff(m_mmA);
631 auto cart2cov = cartcov(m_ori);
632 auto con2cartI = cartcon(m_ori).inv();
634 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
636 element el = m_assembler.getElement();
637 auto alpha_d = m_alpha_d_bc *
reshape(mmAcart,9,1).max().val() / el.area(m_ori);
641 m_assembler.assembleBdr
643 m_bcs.get(
"Weak Dirichlet")
645 -(alpha_d * m_space * g_N ) *
meas(m_ori)
652template <
short_t d,
class T,
bool bending>
653template <
short_t _d,
bool _matrix>
654typename std::enable_if<!(_d==3) && _matrix,
void>::type
655gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl()
657 gsMultiPatch<T> & defpatches = m_patches;
658 geometryMap m_ori = m_assembler.getMap(m_patches);
660 space m_space = m_assembler.trialSpace(0);
663 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&defpatches);
664 auto mmA = m_assembler.getCoeff(m_mmA);
666 auto cart2cov = cartcov(m_ori);
667 auto con2cartI = cartcon(m_ori).inv();
669 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
671 element el = m_assembler.getElement();
672 auto alpha_d = m_alpha_d_bc *
reshape(mmAcart,9,1).max().val() / el.area(m_ori);
675 m_assembler.assembleBdr
677 m_bcs.get(
"Weak Dirichlet")
679 -(alpha_d * m_space * m_space.tr()) *
meas(m_ori)
683template <
short_t d,
class T,
bool bending>
684template <
short_t _d,
bool _matrix>
685typename std::enable_if<!(_d==3) && !_matrix,
void>::type
686gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl()
688 geometryMap m_ori = m_assembler.getMap(m_patches);
690 space m_space = m_assembler.trialSpace(0);
691 auto g_N = m_assembler.getBdrFunction(m_ori);
694 m_assembler.assembleBdr
696 m_bcs.get(
"Weak Dirichlet")
698 (m_alpha_d_bc * (m_space * (m_ori - m_ori) - m_space * (g_N) )) *
meas(m_ori)
702template <
short_t d,
class T,
bool bending>
703template <
bool _matrix>
704void gsThinShellAssembler<d, T, bending>::_assembleWeakBCs(
const gsFunctionSet<T> & deformed)
707 _assembleWeakBCs_impl<d,_matrix>(deformed);
710template <
short_t d,
class T,
bool bending>
711template <
short_t _d,
bool _matrix>
712typename std::enable_if<(_d==3) && _matrix,
void>::type
713gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl(
const gsFunctionSet<T> & deformed)
715 geometryMap m_ori = m_assembler.getMap(m_patches);
716 geometryMap m_def = m_assembler.getMap(deformed);
718 space m_space = m_assembler.trialSpace(0);
721 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
722 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&deformed);
723 auto mmA = m_assembler.getCoeff(m_mmA);
724 auto mmD = m_assembler.getCoeff(m_mmD);
726 auto cart2cov = cartcov(m_ori);
727 auto con2cartI = cartcon(m_ori).inv();
729 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
730 auto mmDcart = (con2cartI *
reshape(mmD,3,3) * cart2cov);
732 element el = m_assembler.getElement();
733 auto alpha_d = m_alpha_d_bc *
reshape(mmAcart,9,1).max().val() / el.area(m_ori);
734 auto alpha_r = m_alpha_r_bc *
reshape(mmDcart,9,1).max().val() / el.area(m_ori);
737 auto du = m_def - m_ori;
738 auto dnN = ( usn(m_def).tr()*unv(m_ori) - usn(m_ori).tr()*unv(m_ori) ).val();
741 m_assembler.assembleBdr
743 m_bcs.get(
"Weak Dirichlet")
745 -alpha_d * m_space * m_space.tr() *
meas(m_ori)
749 m_assembler.assembleBdr
751 m_bcs.get(
"Weak Clamped")
754 alpha_r * dnN * ( var2deriv2(m_space,m_space,m_def,unv(m_ori).tr()) )
756 alpha_r * ( ( var1(m_space,m_def) * unv(m_ori) ) * ( var1(m_space,m_def) * unv(m_ori) ).tr() )
761template <
short_t d,
class T,
bool bending>
762template <
short_t _d,
bool _matrix>
763typename std::enable_if<(_d==3) && !_matrix,
void>::type
764gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl(
const gsFunctionSet<T> & deformed)
766 geometryMap m_ori = m_assembler.getMap(m_patches);
767 geometryMap m_def = m_assembler.getMap(deformed);
769 space m_space = m_assembler.trialSpace(0);
770 auto g_N = m_assembler.getBdrFunction(m_ori);
772 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
773 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&deformed);
774 auto mmA = m_assembler.getCoeff(m_mmA);
775 auto mmD = m_assembler.getCoeff(m_mmD);
777 auto cart2cov = cartcov(m_ori);
778 auto con2cartI = cartcon(m_ori).inv();
780 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
781 auto mmDcart = (con2cartI *
reshape(mmD,3,3) * cart2cov);
783 element el = m_assembler.getElement();
784 auto alpha_d = m_alpha_d_bc *
reshape(mmAcart,9,1).max().val() / el.area(m_ori);
785 auto alpha_r = m_alpha_r_bc *
reshape(mmDcart,9,1).max().val() / el.area(m_ori);
787 auto du = m_def - m_ori;
788 auto dnN = ( usn(m_def).tr()*
nv(m_ori) - usn(m_ori).tr()*
nv(m_ori) ).val();
791 m_assembler.assembleBdr
793 m_bcs.get(
"Weak Dirichlet")
795 alpha_d * (m_space * du - m_space * (g_N) ) *
meas(m_ori)
799 m_assembler.assembleBdr
801 m_bcs.get(
"Weak Clamped")
804 - alpha_r * dnN * ( var1(m_space,m_def) * usn(m_ori) )
809template <
short_t d,
class T,
bool bending>
810template <
short_t _d,
bool _matrix>
811typename std::enable_if<!(_d==3) && _matrix,
void>::type
812gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl(
const gsFunctionSet<T> & deformed)
814 geometryMap m_ori = m_assembler.getMap(m_patches);
816 space m_space = m_assembler.trialSpace(0);
818 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
819 auto mmA = m_assembler.getCoeff(m_mmA);
821 auto cart2cov = cartcov(m_ori);
822 auto con2cartI = cartcon(m_ori).inv();
824 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
826 element el = m_assembler.getElement();
827 auto alpha_d = m_alpha_d_bc *
reshape(mmAcart,9,1).max().val() / el.area(m_ori);
830 m_assembler.assembleBdr
832 m_bcs.get(
"Weak Dirichlet")
834 -alpha_d * m_space * m_space.tr() *
meas(m_ori)
838template <
short_t d,
class T,
bool bending>
839template <
short_t _d,
bool _matrix>
840typename std::enable_if<!(_d==3) && !_matrix,
void>::type
841gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl(
const gsFunctionSet<T> & deformed)
843 geometryMap m_ori = m_assembler.getMap(m_patches);
844 geometryMap m_def = m_assembler.getMap(deformed);
846 space m_space = m_assembler.trialSpace(0);
847 auto g_N = m_assembler.getBdrFunction(m_ori);
849 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
850 auto mmA = m_assembler.getCoeff(m_mmA);
852 auto cart2cov = cartcov(m_ori);
853 auto con2cartI = cartcon(m_ori).inv();
855 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
857 element el = m_assembler.getElement();
858 auto alpha_d = m_alpha_d_bc *
reshape(mmAcart,9,1).max().val() / el.area(m_ori);
861 m_assembler.assembleBdr
863 m_bcs.get(
"Weak Dirichlet")
865 alpha_d * (m_space * (m_def - m_ori) - m_space * (g_N) ) *
meas(m_ori)
869template<
short_t d,
class T,
bool bending>
870template<
bool _matrix>
871void gsThinShellAssembler<d, T, bending>::_assembleWeakIfc()
874 if (m_weakC0.size()==0 && m_weakC1.size()==0)
876 _assembleWeakIfc_impl<d,_matrix>();
879template <
short_t d,
class T,
bool bending>
880template <
short_t _d,
bool _matrix>
881typename std::enable_if<(_d==3) && _matrix,
void>::type
882gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl()
884 gsMultiPatch<T> & defpatches = m_patches;
885 geometryMap m_ori = m_assembler.getMap(m_patches);
887 space m_space = m_assembler.trialSpace(0);
890 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&defpatches);
891 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&defpatches);
892 auto mmA = m_assembler.getCoeff(m_mmA);
893 auto mmD = m_assembler.getCoeff(m_mmD);
895 auto cart2cov = cartcov(m_ori);
896 auto con2cartI = cartcon(m_ori).inv();
898 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
899 auto mmDcart = (con2cartI *
reshape(mmD,3,3) * cart2cov);
901 element el = m_assembler.getElement();
902 auto h = (el.area(m_ori.left()) + el.area(m_ori.right())) / 2;
903 auto alpha_d = m_alpha_d_ifc *
reshape(mmAcart,9,1).max().val() / h;
904 auto alpha_r = m_alpha_r_ifc *
reshape(mmDcart,9,1).max().val() / h;
907 m_assembler.assembleIfc(m_weakC0,
908 alpha_d * m_space.left() * m_space.left().tr() *
meas(m_ori)
910 -alpha_d * m_space.right()* m_space.left() .tr() *
meas(m_ori)
912 -alpha_d * m_space.left() * m_space.right().tr() *
meas(m_ori)
914 alpha_d * m_space.right()* m_space.right().tr() *
meas(m_ori)
920 m_assembler.assembleIfc(m_weakC1,
921 alpha_r * ( var1(m_space.left(),m_ori.left()) * usn(m_ori.right()) ) * ( var1(m_space.left(),m_ori.left()) * usn(m_ori.right()) ).tr() *
meas(m_ori)
923 alpha_r * ( var1(m_space.left(),m_ori.left()) * usn(m_ori.right()) ) * ( var1(m_space.right(),m_ori.right()) * usn(m_ori.left()) ).tr() *
meas(m_ori)
925 alpha_r * ( var1(m_space.right(),m_ori.right()) * usn(m_ori.left()) ) * ( var1(m_space.left(),m_ori.left()) * usn(m_ori.right()) ).tr() *
meas(m_ori)
927 alpha_r * ( var1(m_space.right(),m_ori.right()) * usn(m_ori.left()) ) * ( var1(m_space.right(),m_ori.right()) * usn(m_ori.left()) ).tr() *
meas(m_ori)
930 alpha_r * ( var1(m_space.right(),m_ori.right()) * usn(m_ori.left()) ) * ( var1(m_space.right(),m_ori.right()) * usn(m_ori.left()) ).tr() *
meas(m_ori)
932 alpha_r * ( var1(m_space.right(),m_ori.right()) * usn(m_ori.left()) ) * ( var1(m_space.left(),m_ori.left()) * usn(m_ori.right()) ).tr() *
meas(m_ori)
934 alpha_r * ( var1(m_space.left(),m_ori.left()) * usn(m_ori.right()) ) * ( var1(m_space.right(),m_ori.right()) * usn(m_ori.left()) ).tr() *
meas(m_ori)
936 alpha_r * ( var1(m_space.left(),m_ori.left()) * usn(m_ori.right()) ) * ( var1(m_space.left(),m_ori.left()) * usn(m_ori.right()) ).tr() *
meas(m_ori)
941 m_assembler.assembleIfc(m_weakC1,
942 alpha_r * ( ovar1(m_space.left() ,m_ori.left() ) * usn(m_ori.right()) ) * ( ovar1(m_space.left() ,m_ori.left() ) * usn(m_ori.right()) ).tr() *
meas(m_ori)
944 alpha_r * ( var1(m_space.left() ,m_ori.left() ) * unv(m_ori.right()) ) * ( var1(m_space.left() ,m_ori.left() ) * unv(m_ori.right()) ).tr() *
meas(m_ori)
946 alpha_r * ( ovar1(m_space.left() ,m_ori.left() ) * usn(m_ori.right()) ) * ( var1(m_space.right(),m_ori.right()) * unv(m_ori.left() ) ).tr() *
meas(m_ori)
948 alpha_r * ( var1(m_space.left() ,m_ori.left() ) * unv(m_ori.right()) ) * ( ovar1(m_space.right(),m_ori.right()) * usn(m_ori.left() ) ).tr() *
meas(m_ori)
950 alpha_r * ( var1(m_space.right(),m_ori.right()) * unv(m_ori.left() ) ) * ( ovar1(m_space.left() ,m_ori.left() ) * usn(m_ori.right()) ).tr() *
meas(m_ori)
952 alpha_r * ( ovar1(m_space.right(),m_ori.right()) * usn(m_ori.left() ) ) * ( var1(m_space.left() ,m_ori.left() ) * unv(m_ori.right()) ).tr() *
meas(m_ori)
954 alpha_r * ( var1(m_space.right(),m_ori.right()) * unv(m_ori.left() ) ) * ( var1(m_space.right(),m_ori.right()) * unv(m_ori.left() ) ).tr() *
meas(m_ori)
956 alpha_r * ( ovar1(m_space.right(),m_ori.right()) * usn(m_ori.left() ) ) * ( ovar1(m_space.right(),m_ori.right()) * usn(m_ori.left() ) ).tr() *
meas(m_ori)
960template <
short_t d,
class T,
bool bending>
961template <
short_t _d,
bool _matrix>
962typename std::enable_if<(_d==3) && !_matrix,
void>::type
963gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl()
970template <
short_t d,
class T,
bool bending>
971template <
short_t _d,
bool _matrix>
972typename std::enable_if<!(_d==3) && _matrix,
void>::type
973gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl()
975 gsMultiPatch<T> & defpatches = m_patches;
976 geometryMap m_ori = m_assembler.getMap(m_patches);
978 space m_space = m_assembler.trialSpace(0);
980 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&defpatches);
981 auto mmA = m_assembler.getCoeff(m_mmA);
983 auto cart2cov = cartcov(m_ori);
984 auto con2cartI = cartcon(m_ori).inv();
986 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
988 element el = m_assembler.getElement();
989 auto h = (el.area(m_ori.left()) + el.area(m_ori.right())) / 2;
990 auto alpha_d = m_alpha_d_ifc *
reshape(mmAcart,9,1).max().val() / h;
993 m_assembler.assembleIfc(m_weakC0,
994 alpha_d * m_space.left() * m_space.left().tr() *
meas(m_ori) *
meas(m_ori)
996 -alpha_d * m_space.right()* m_space.left() .tr() *
meas(m_ori) *
meas(m_ori)
998 -alpha_d * m_space.left() * m_space.right().tr() *
meas(m_ori) *
meas(m_ori)
1000 alpha_d * m_space.right()* m_space.right().tr() *
meas(m_ori) *
meas(m_ori)
1006template <
short_t d,
class T,
bool bending>
1007template <
short_t _d,
bool _matrix>
1008typename std::enable_if<!(_d==3) && !_matrix,
void>::type
1009gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl()
1016template<
short_t d,
class T,
bool bending>
1017template<
bool _matrix>
1018void gsThinShellAssembler<d, T, bending>::_assembleWeakIfc(
const gsFunctionSet<T> & deformed)
1020 this->_getOptions();
1021 _assembleWeakIfc_impl<d,_matrix>(deformed);
1024template <
short_t d,
class T,
bool bending>
1025template <
short_t _d,
bool _matrix>
1026typename std::enable_if<(_d==3) && _matrix,
void>::type
1027gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl(
const gsFunctionSet<T> & deformed)
1029 geometryMap m_ori = m_assembler.getMap(m_patches);
1030 geometryMap m_def = m_assembler.getMap(deformed);
1032 space m_space = m_assembler.trialSpace(0);
1034 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1035 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&deformed);
1036 auto mmA = m_assembler.getCoeff(m_mmA);
1037 auto mmD = m_assembler.getCoeff(m_mmD);
1039 auto cart2cov = cartcov(m_ori);
1040 auto con2cartI = cartcon(m_ori).inv();
1042 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
1043 auto mmDcart = (con2cartI *
reshape(mmD,3,3) * cart2cov);
1045 element el = m_assembler.getElement();
1046 auto h = (el.area(m_ori.left()) + el.area(m_ori.right())) / 2;
1047 auto alpha_d = m_alpha_d_ifc *
reshape(mmAcart,9,1).max().val() / h;
1048 auto alpha_r = m_alpha_r_ifc *
reshape(mmDcart,9,1).max().val() / h;
1050 auto du = ((m_def.left()-m_ori.left()) - (m_def.right()-m_ori.right()));
1052 auto dN_lr = (usn(m_def.left()).tr()*usn(m_def.right())
1053 - usn(m_ori.left()).tr()*usn(m_ori.right())).val();
1055 auto dN_rl = (usn(m_def.right()).tr()*usn(m_def.left())
1056 - usn(m_ori.right()).tr()*usn(m_ori.left())).val();
1058 auto dnN_lr= (unv(m_def.left()).tr()*usn(m_def.right())
1059 - unv(m_ori.left()).tr()*usn(m_ori.right())).val();
1061 auto dnN_rl= (unv(m_def.right()).tr()*usn(m_def.left())
1062 - unv(m_ori.right()).tr()*usn(m_ori.left())).val();
1065 m_assembler.assembleIfc(m_weakC0,
1066 alpha_d * m_space.left() * m_space.left().tr() *
meas(m_ori)
1068 -alpha_d * m_space.right()* m_space.left() .tr() *
meas(m_ori)
1070 -alpha_d * m_space.left() * m_space.right().tr() *
meas(m_ori)
1072 alpha_d * m_space.right()* m_space.right().tr() *
meas(m_ori)
1078 m_assembler.assembleIfc(m_weakC1,
1079 alpha_r * dN_lr * var2(m_space.left() ,m_space.left() ,m_def.left() ,usn(m_def.right()).tr() ) *
meas(m_ori)
1081 alpha_r * dN_rl * var2( m_space.left(),m_space.left(),m_def.left(),usn(m_def.right() ).tr() ) *
meas(m_ori)
1083 alpha_r * dN_lr * ( var1(m_space.left() ,m_def.left() ) * var1(m_space.right(),m_def.right()).tr() ) *
meas(m_ori)
1085 alpha_r * dN_rl * ( var1(m_space.left(),m_def.left()) * var1(m_space.right() ,m_def.right() ).tr() ) *
meas(m_ori)
1087 alpha_r * dN_lr * ( var1(m_space.right(),m_def.right()) * var1(m_space.left() ,m_def.left() ).tr() ) *
meas(m_ori)
1089 alpha_r * dN_rl * ( var1(m_space.right() ,m_def.right() ) * var1(m_space.left(),m_def.left()).tr() ) *
meas(m_ori)
1091 alpha_r * dN_lr * var2( m_space.right(),m_space.right(),m_def.right(),usn(m_def.left() ).tr() ) *
meas(m_ori)
1093 alpha_r * dN_rl * var2(m_space.right() ,m_space.right() ,m_def.right() ,usn(m_def.left()).tr() ) *
meas(m_ori)
1098 m_assembler.assembleIfc(m_weakC1,
1099 alpha_r * ( var1(m_space.left(),m_def.left()) * usn(m_def.right()) ) * ( var1(m_space.left(),m_def.left()) * usn(m_def.right()) ).tr() *
meas(m_ori)
1101 alpha_r * ( var1(m_space.left(),m_def.left()) * usn(m_def.right()) ) * ( var1(m_space.right(),m_def.right()) * usn(m_def.left()) ).tr() *
meas(m_ori)
1103 alpha_r * ( var1(m_space.right(),m_def.right()) * usn(m_def.left()) ) * ( var1(m_space.left(),m_def.left()) * usn(m_def.right()) ).tr() *
meas(m_ori)
1105 alpha_r * ( var1(m_space.right(),m_def.right()) * usn(m_def.left()) ) * ( var1(m_space.right(),m_def.right()) * usn(m_def.left()) ).tr() *
meas(m_ori)
1108 alpha_r * ( var1(m_space.right(),m_def.right()) * usn(m_def.left()) ) * ( var1(m_space.right(),m_def.right()) * usn(m_def.left()) ).tr() *
meas(m_ori)
1110 alpha_r * ( var1(m_space.right(),m_def.right()) * usn(m_def.left()) ) * ( var1(m_space.left(),m_def.left()) * usn(m_def.right()) ).tr() *
meas(m_ori)
1112 alpha_r * ( var1(m_space.left(),m_def.left()) * usn(m_def.right()) ) * ( var1(m_space.right(),m_def.right()) * usn(m_def.left()) ).tr() *
meas(m_ori)
1114 alpha_r * ( var1(m_space.left(),m_def.left()) * usn(m_def.right()) ) * ( var1(m_space.left(),m_def.left()) * usn(m_def.right()) ).tr() *
meas(m_ori)
1119 m_assembler.assembleIfc(m_weakC1,
1120 alpha_r * dnN_lr * ovar2(m_space.left(),m_space.left(),m_def.left(),usn(m_def.right()).tr()) *
meas(m_ori)
1122 alpha_r * dnN_rl * ovar2(m_space.left(),m_space.left(),m_def.left(),usn(m_def.right()).tr()) *
meas(m_ori)
1124 alpha_r * dnN_lr * ( ovar1(m_space.left() ,m_def.left() ) * var1(m_space.right(),m_def.right()).tr() ) *
meas(m_ori)
1126 alpha_r * dnN_rl * ( ovar1(m_space.left() ,m_def.left() ) * var1(m_space.right(),m_def.right()).tr() ) *
meas(m_ori)
1128 alpha_r * dnN_lr * ( ovar1(m_space.right(),m_def.right()) * var1(m_space.left() ,m_def.left() ).tr() ) *
meas(m_ori)
1130 alpha_r * dnN_rl * ( ovar1(m_space.right(),m_def.right()) * var1(m_space.left() ,m_def.left() ).tr() ) *
meas(m_ori)
1132 alpha_r * dnN_lr * ovar2(m_space.right(),m_space.right(),m_def.right(),usn(m_def.left()).tr()) *
meas(m_ori)
1134 alpha_r * dnN_rl * ovar2(m_space.right(),m_space.right(),m_def.right(),usn(m_def.left()).tr()) *
meas(m_ori)
1139 m_assembler.assembleIfc(m_weakC1,
1140 alpha_r * ( ovar1(m_space.left() ,m_def.left() ) * usn(m_def.right()) ) * ( ovar1(m_space.left() ,m_def.left() ) * usn(m_def.right()) ).tr() *
meas(m_ori)
1142 alpha_r * ( var1(m_space.left() ,m_def.left() ) * unv(m_def.right()) ) * ( var1(m_space.left() ,m_def.left() ) * unv(m_def.right()) ).tr() *
meas(m_ori)
1144 alpha_r * ( ovar1(m_space.left() ,m_def.left() ) * usn(m_def.right()) ) * ( var1(m_space.right(),m_def.right()) * unv(m_def.left() ) ).tr() *
meas(m_ori)
1146 alpha_r * ( var1(m_space.left() ,m_def.left() ) * unv(m_def.right()) ) * ( ovar1(m_space.right(),m_def.right()) * usn(m_def.left() ) ).tr() *
meas(m_ori)
1148 alpha_r * ( var1(m_space.right(),m_def.right()) * unv(m_def.left() ) ) * ( ovar1(m_space.left() ,m_def.left() ) * usn(m_def.right()) ).tr() *
meas(m_ori)
1150 alpha_r * ( ovar1(m_space.right(),m_def.right()) * usn(m_def.left() ) ) * ( var1(m_space.left() ,m_def.left() ) * unv(m_def.right()) ).tr() *
meas(m_ori)
1152 alpha_r * ( var1(m_space.right(),m_def.right()) * unv(m_def.left() ) ) * ( var1(m_space.right(),m_def.right()) * unv(m_def.left() ) ).tr() *
meas(m_ori)
1154 alpha_r * ( ovar1(m_space.right(),m_def.right()) * usn(m_def.left() ) ) * ( ovar1(m_space.right(),m_def.right()) * usn(m_def.left() ) ).tr() *
meas(m_ori)
1158template <
short_t d,
class T,
bool bending>
1159template <
short_t _d,
bool _matrix>
1160typename std::enable_if<(_d==3) && !_matrix,
void>::type
1161gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl(
const gsFunctionSet<T> & deformed)
1163 geometryMap m_ori = m_assembler.getMap(m_patches);
1164 geometryMap m_def = m_assembler.getMap(deformed);
1166 space m_space = m_assembler.trialSpace(0);
1168 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1169 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&deformed);
1170 auto mmA = m_assembler.getCoeff(m_mmA);
1171 auto mmD = m_assembler.getCoeff(m_mmD);
1173 auto cart2cov = cartcov(m_ori);
1174 auto con2cartI = cartcon(m_ori).inv();
1176 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
1177 auto mmDcart = (con2cartI *
reshape(mmD,3,3) * cart2cov);
1179 element el = m_assembler.getElement();
1180 auto h = (el.area(m_ori.left()) + el.area(m_ori.right())) / 2;
1181 auto alpha_d = m_alpha_d_ifc *
reshape(mmAcart,9,1).max().val() / h;
1182 auto alpha_r = m_alpha_r_ifc *
reshape(mmDcart,9,1).max().val() / h;
1184 auto du = ((m_def.left()-m_ori.left()) - (m_def.right()-m_ori.right()));
1186 auto dN_lr = (usn(m_def.left()).tr()*usn(m_def.right())
1187 - usn(m_ori.left()).tr()*usn(m_ori.right())).val();
1189 auto dN_rl = (usn(m_def.right()).tr()*usn(m_def.left())
1190 - usn(m_ori.right()).tr()*usn(m_ori.left())).val();
1192 auto dnN_lr= (unv(m_def.left()).tr()*usn(m_def.right())
1193 - unv(m_ori.left()).tr()*usn(m_ori.right())).val();
1195 auto dnN_rl= (unv(m_def.right()).tr()*usn(m_def.left())
1196 - unv(m_ori.right()).tr()*usn(m_ori.left())).val();
1199 m_assembler.assembleIfc(m_weakC0,
1200 -alpha_d * m_space.left() * du *
meas(m_ori)
1202 alpha_d * m_space.right()* du *
meas(m_ori)
1206 m_assembler.assembleIfc(m_weakC1,
1207 -alpha_r * dN_lr * var1(m_space.left(),m_def.left()) * usn(m_def.right()) *
meas(m_ori)
1209 -alpha_r * dN_lr * var1(m_space.right(),m_def.right()) * usn(m_def.left() ) *
meas(m_ori)
1212 -alpha_r * dN_rl * var1(m_space.right(),m_def.right()) * usn(m_def.left()) *
meas(m_ori)
1214 -alpha_r * dN_rl * var1(m_space.left(),m_def.left()) * usn(m_def.right() ) *
meas(m_ori)
1219 m_assembler.assembleIfc(m_weakC1,
1220 -alpha_r * dnN_lr* ovar1(m_space.left(),m_def.left()) * usn(m_def.right()) *
meas(m_ori)
1222 -alpha_r * dnN_lr* var1(m_space.right(),m_def.right()) * unv(m_def.left() ) *
meas(m_ori)
1225 -alpha_r * dnN_rl* ovar1(m_space.right(),m_def.right()) * usn(m_def.left()) *
meas(m_ori)
1227 -alpha_r * dnN_rl* var1(m_space.left(),m_def.left()) * unv(m_def.right() ) *
meas(m_ori)
1231template <
short_t d,
class T,
bool bending>
1232template <
short_t _d,
bool _matrix>
1233typename std::enable_if<!(_d==3) && _matrix,
void>::type
1234gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl(
const gsFunctionSet<T> & deformed)
1236 geometryMap m_ori = m_assembler.getMap(m_patches);
1237 geometryMap m_def = m_assembler.getMap(deformed);
1239 space m_space = m_assembler.trialSpace(0);
1241 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1242 auto mmA = m_assembler.getCoeff(m_mmA);
1244 auto cart2cov = cartcov(m_ori);
1245 auto con2cartI = cartcon(m_ori).inv();
1247 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
1249 element el = m_assembler.getElement();
1250 auto h = (el.area(m_ori.left()) + el.area(m_ori.right())) / 2;
1251 auto alpha_d = m_alpha_d_ifc *
reshape(mmAcart,9,1).max().val() / h;
1253 auto du = ((m_def.left()-m_ori.left()) - (m_def.right()-m_ori.right()));
1256 m_assembler.assembleIfc(m_weakC0,
1257 alpha_d * m_space.left() * m_space.left().tr() *
meas(m_ori)
1259 -alpha_d * m_space.right()* m_space.left() .tr() *
meas(m_ori)
1261 -alpha_d * m_space.left() * m_space.right().tr() *
meas(m_ori)
1263 alpha_d * m_space.right()* m_space.right().tr() *
meas(m_ori)
1269template <
short_t d,
class T,
bool bending>
1270template <
short_t _d,
bool _matrix>
1271typename std::enable_if<!(_d==3) && !_matrix,
void>::type
1272gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl(
const gsFunctionSet<T> & deformed)
1274 geometryMap m_ori = m_assembler.getMap(m_patches);
1275 geometryMap m_def = m_assembler.getMap(deformed);
1277 space m_space = m_assembler.trialSpace(0);
1279 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1280 auto mmA = m_assembler.getCoeff(m_mmA);
1282 auto cart2cov = cartcov(m_ori);
1283 auto con2cartI = cartcon(m_ori).inv();
1285 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
1287 element el = m_assembler.getElement();
1288 auto h = (el.area(m_ori.left()) + el.area(m_ori.right())) / 2;
1289 auto alpha_d = m_alpha_d_ifc *
reshape(mmAcart,9,1).max().val() / h;
1291 auto du = ((m_def.left()-m_ori.left()) - (m_def.right()-m_ori.right()));
1294 m_assembler.assembleIfc(m_weakC0,
1295 alpha_d * m_space.left() * du *
meas(m_ori)
1297 -alpha_d * m_space.right()* du *
meas(m_ori)
1303template<
short_t d,
class T,
bool bending>
1304void gsThinShellAssembler<d, T, bending>::_assembleDirichlet()
1306 this->_getOptions();
1307 space m_space = m_assembler.trialSpace(0);
1309 m_space.setup(m_bcs, dirichlet::l2Projection, m_continuity);
1313template<
short_t d,
class T,
bool bending>
1316 this->_getOptions();
1317 space m_space = m_assembler.trialSpace(0);
1318 m_space.setup(m_bcs, dirichlet::homogeneous, m_continuity);
1323template<
short_t d,
class T,
bool bending>
1329 space m_space = m_assembler.trialSpace(0);
1330 m_mapper = m_space.mapper();
1332 for (
size_t i = 0; i< m_pLoads.numLoads(); ++i )
1334 GISMO_ASSERT(m_pLoads[i].value.size()==d,
"Point load has wrong dimension "<<m_pLoads[i].value.size()<<
" instead of "<<d<<
"\n");
1335 GISMO_ASSERT((
size_t)m_pLoads[i].patch<m_patches.nPatches(),
"Point load is defined on a patch with index "<<m_pLoads[i].patch<<
" while the geometry has "<<m_patches.nPatches()<<
" patches\n");
1337 if ( m_pLoads[i].parametric )
1339 if (
const gsMappedBasis<2,T> * mbasis =
dynamic_cast<const gsMappedBasis<2,T> *
>(m_spaceBasis))
1341 mbasis->active_into(m_pLoads[i].patch,m_pLoads[i].point, acts );
1342 mbasis->eval_into (m_pLoads[i].patch,m_pLoads[i].point, bVals );
1344 else if (
const gsMultiBasis<T> * mbasis =
dynamic_cast<const gsMultiBasis<T> *
>(m_spaceBasis))
1346 mbasis->basis(m_pLoads[i].patch).active_into( m_pLoads[i].point, acts);
1347 mbasis->basis(m_pLoads[i].patch).eval_into ( m_pLoads[i].point, bVals);
1354 gsMatrix<T> forcePoint;
1355 m_patches.patch(m_pLoads[i].patch).invertPoints(m_pLoads[i].point,forcePoint);
1357 if (
const gsMappedBasis<2,T> * mbasis =
dynamic_cast<const gsMappedBasis<2,T> *
>(m_spaceBasis))
1359 mbasis->active_into(m_pLoads[i].patch,forcePoint, acts );
1360 mbasis->eval_into (m_pLoads[i].patch,forcePoint, bVals );
1362 else if (
const gsMultiBasis<T> * mbasis =
dynamic_cast<const gsMultiBasis<T> *
>(m_spaceBasis))
1364 mbasis->basis(m_pLoads[i].patch).active_into( forcePoint, acts);
1365 mbasis->basis(m_pLoads[i].patch).eval_into ( forcePoint, bVals);
1372 for (
size_t j = 0; j< d; ++j)
1374 if (m_pLoads[i].value[j] != 0.0)
1376 m_mapper.localToGlobal(acts, m_pLoads[i].patch, globalActs,j);
1377 for (
index_t k=0; k < globalActs.rows(); ++k)
1379 if (m_mapper.is_free_index(globalActs(k,0)))
1380 m_rhs(globalActs(k,0), 0) += bVals(k,0) * m_pLoads[i].value[j];
1387template<
short_t d,
class T,
bool bending>
1388void gsThinShellAssembler<d, T, bending>::_applyMass()
1391 gsMatrix<index_t> acts,globalActs;
1393 space m_space = m_assembler.trialSpace(0);
1394 m_mapper = m_space.mapper();
1396 GISMO_ASSERT(m_mass.rows()!=0,
"Mass matrix must be assembled first");
1398 for (
size_t i = 0; i< m_pMass.numLoads(); ++i )
1400 GISMO_ASSERT(m_pMass[i].value.size()==1,
"Mass should be one-dimensional");
1403 if ( m_pMass[i].parametric )
1405 m_basis.front().basis(m_pMass[i].patch).active_into( m_pMass[i].point, acts );
1406 m_basis.front().basis(m_pMass[i].patch).eval_into ( m_pMass[i].point, bVals);
1410 gsMatrix<T> forcePoint;
1411 m_patches.patch(m_pMass[i].patch).invertPoints(m_pMass[i].point,forcePoint);
1412 m_basis.front().basis(m_pMass[i].patch).active_into( forcePoint, acts );
1413 m_basis.front().basis(m_pMass[i].patch).eval_into ( forcePoint, bVals);
1417 for (
size_t j = 0; j< d; ++j)
1419 if (m_pMass[i].value[0] != 0.0)
1421 m_mapper.localToGlobal(acts, m_pMass[i].patch, globalActs,j);
1422 for (
index_t k=0; k < globalActs.rows(); ++k)
1424 for (
index_t l=0; l < globalActs.rows(); ++l)
1426 if (m_mapper.is_free_index(globalActs(k,0)) && m_mapper.is_free_index(globalActs(l,0)))
1427 m_mass(globalActs(k,0), globalActs(l,0)) += bVals(k,0) * bVals(l,0) * m_pMass[i].value[0];
1435template<
short_t d,
class T,
bool bending>
1438 m_assembler.cleanUp();
1439 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1440 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1442 geometryMap m_ori = m_assembler.getMap(m_patches);
1445 m_assembler.initSystem();
1447 gsMaterialMatrixIntegrate<T,MaterialOutput::Density> m_mm(m_materialMatrices,&m_patches);
1448 auto mm0 = m_assembler.getCoeff(m_mm);
1450 space m_space = m_assembler.trialSpace(0);
1451 m_space.setup(m_bcs, dirichlet::homogeneous, m_continuity);
1456 pt.setConstant(.25);
1462 m_assembler.assemble(mm0.val()*m_space*m_space.tr()*meas(m_ori));
1464 m_assembler.assemble(mm0.val()*(m_space.rowSum())*meas(m_ori));
1466 m_mass = m_assembler.matrix();
1488 m_assembler.cleanUp();
1495template<
short_t d,
class T,
bool bending>
1498 m_assembler.cleanUp();
1499 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1500 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1502 geometryMap m_ori = m_assembler.getMap(m_patches);
1505 m_assembler.initSystem();
1506 auto m_foundation = m_assembler.getCoeff(*m_foundFun, m_ori);
1507 GISMO_ASSERT(m_foundFun->targetDim()==3,
"Foundation function has dimension "<<m_foundFun->targetDim()<<
", but expected 3");
1509 space m_space = m_assembler.trialSpace(0);
1513 m_assembler.assemble(m_space * m_foundation.asDiag() * m_space.tr() * meas(m_ori));
1518 m_assembler.cleanUp();
1524template<
short_t d,
class T,
bool bending>
1527 return assemble_impl<d, bending>();
1537template <
short_t d,
typename T,
bool bending>
1538template <
short_t _d,
bool _bending>
1542 this->_getOptions();
1544 m_assembler.cleanUp();
1545 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1546 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1550 geometryMap m_ori = m_assembler.getMap(m_patches);
1551 geometryMap m_def = m_assembler.getMap(defpatches);
1554 m_assembler.initSystem();
1555 m_assembler.initVector(1);
1557 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&defpatches);
1558 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixB> m_mmB(m_materialMatrices,&m_patches,&defpatches);
1559 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixC> m_mmC(m_materialMatrices,&m_patches,&defpatches);
1560 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&defpatches);
1561 auto mmA = m_assembler.getCoeff(m_mmA);
1562 auto mmB = m_assembler.getCoeff(m_mmB);
1563 auto mmC = m_assembler.getCoeff(m_mmC);
1564 auto mmD = m_assembler.getCoeff(m_mmD);
1567 auto m_m2 = m_assembler.getCoeff(mult2t);
1569 space m_space = m_assembler.trialSpace(0);
1571 auto m_physforce = m_assembler.getCoeff(*m_forceFun,m_ori);
1572 auto m_parforce = m_assembler.getCoeff(*m_forceFun);
1574 auto m_Em_der = flat( jac(m_def).tr() * jac(m_space) );
1575 auto m_Ef_der = -( deriv2(m_space,sn(m_def).normalized().tr() ) + deriv2(m_def,var1(m_space,m_def) ) ) * reshape(m_m2,3,3);
1577 auto m_N_der = m_Em_der * reshape(mmA,3,3) + m_Ef_der * reshape(mmB,3,3);
1578 auto m_M_der = m_Em_der * reshape(mmC,3,3) + m_Ef_der * reshape(mmD,3,3);
1584 this->_assembleFoundation<true>(*m_foundFun);
1585 this->_assembleFoundation<false>(*m_foundFun);
1589 this->_assemblePressure<true>(*m_pressFun);
1590 this->_assemblePressure<false>(*m_pressFun);
1593 m_assembler.assemble(
1595 m_N_der * m_Em_der.tr()
1597 m_M_der * m_Ef_der.tr()
1601 if (m_parametricForce)
1602 m_assembler.assemble(m_space * m_parforce * meas(m_ori));
1604 m_assembler.assemble(m_space * m_physforce * meas(m_ori));
1606 this->_assembleWeakBCs<true>();
1607 this->_assembleWeakBCs<false>();
1608 this->_assembleWeakIfc<true>();
1609 this->_assembleWeakIfc<false>();
1610 this->_assembleNeumann();
1613 if ( m_pLoads.numLoads() != 0 )
1615 m_rhs = m_assembler.rhs();
1622 m_assembler.cleanUp();
1628template <
short_t d,
typename T,
bool bending>
1629template <
short_t _d,
bool _bending>
1633 this->_getOptions();
1635 m_assembler.cleanUp();
1636 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1637 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1641 geometryMap m_ori = m_assembler.getMap(m_patches);
1642 geometryMap m_def = m_assembler.getMap(defpatches);
1645 m_assembler.initSystem();
1647 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&defpatches);
1648 auto mmA = m_assembler.getCoeff(m_mmA);
1650 space m_space = m_assembler.trialSpace(0);
1651 GISMO_ASSERT(m_parametricForce,
"The force must be defined in the parametric domain for 2D problems");
1652 auto m_parforce = m_assembler.getCoeff(*m_forceFun);
1654 auto jacG = jac(m_def);
1655 auto m_Em_der = flat( jacG.tr() * jac(m_space) ) ;
1656 auto m_N_der = m_Em_der * reshape(mmA,3,3);
1662 this->_assembleFoundation<true>(*m_foundFun);
1663 this->_assembleFoundation<false>(*m_foundFun);
1667 this->_assemblePressure<true>(*m_pressFun);
1668 this->_assemblePressure<false>(*m_pressFun);
1671 m_assembler.assemble(
1673 m_N_der * m_Em_der.tr()
1677 m_assembler.assemble(m_space * m_parforce *
meas(m_ori));
1679 this->_assembleWeakBCs<true>();
1680 this->_assembleWeakBCs<false>();
1681 this->_assembleWeakIfc<true>();
1682 this->_assembleWeakIfc<false>();
1683 this->_assembleNeumann();
1686 if ( m_pLoads.numLoads() != 0 )
1688 m_rhs = m_assembler.rhs();
1696 m_assembler.cleanUp();
1702template<
short_t d,
class T,
bool bending>
1705 return assembleMatrix_impl<d, bending>(deformed);
1708template <
short_t d,
typename T,
bool bending>
1709template <
short_t _d,
bool _bending>
1713 m_assembler.cleanUp();
1714 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1715 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1717 geometryMap m_ori = m_assembler.getMap(m_patches);
1718 geometryMap m_def = m_assembler.getMap(deformed);
1721 m_assembler.initSystem();
1722 m_assembler.initMatrix();
1724 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1725 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixB> m_mmB(m_materialMatrices,&m_patches,&deformed);
1726 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixC> m_mmC(m_materialMatrices,&m_patches,&deformed);
1727 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&deformed);
1728 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
1729 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1(m_materialMatrices,&m_patches,&deformed);
1730 auto mmA = m_assembler.getCoeff(m_mmA);
1731 auto mmB = m_assembler.getCoeff(m_mmB);
1732 auto mmC = m_assembler.getCoeff(m_mmC);
1733 auto mmD = m_assembler.getCoeff(m_mmD);
1734 auto S0 = m_assembler.getCoeff(m_S0);
1735 auto S1 = m_assembler.getCoeff(m_S1);
1738 auto m_m2 = m_assembler.getCoeff(mult2t);
1740 space m_space = m_assembler.trialSpace(0);
1742 this->homogenizeDirichlet();
1745 auto m_Em_der = flat( jac(m_def).tr() * jac(m_space) ) ;
1746 auto m_Em_der2 = flatdot( jac(m_space),jac(m_space).tr(), m_N );
1750 auto m_Ef_der = -( deriv2(m_space,sn(m_def).normalized().tr() ) + deriv2(m_def,var1(m_space,m_def) ) ) * reshape(m_m2,3,3);
1751 auto m_Ef_der2 = -(flatdot2( deriv2(m_space), var1(m_space,m_def).tr(), m_M ).symmetrize()
1752 + var2deriv2(m_space,m_space,m_def, m_M ));
1754 auto m_N_der = m_Em_der * reshape(mmA,3,3) + m_Ef_der * reshape(mmB,3,3);
1755 auto m_M_der = m_Em_der * reshape(mmC,3,3) + m_Ef_der * reshape(mmD,3,3);
1759 if (m_foundInd) this->_assembleFoundation<true>(*m_foundFun,deformed);
1760 if (m_pressInd) this->_assemblePressure<true>(*m_pressFun,deformed);
1763 m_assembler.assemble(
1765 m_N_der * m_Em_der.tr()
1769 m_M_der * m_Ef_der.tr()
1775 this->_assembleWeakBCs<true>(deformed);
1776 this->_assembleWeakIfc<true>(deformed);
1782 m_assembler.cleanUp();
1788template <
short_t d,
typename T,
bool bending>
1789template <
short_t _d,
bool _bending>
1793 m_assembler.cleanUp();
1794 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1795 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1797 geometryMap m_ori = m_assembler.getMap(m_patches);
1798 geometryMap m_def = m_assembler.getMap(deformed);
1801 m_assembler.initSystem();
1802 m_assembler.initMatrix();
1804 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1805 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
1806 auto mmA = m_assembler.getCoeff(m_mmA);
1807 auto S0 = m_assembler.getCoeff(m_S0);
1809 space m_space = m_assembler.trialSpace(0);
1812 this->homogenizeDirichlet();
1815 auto m_Em_der = flat( jac(m_def).tr() * jac(m_space) ) ;
1816 auto m_Em_der2 = flatdot( jac(m_space),jac(m_space).tr(), m_N );
1818 auto m_N_der = m_Em_der * reshape(mmA,3,3);
1823 if (m_foundInd) this->_assembleFoundation<true>(*m_foundFun,deformed);
1824 if (m_pressInd) this->_assemblePressure<true>(*m_pressFun,deformed);
1826 m_assembler.assemble(
1828 m_N_der * m_Em_der.tr()
1833 this->_assembleWeakBCs<true>(deformed);
1834 this->_assembleWeakIfc<true>(deformed);
1840 m_assembler.cleanUp();
1846template<
short_t d,
class T,
bool bending>
1850 constructSolution(solVector, def);
1851 return assembleMatrix(def);
1854template<
short_t d,
class T,
bool bending>
1857 return assembleMatrix_impl<d, bending>(deformed, previous, update);
1860template <
short_t d,
typename T,
bool bending>
1861template <
short_t _d,
bool _bending>
1865 m_assembler.cleanUp();
1866 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1867 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1869 geometryMap m_ori = m_assembler.getMap(m_patches);
1870 geometryMap m_def = m_assembler.getMap(deformed);
1871 geometryMap m_prev = m_assembler.getMap(previous);
1873 m_assembler.initSystem();
1874 m_assembler.initMatrix();
1876 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1877 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixB> m_mmB(m_materialMatrices,&m_patches,&deformed);
1878 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixC> m_mmC(m_materialMatrices,&m_patches,&deformed);
1879 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&deformed);
1880 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
1881 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1(m_materialMatrices,&m_patches,&deformed);
1882 auto mmA = m_assembler.getCoeff(m_mmA);
1883 auto mmB = m_assembler.getCoeff(m_mmB);
1884 auto mmC = m_assembler.getCoeff(m_mmC);
1885 auto mmD = m_assembler.getCoeff(m_mmD);
1889 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmAd(m_materialMatrices,&m_patches,&previous);
1890 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixB> m_mmBd(m_materialMatrices,&m_patches,&previous);
1891 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixC> m_mmCd(m_materialMatrices,&m_patches,&previous);
1892 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmDd(m_materialMatrices,&m_patches,&previous);
1893 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0d(m_materialMatrices,&m_patches,&previous);
1894 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1d(m_materialMatrices,&m_patches,&previous);
1895 auto mmAp = m_assembler.getCoeff(m_mmAd);
1896 auto mmBp = m_assembler.getCoeff(m_mmBd);
1897 auto mmCp = m_assembler.getCoeff(m_mmCd);
1898 auto mmDp = m_assembler.getCoeff(m_mmDd);
1899 auto S0 = m_assembler.getCoeff(m_S0d);
1900 auto S1 = m_assembler.getCoeff(m_S1d);
1903 auto m_m2 = m_assembler.getCoeff(mult2t);
1905 space m_space = m_assembler.trialSpace(0);
1906 solution m_du = m_assembler.getSolution(m_space,update);
1908 this->homogenizeDirichlet();
1910 auto m_E_mc = flat( jac(m_prev).tr() * grad(m_du) ) ;
1911 auto m_E_fc = -( deriv2(m_du,sn(m_prev).normalized().tr() ) + deriv2(m_prev,var1(m_du,m_prev) ) ) * reshape(m_m2,3,3);
1912 auto m_N_c = m_E_mc * reshape(mmAp,3,3) + m_E_fc * reshape(mmBp,3,3);
1913 auto m_M_c = m_E_mc * reshape(mmCp,3,3) + m_E_fc * reshape(mmDp,3,3);
1915 auto m_N = S0.tr() + m_N_c;
1916 auto m_Em_der = flat( jac(m_def).tr() * jac(m_space) ) ;
1917 auto m_Em_der2 = flatdot( jac(m_space),jac(m_space).tr(), m_N );
1919 auto m_M = S1.tr() + m_M_c;
1920 auto m_Ef_der = -( deriv2(m_space,sn(m_def).normalized().tr() ) + deriv2(m_def,var1(m_space,m_def) ) ) * reshape(m_m2,3,3);
1921 auto m_Ef_der2 = -(flatdot2( deriv2(m_space), var1(m_space,m_def).tr(), m_M ).symmetrize()
1922 + var2deriv2(m_space,m_space,m_def, m_M ));
1924 auto m_N_der = m_Em_der * reshape(mmA,3,3) + m_Ef_der * reshape(mmB,3,3);
1925 auto m_M_der = m_Em_der * reshape(mmC,3,3) + m_Ef_der * reshape(mmD,3,3);
1929 if (m_foundInd) this->_assembleFoundation<true>(*m_foundFun,deformed);
1930 if (m_pressInd) this->_assemblePressure<true>(*m_pressFun,deformed);
1933 m_assembler.assemble(
1935 m_N_der * m_Em_der.tr()
1939 m_M_der * m_Ef_der.tr()
1944 this->_assembleWeakBCs<true>(deformed);
1945 this->_assembleWeakIfc<true>(deformed);
1951 m_assembler.cleanUp();
1965template<
short_t d,
class T,
bool bending>
1973 constructSolution(solVector, def);
1974 constructSolution(prevVector, it);
1976 return assembleMatrix(def,it,update);
1979template<
short_t d,
class T,
bool bending>
1982 return assembleVector_impl<d, bending>(deformed,homogenize);
1985template <
short_t d,
typename T,
bool bending>
1986template <
short_t _d,
bool _bending>
1990 m_assembler.cleanUp();
1991 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1992 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1994 geometryMap m_ori = m_assembler.getMap(m_patches);
1995 geometryMap m_def = m_assembler.getMap(deformed);
1998 m_assembler.initVector(1);
2000 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
2001 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1(m_materialMatrices,&m_patches,&deformed);
2002 auto S0 = m_assembler.getCoeff(m_S0);
2003 auto S1 = m_assembler.getCoeff(m_S1);
2006 auto m_m2 = m_assembler.getCoeff(mult2t);
2008 space m_space = m_assembler.trialSpace(0);
2009 auto m_physforce = m_assembler.getCoeff(*m_forceFun,m_ori);
2010 auto m_parforce = m_assembler.getCoeff(*m_forceFun);
2013 if (homogenize) this->homogenizeDirichlet();
2014 else this->_assembleDirichlet();
2017 auto m_Em_der = flat( jac(m_def).tr() * jac(m_space) ) ;
2020 auto m_Ef_der = -( deriv2(m_space,sn(m_def).normalized().tr() ) + deriv2(m_def,var1(m_space,m_def) ) ) * reshape(m_m2,3,3);
2024 if (m_foundInd) this->_assembleFoundation<false>(*m_foundFun,deformed);
2025 if (m_pressInd) this->_assemblePressure<false>(*m_pressFun,deformed);
2029 if (m_parametricForce)
2030 m_assembler.assemble(m_space * m_parforce * meas(m_ori));
2032 m_assembler.assemble(m_space * m_physforce * meas(m_ori));
2035 m_assembler.assemble(
2037 - ( ( m_N * m_Em_der.tr() + m_M * m_Ef_der.tr() ) * meas(m_ori) ).tr()
2041 this->_assembleWeakBCs<false>(deformed);
2042 this->_assembleWeakIfc<false>(deformed);
2043 this->_assembleNeumann();
2046 if ( m_pLoads.numLoads() != 0 )
2048 m_rhs = m_assembler.rhs();
2056 m_assembler.cleanUp();
2062template <
short_t d,
typename T,
bool bending>
2063template <
short_t _d,
bool _bending>
2067 m_assembler.cleanUp();
2068 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2069 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2071 geometryMap m_ori = m_assembler.getMap(m_patches);
2072 geometryMap m_def = m_assembler.getMap(deformed);
2075 m_assembler.initVector(1);
2077 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
2078 auto S0 = m_assembler.getCoeff(m_S0);
2080 space m_space = m_assembler.trialSpace(0);
2081 auto m_physforce = m_assembler.getCoeff(*m_forceFun,m_ori);
2082 auto m_parforce = m_assembler.getCoeff(*m_forceFun);
2084 if (homogenize) this->homogenizeDirichlet();
2085 else this->_assembleDirichlet();
2088 auto m_Em_der = flat( jac(m_def).tr() * jac(m_space) ) ;
2092 if (m_foundInd) this->_assembleFoundation<false>(*m_foundFun,deformed);
2093 if (m_pressInd) this->_assemblePressure<false>(*m_pressFun,deformed);
2097 if (m_parametricForce)
2098 m_assembler.assemble(m_space * m_parforce * meas(m_ori));
2100 m_assembler.assemble(m_space * m_physforce * meas(m_ori));
2103 m_assembler.assemble(
2105 - ( ( m_N * m_Em_der.tr() ) * meas(m_ori) ).tr()
2109 this->_assembleWeakBCs<false>(deformed);
2110 this->_assembleWeakIfc<false>(deformed);
2111 this->_assembleNeumann();
2114 if ( m_pLoads.numLoads() != 0 )
2116 m_rhs = m_assembler.rhs();
2124 m_assembler.cleanUp();
2130template<
short_t d,
class T,
bool bending>
2135 this->_assemblePressure<true>(pressFun);
2145template<
short_t d,
class T,
bool bending>
2151 this->_assemblePressure<true>(pressFun);
2161template<
short_t d,
class T,
bool bending>
2166 this->_assemblePressure<true>(pressFun,deformed);
2176template<
short_t d,
class T,
bool bending>
2182 this->_assemblePressure<true>(pressFun, deformed);
2192template<
short_t d,
class T,
bool bending>
2197 this->_assemblePressure<false>(pressFun);
2207template<
short_t d,
class T,
bool bending>
2213 this->_assemblePressure<false>(pressFun);
2223template<
short_t d,
class T,
bool bending>
2228 this->_assemblePressure<false>(pressFun,deformed);
2238template<
short_t d,
class T,
bool bending>
2244 this->_assemblePressure<false>(pressFun, deformed);
2254template<
short_t d,
class T,
bool bending>
2259 this->assemblePressureVector(*m_pressFun,deformed);
2269template<
short_t d,
class T,
bool bending>
2274 this->assembleFoundationVector(*m_foundFun,deformed);
2284template<
short_t d,
class T,
bool bending>
2289 this->_assembleFoundation<false>(foundFun,deformed);
2299template<
short_t d,
class T,
bool bending>
2302 return boundaryForce_impl<d, bending>(deformed,patchSides);
2305template <
short_t d,
typename T,
bool bending>
2306template <
short_t _d,
bool _bending>
2307typename std::enable_if<(_d==3) && _bending,
gsMatrix<T> >::type
2311 assembler.setIntegrationElements(m_basis);
2312 space u = assembler.getSpace(*m_spaceBasis, d, 0);
2315 u.setup(bc, dirichlet::l2Projection, m_continuity);
2322 std::vector<std::unordered_set<index_t>> indices(d);
2324 for (std::vector<patchSide>::const_iterator bdr = patchSides.begin(); bdr != patchSides.end(); bdr++)
2326 boundary = mbasis->basis(bdr->patch).boundary(bdr->side());
2329 indices[c].insert(u.mapper().index(
boundary.at(k),bdr->patch,c));
2332 assembler.initSystem();
2334 geometryMap m_ori = assembler.getMap(m_patches);
2335 geometryMap m_def = assembler.getMap(deformed);
2340 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
2341 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1(m_materialMatrices,&m_patches,&deformed);
2342 auto S0 = assembler.getCoeff(m_S0);
2343 auto S1 = assembler.getCoeff(m_S1);
2346 auto m_m2 = assembler.getCoeff(mult2t);
2351 auto m_Em_der = flat( jac(m_def).tr() * jac(u) ) ;
2354 auto m_Ef_der = -( deriv2(u,sn(m_def).normalized().tr() ) + deriv2(m_def,var1(u,m_def) ) ) * reshape(m_m2,3,3);
2360 - ( ( m_N * m_Em_der.tr() + m_M * m_Ef_der.tr() ) * meas(m_ori) ).tr()
2365 GISMO_ERROR(
"Assembly of the force vector failed.");
2369 for (
index_t c = 0; c != d; c++)
2370 for (std::unordered_set<index_t>::const_iterator it = indices[c].begin(); it!=indices[c].end(); it++)
2371 F[c] += assembler.rhs().at(*it);
2379template <
short_t d,
typename T,
bool bending>
2380template <
short_t _d,
bool _bending>
2381typename std::enable_if<!(_d==3 && _bending),
gsMatrix<T> >::type
2385 assembler.setIntegrationElements(m_basis);
2386 space u = assembler.getSpace(*m_spaceBasis, d, 0);
2389 u.setup(bc, dirichlet::l2Projection, m_continuity);
2396 std::vector<std::unordered_set<index_t>> indices(d);
2398 for (std::vector<patchSide>::const_iterator bdr = patchSides.begin(); bdr != patchSides.end(); bdr++)
2400 boundary = mbasis->basis(bdr->patch).boundary(bdr->side());
2403 indices[c].insert(u.mapper().index(
boundary.at(k),bdr->patch,c));
2406 assembler.initSystem();
2408 geometryMap m_ori = assembler.getMap(m_patches);
2409 geometryMap m_def = assembler.getMap(deformed);
2414 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
2415 auto S0 = assembler.getCoeff(m_S0);
2420 auto m_Em_der = flat( jac(m_def).tr() * jac(u) ) ;
2426 - ( ( m_N * m_Em_der.tr() ) * meas(m_ori) ).tr()
2431 GISMO_ERROR(
"Assembly of the force vector failed.");
2435 for (
index_t c = 0; c != d; c++)
2436 for (std::unordered_set<index_t>::const_iterator it = indices[c].begin(); it!=indices[c].end(); it++)
2437 F[c] += assembler.rhs().at(*it);
2445template<
short_t d,
class T,
bool bending>
2449 constructSolution(solVector, def);
2450 return assembleVector(def,homogenize);
2453template<
short_t d,
class T,
bool bending>
2455 const bool Matrix,
const bool homogenize)
2460 status = assembleMatrix(deformed);
2465 return assembleVector(deformed,homogenize);
2467template<
short_t d,
class T,
bool bending>
2469 const bool Matrix,
const bool homogenize)
2472 constructSolution(solVector, def);
2473 return assemble(def,Matrix,homogenize);
2476template <
short_t d,
class T,
bool bending>
2481 for (
size_t k =0; k!=displacement.
nPatches(); ++k)
2482 mp.patch(k).coefs() += displacement.
patch(k).coefs();;
2487template <
short_t d,
class T,
bool bending>
2490 return _constructSolution(solVector,m_patches);
2493template <
short_t d,
class T,
bool bending>
2496 deformed = _constructSolution(solVector,m_patches);
2499template <
short_t d,
class T,
bool bending>
2502 mp = _constructSolution(solVector,mp);
2505template<
short_t d,
class T,
bool bending>
2508 m_assembler.cleanUp();
2509 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2510 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2512 geometryMap G = m_assembler.getMap(geometry);
2515 T result = evaluator.
integral(meas(G));
2519template<
short_t d,
class T,
bool bending>
2522 m_assembler.cleanUp();
2523 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2524 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2526 geometryMap m_ori = m_assembler.getMap(m_patches);
2527 geometryMap m_def = m_assembler.getMap(deformed);
2529 auto u = m_def - m_ori;
2532 T result = evaluator.
integral( u.tr() * u * meas(m_def));
2533 T area = evaluator.
integral(meas(m_ori));
2535 return std::pow(result/area,0.5);
2538template<
short_t d,
class T,
bool bending>
2541 m_assembler.cleanUp();
2542 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2543 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2545 geometryMap m_ori = m_assembler.getMap(m_patches);
2546 geometryMap m_def = m_assembler.getMap(deformed);
2548 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&deformed);
2549 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1(m_materialMatrices,&deformed);
2550 auto S0 = m_assembler.getCoeff(m_S0);
2551 auto S1 = m_assembler.getCoeff(m_S1);
2552 auto u = m_def - m_ori;
2558 T result = evaluator.
integral(0.5 * ( u.tr() * ( m_N + m_M ).tr() ) * meas(m_def));
2562template<
short_t d,
class T,
bool bending>
2565 m_solvector = solVector;
2566 space m_space = m_assembler.trialSpace(0);
2567 solution m_solution = m_assembler.getSolution(m_space, m_solvector);
2568 geometryMap G = m_assembler.getMap(m_patches);
2570 ev.options().
setSwitch(
"plot.elements",
false);
2571 ev.options().
setInt (
"plot.npts" , 500);
2575template<
short_t d,
class T,
bool bending>
2578 geometryMap G = m_assembler.getMap(deformed);
2580 ev.integralInterface( ( G.left() - G.right() ).sqNorm() , iFaces);
2585template<
short_t d,
class T,
bool bending>
2588 geometryMap G = m_assembler.getMap(deformed);
2589 gsExprEvaluator<T> ev(m_assembler);
2590 ev.integralInterface( (sn(G.left()).normalized()-sn(G.right()).normalized()).sqNorm() , iFaces);
2595template<
short_t d,
class T,
bool bending>
2598 geometryMap G = m_assembler.getMap(deformed);
2599 gsExprEvaluator<T> ev(m_assembler);
2600 ev.maxInterface( (sn(G.left())-sn(G.right())).norm() , iFaces);
2604template<
short_t d,
class T,
bool bending>
2607 geometryMap G = m_assembler.getMap(deformed);
2608 gsExprEvaluator<T> ev(m_assembler);
2609 ev.maxInterface(
abs( (fform(G.left() ).inv()*
fform2nd(G.left() )).det() -
2610 (fform(G.right()).inv()*
fform2nd(G.right())).det() ) , iFaces);
2613template<
short_t d,
class T,
bool bending>
2616 geometryMap G = m_assembler.getMap(deformed);
2617 gsExprEvaluator<T> ev(m_assembler);
2618 ev.maxInterface(
abs( (fform(G.left() ).inv()*
fform2nd(G.left() )).trace().val() -
2619 (fform(G.right()).inv()*
fform2nd(G.right())).trace().val() ) , iFaces);
2622template<
short_t d,
class T,
bool bending>
2625 m_solvector = solVector;
2626 space m_space = m_assembler.trialSpace(0);
2627 m_space.setup(m_bcs, dirichlet::l2Projection, m_continuity);
2630 if (
const gsMappedBasis<2,T> * mbasis =
dynamic_cast<const gsMappedBasis<2,T> *
>(m_spaceBasis))
2633 const index_t dim = m_space.dim();
2634 GISMO_ASSERT(
static_cast<size_t>(dim*mbasis->size())==m_mapper.mapSize(),
"Something is wrong in the sizes, basis size = "<<mbasis->size()<<
" mapper size = "<<m_mapper.mapSize());
2640 for (
index_t p =0; p!=m_patches.nPieces(); ++p)
2642 for (
index_t c = 0; c!=dim; c++)
2645 for (
size_t i = 0; i < m_mapper.patchSize(p,c); ++i)
2647 const index_t ii = m_mapper.index(i, p, c);
2648 if ( m_mapper.is_free_index(ii) )
2649 cc(i,c) = m_solvector.
at(ii);
2652 cc(i,c) = m_ddofs.
at( m_mapper.global_to_bindex(ii) );
2659 mbasis->global_coef_to_local_coef(cc,tmp);
2660 return mbasis->exportToPatches(tmp);
2666 solution m_solution = m_assembler.getSolution(m_space, m_solvector);
2669 for (
index_t p =0; p!=m_patches.nPieces(); ++p)
2671 m_solution.extract(cc, p);
2672 result.
addPatch(m_basis.basis(p).makeGeometry(
give(cc) ));
2678template<
short_t d,
class T,
bool bending>
2681 return constructMultiPatch(solVector);
2684template<
short_t d,
class T,
bool bending>
2688 space m_space = m_assembler.trialSpace(0);
2689 m_space.setup(m_bcs, dirichlet::l2Projection, m_continuity);
2690 solution m_solution = m_assembler.getSolution(m_space, solVector);
2692 m_solution.extractFull(result);
2693 return result.col(0);
2696template<
short_t d,
class T,
bool bending>
2701 for (
size_t p=0; p!=displacements.
nPatches(); p++)
2703 for (
size_t dim = 0; dim!=d; dim++)
2705 for (
size_t k=0; k!=m_mapper.patchSize(p,dim); k++)
2707 if (m_mapper.is_free(k,p,dim))
2709 result.
at(m_mapper.index(k,p,dim)) = displacements.
patch(p).coefs()(k,dim);
2718template<
short_t d,
class T,
bool bending>
2721 deformed = constructDisplacement(solVector);
2732template<
short_t d,
class T,
bool bending>
2742 this->_getOptions();
2744 m_assembler.cleanUp();
2745 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2746 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2752 gsMaterialMatrixEval<T,MaterialOutput::Stretch> m_mm(m_materialMatrices,&deformed,zmat);
2753 auto mm0 = m_assembler.getCoeff(m_mm);
2757 for (
index_t k = 0; k != u.cols(); ++k)
2758 result.col(k) = evaluator.
eval(mm0,u.col(k));
2762template <
short_t d,
class T,
bool bending>
2772 this->_getOptions();
2774 m_assembler.cleanUp();
2775 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2776 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2782 gsMaterialMatrixEval<T,MaterialOutput::PStress> m_mm(m_materialMatrices,&deformed,zmat);
2783 auto mm0 = m_assembler.getCoeff(m_mm);
2787 for (
index_t k = 0; k != u.cols(); ++k)
2789 result.col(k) = evaluator.
eval(mm0,u.col(k));
2794template<
short_t d,
class T,
bool bending>
2799 constructStress(m_patches,deformed,result,type);
2802template<
short_t d,
class T,
bool bending>
2811 for (
size_t p = 0; p < m_patches.nPatches(); ++p )
2831template<
short_t d,
class T,
bool bending>
2859template<
short_t d,
class T,
bool bending>
2868 space m_space = m_assembler.trialSpace(0);
2869 m_space.setup(m_bcs, dirichlet::l2Projection, m_continuity);
2872 solution m_solution = m_assembler.getSolution(m_space, tmp);
2875 for (
size_t k =0; k!=mp.nPatches(); ++k)
2878 m_solution.extract(cc, k);
2879 mp.patch(k).coefs() += cc;
2884template<
short_t d,
class T,
bool bending>
2890 this->projectL2_into(fun,result);
2894template <
short_t d,
class T,
bool bending>
2897 m_assembler.cleanUp();
2898 m_assembler.setOptions(m_options);
2900 geometryMap ori = m_assembler.getMap(original);
2901 geometryMap def = m_assembler.getMap(deformed);
2904 T result = evaluator.
integral(def.sqNorm() * meas(ori));
2908template<
short_t d,
class T,
bool bending>
2911 geometryMap m_ori = m_assembler.getMap(m_patches);
2917 for (gsBoxTopology::const_iiterator it = m_patches.topology().iBegin(); it!=m_patches.topology().iEnd(); it++)
2920 ev.integralInterface( (sn(m_ori.left()).normalized()-sn(m_ori.right()).normalized()).sqNorm() );
2927 if (ev.value() < tol)
2928 m_inPlane.push_back(*it);
2930 m_outPlane.push_back(*it);
2934template<
short_t d,
class T,
bool bending>
2935bool gsThinShellAssembler<d, T, bending>::_isInPlane(
const boundaryInterface & ,
const T tol)
2937 geometryMap m_ori = m_assembler.getMap(m_patches);
2938 gsExprEvaluator<T> ev(m_assembler);
2941 ev.integralInterface( (sn(m_ori.left()).normalized()-sn(m_ori.right()).normalized()).sqNorm() );
2948 return (ev.value() < tol);
Definition gsExpressions.h:973
Class containing a set of boundary conditions.
Definition gsBoundaryConditions.h:342
Class defining a globally constant function.
Definition gsConstantFunction.h:34
Definition gsExprAssembler.h:33
Generic evaluator of isogeometric expressions.
Definition gsExprEvaluator.h:39
T integral(const expr::_expr< E > &expr)
Calculates the integral of the expression expr on the whole integration domain.
Definition gsExprEvaluator.h:154
void eval(const expr::_expr< E > &expr, gsGridIterator< T, mode, d > &git, const index_t patchInd=0)
void writeParaview(const expr::_expr< E > &expr, geometryMap G, std::string const &fn)
Creates a paraview file named fn containing valies of the.
Definition gsExprEvaluator.h:342
Class defining a multivariate (real or vector) function given by a string mathematical expression.
Definition gsFunctionExpr.h:52
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition gsFunctionSet.h:219
virtual short_t domainDim() const =0
Dimension of the (source) domain.
A function from a n-dimensional domain to an m-dimensional image.
Definition gsFunction.h:60
This class defines the base class for material matrices.
Definition gsMaterialMatrixBase.h:33
memory::unique_ptr< gsMaterialMatrixBase > uPtr
Unique pointer for gsGeometry.
Definition gsMaterialMatrixBase.h:44
This class serves as the evaluator of material matrices, based on gsMaterialMatrixBase.
Definition gsMaterialMatrixContainer.h:34
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
T at(index_t i) const
Returns the i-th element of the vectorization of the matrix.
Definition gsMatrix.h:211
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
gsGeometry< T > & patch(size_t i) const
Return the i-th patch.
Definition gsMultiPatch.h:292
index_t addPatch(typename gsGeometry< T >::uPtr g)
Add a patch from a gsGeometry<T>::uPtr.
Definition gsMultiPatch.hpp:211
size_t nPatches() const
Number of patches.
Definition gsMultiPatch.h:274
Class which holds a list of parameters/options, and provides easy access to them.
Definition gsOptionList.h:33
void update(const gsOptionList &other, updateType type=ignoreIfUnknown)
Updates the object using the data from other.
Definition gsOptionList.cpp:253
void setInt(const std::string &label, const index_t &value)
Sets an existing option label to be equal to value.
Definition gsOptionList.cpp:158
gsOptionList wrapIntoGroup(const std::string &gn) const
Creates a new gsOptionList where all labels are wrapped into a groupname gn.
Definition gsOptionList.cpp:284
void setSwitch(const std::string &label, const bool &value)
Sets an existing option label to be equal to value.
Definition gsOptionList.cpp:174
A function depending on an index i, typically referring to a patch/sub-domain. On each patch a differ...
Definition gsPiecewiseFunction.h:29
void clear()
Clear (delete) all functions.
Definition gsPiecewiseFunction.h:148
Compute Cauchy stresses for a previously computed/defined displacement field. Can be pushed into gsPi...
Definition gsThinShellFunctions.h:79
Assembles the system matrix and vectors for 2D and 3D shell problems, including geometric nonlinearit...
Definition gsThinShellAssembler.h:77
gsThinShellAssembler & operator=(const gsThinShellAssembler &other)
Assignment operator.
Definition gsThinShellAssembler.hpp:99
gsMatrix< T > boundaryForce(const gsFunctionSet< T > &deformed, const std::vector< patchSide > &patchSides) const
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2300
ThinShellAssemblerStatus assembleFoundationVector(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2270
void setOptions(gsOptionList &options)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:229
T getDisplacementNorm(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2520
gsMultiPatch< T > constructDisplacement(const gsMatrix< T > &solVector) const
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2679
void _initialize()
Initializes the method.
Definition gsThinShellAssembler.hpp:243
T deformationNorm(const gsMultiPatch< T > &deformed, const gsMultiPatch< T > &original)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2895
gsThinShellAssembler()
Constructor for te shell assembler.
Definition gsThinShellAssembler.h:134
gsMatrix< T > computePrincipalStresses(const gsMatrix< T > &points, const gsFunctionSet< T > &deformed, const T z=0)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2763
ThinShellAssemblerStatus assembleVector(const gsFunctionSet< T > &deformed, const bool homogenize=true)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:1980
void plotSolution(std::string string, const gsMatrix< T > &solVector)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2563
T interfaceErrorNormal(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.h:485
T getArea(const gsFunctionSet< T > &geometry)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2506
T interfaceErrorG1(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.h:480
ThinShellAssemblerStatus assemblePressureVector(const gsFunction< T > &pressFun)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2193
T getElasticEnergy(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2539
ThinShellAssemblerStatus assemble()
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:1525
ThinShellAssemblerStatus assembleMass(const bool lumped=false)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:1436
void constructStress(const gsFunctionSet< T > &deformed, gsPiecewiseFunction< T > &result, stress_type::type type)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2795
gsMatrix< T > fullSolutionVector(const gsMatrix< T > &vector) const
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2685
ThinShellAssemblerStatus assembleMatrix(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:1703
T interfaceErrorGaussCurvature(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.h:490
gsMultiPatch< T > constructSolution(const gsMatrix< T > &solVector) const
Construct deformed shell geometry from computed solution vector solVector and returns a multipatch.
Definition gsThinShellAssembler.hpp:2488
void projectL2_into(const gsFunction< T > &fun, gsMatrix< T > &result)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2832
gsMultiPatch< T > constructMultiPatch(const gsMatrix< T > &solVector) const
Construct solution field from computed solution vector solVector and returns a multipatch.
Definition gsThinShellAssembler.hpp:2623
ThinShellAssemblerStatus assembleFoundation()
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:1496
T interfaceErrorMeanCurvature(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.h:495
gsVector< T > constructSolutionVector(const gsMultiPatch< T > &deformed) const
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2697
T interfaceErrorC0(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.h:475
gsMatrix< T > projectL2(const gsFunction< T > &fun)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2885
gsMultiPatch< T > _constructSolution(const gsMatrix< T > &solVector, const gsMultiPatch< T > &undeformed) const
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2477
void homogenizeDirichlet()
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:1314
ThinShellAssemblerStatus assemblePressureMatrix(const gsFunction< T > &pressFun)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2131
gsMatrix< T > computePrincipalStretches(const gsMatrix< T > &points, const gsFunctionSet< T > &deformed, const T z=0)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2733
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
T at(index_t i) const
Returns the i-th element of the vector.
Definition gsVector.h:177
Provides gsBoundaryConditions class.
#define index_t
Definition gsConfig.h:32
Provides declaration of ConstantFunction class.
#define GISMO_ERROR(message)
Definition gsDebug.h:118
#define GISMO_ENSURE(cond, message)
Definition gsDebug.h:102
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
Provides declaration of FunctionExpr class.
Provides a base class for material matrices.
Provides an evaluator for material matrices for thin shells.
Provides an evaluator for material matrices for thin shells.
Provides declaration of a gsPiecewiseFunction class.
Provides linear and nonlinear assemblers for thin shells.
EIGEN_STRONG_INLINE reshape_expr< E > const reshape(E const &u, index_t n, index_t m)
Reshape an expression.
Definition gsExpressions.h:1925
EIGEN_STRONG_INLINE abs_expr< E > abs(const E &u)
Absolute value.
Definition gsExpressions.h:4486
EIGEN_STRONG_INLINE fform2nd_expr< T > fform2nd(const gsGeometryMap< T > &G)
The second fundamental form of G.
Definition gsExpressions.h:4523
EIGEN_STRONG_INLINE meas_expr< T > meas(const gsGeometryMap< T > &G)
The measure of a geometry map.
Definition gsExpressions.h:4555
EIGEN_STRONG_INLINE onormal_expr< T > nv(const gsGeometryMap< T > &u)
The (outer pointing) boundary normal of a geometry map.
Definition gsExpressions.h:4506
The G+Smo namespace, containing all definitions for the library.
ThinShellAssemblerStatus
Definition gsThinShellAssembler.h:54
@ Success
Assembly is successful.
@ AssemblyError
Assembly failed due to an error in the expression (e.g. overflow)
S give(S &x)
Definition gsMemory.h:266
Struct that defines the boundary sides and corners and types of a geometric object.
Definition gsBoundary.h:56
type
Definition gsThinShellFunctions.h:39