33 #include <unordered_set>
38 template<
short_t d,
class T,
bool bending>
48 m_spaceBasis(&m_basis),
50 m_forceFun(&surface_force),
51 m_materialMatrices(materialMatrices)
53 this->_defaultOptions();
58 template<
short_t d,
class T,
bool bending>
70 m_forceFun(&surface_force)
73 GISMO_ASSERT(materialMatrix!=
nullptr,
"Material matrix is incomplete!");
74 GISMO_ASSERT(materialMatrix->initialized(),
"Material matrix is incomplete!");
75 for (
size_t p=0; p!=m_patches.nPatches(); p++)
76 m_materialMatrices.set(p,materialMatrix);
78 this->_defaultOptions();
83 template<
short_t d,
class T,
bool bending>
88 m_mapper=other.m_mapper;
89 m_assembler=other.m_assembler;
90 m_evaluator=other.m_evaluator;
91 m_patches=other.m_patches;
92 m_itpatches=other.m_itpatches;
93 m_basis=other.m_basis;
94 m_spaceBasis=other.m_spaceBasis;
96 m_ddofs=other.m_ddofs;
98 m_forceFun=other.m_forceFun;
99 m_foundFun=other.m_foundFun;
100 m_pressFun=other.m_pressFun;
101 m_materialMatrices=other.m_materialMatrices;
102 m_pLoads=other.m_pLoads;
103 m_pMass=other.m_pMass;
104 m_solvector=other.m_solvector;
106 m_options=other.m_options;
107 m_foundInd=other.m_foundInd;
108 m_pressInd=other.m_pressInd;
109 m_continuity=other.m_continuity;
110 m_alpha_d_bc=other.m_alpha_d_bc;
111 m_alpha_r_bc=other.m_alpha_r_bc;
112 m_alpha_d_ifc=other.m_alpha_d_ifc;
113 m_alpha_r_ifc=other.m_alpha_r_ifc;
114 m_IfcDefault=other.m_IfcDefault;
115 m_inPlane=other.m_inPlane;
116 m_outPlane=other.m_outPlane;
117 m_uncoupled=other.m_uncoupled;
118 m_strongC0=other.m_strongC0;
119 m_weakC0=other.m_weakC0;
120 m_strongC1=other.m_strongC1;
121 m_weakC1=other.m_weakC1;
122 m_unassigned=other.m_unassigned;
125 m_assembler.setIntegrationElements(m_basis);
126 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
127 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
132 template<
short_t d,
class T,
bool bending>
135 m_mapper=
give(other.m_mapper);
136 m_assembler=
give(other.m_assembler);
137 m_evaluator=
give(other.m_evaluator);
138 m_patches=
give(other.m_patches);
139 m_itpatches=
give(other.m_itpatches);
140 m_basis=
give(other.m_basis);
141 m_spaceBasis=
give(other.m_spaceBasis);
142 m_bcs=
give(other.m_bcs);
143 m_ddofs=
give(other.m_ddofs);
144 m_mass=
give(other.m_mass);
145 m_forceFun=
give(other.m_forceFun);
146 m_foundFun=
give(other.m_foundFun);
147 m_pressFun=
give(other.m_pressFun);
148 m_materialMatrices=
give(other.m_materialMatrices);
149 m_pLoads=
give(other.m_pLoads);
150 m_pMass=
give(other.m_pMass);
151 m_solvector=
give(other.m_solvector);
152 m_rhs=
give(other.m_rhs);
153 m_options=
give(other.m_options);
154 m_foundInd=
give(other.m_foundInd);
155 m_pressInd=
give(other.m_pressInd);
156 m_continuity=
give(other.m_continuity);
157 m_alpha_d_bc=
give(other.m_alpha_d_bc);
158 m_alpha_r_bc=
give(other.m_alpha_r_bc);
159 m_alpha_d_ifc=
give(other.m_alpha_d_ifc);
160 m_alpha_r_ifc=
give(other.m_alpha_r_ifc);
161 m_IfcDefault=
give(other.m_IfcDefault);
162 m_inPlane=
give(other.m_inPlane);
163 m_outPlane=
give(other.m_outPlane);
164 m_uncoupled=
give(other.m_uncoupled);
165 m_strongC0=
give(other.m_strongC0);
166 m_weakC0=
give(other.m_weakC0);
167 m_strongC1=
give(other.m_strongC1);
168 m_weakC1=
give(other.m_weakC1);
169 m_unassigned=
give(other.m_unassigned);
171 m_assembler.setIntegrationElements(m_basis);
172 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
173 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
177 template<
short_t d,
class T,
bool bending>
180 m_options.addReal(
"WeakDirichlet",
"Penalty parameter weak dirichlet conditions",1e3);
181 m_options.addReal(
"WeakClamped",
"Penalty parameter weak clamped conditions",1e3);
182 m_options.addInt(
"Continuity",
"Set the continuity for the space",-1);
184 m_options.addReal(
"IfcPenalty",
"Penalty parameter weak coupling conditions on the interface",1e3);
185 m_options.addInt(
"IfcDefault",
"Default weak(!) interface coupling; C^k, k={-1,0,1}",1);
186 m_options.addString(
"Solver",
"Sparse linear solver",
"CGDiagonal");
190 m_options.
update(assemblerOptions,gsOptionList::addIfUnknown);
196 template <
short_t d,
class T,
bool bending>
197 void gsThinShellAssembler<d, T, bending>::_getOptions()
200 index_t continuity = m_continuity;
201 m_continuity = m_options.getInt(
"Continuity");
202 if (continuity != m_options.getInt(
"Continuity"))
205 m_alpha_d_bc = m_options.getReal(
"WeakDirichlet");
206 m_alpha_r_bc = m_options.getReal(
"WeakClamped");
207 m_alpha_d_ifc = m_alpha_r_ifc = m_options.getReal(
"IfcPenalty");
208 m_IfcDefault = m_options.getInt(
"IfcDefault");
211 template<
short_t d,
class T,
bool bending>
216 index_t continuity = m_options.getInt(
"Continuity");
218 m_options.update(options,gsOptionList::ignoreIfUnknown);
221 if (continuity != m_options.getInt(
"Continuity"))
225 template<
short_t d,
class T,
bool bending>
231 m_assembler.setIntegrationElements(m_basis);
232 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
233 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
235 GISMO_ASSERT(m_bcs.hasGeoMap(),
"No geometry map was assigned to the boundary conditions. Use bc.setGeoMap to assign one!");
242 space m_space = m_assembler.getSpace(*m_spaceBasis, d, 0);
244 this->_assembleDirichlet();
246 m_ddofs = m_space.fixedPart();
247 m_mapper = m_space.mapper();
254 GISMO_ASSERT(m_forceFun->targetDim()==d,
"Force must have " << d<<
" dimensions but has "<<m_forceFun->targetDim());
264 template<
short_t d,
class T,
bool bending>
267 m_strongC0 = interfaces;
270 template<
short_t d,
class T,
bool bending>
271 void gsThinShellAssembler<d, T, bending>::addStrongC1(
const gsBoxTopology::ifContainer & interfaces)
273 m_strongC1 = interfaces;
276 template<
short_t d,
class T,
bool bending>
277 void gsThinShellAssembler<d, T, bending>::addWeakC0(
const gsBoxTopology::ifContainer & interfaces)
279 m_weakC0 = interfaces;
282 template<
short_t d,
class T,
bool bending>
283 void gsThinShellAssembler<d, T, bending>::addWeakC1(
const gsBoxTopology::ifContainer & interfaces)
285 m_weakC1 = interfaces;
288 template<
short_t d,
class T,
bool bending>
289 void gsThinShellAssembler<d, T, bending>::addUncoupled(
const gsBoxTopology::ifContainer & interfaces)
291 m_uncoupled = interfaces;
294 template<
short_t d,
class T,
bool bending>
295 void gsThinShellAssembler<d, T, bending>::initInterfaces()
299 for (gsBoxTopology::const_iiterator it = m_patches.topology().iBegin(); it!=m_patches.topology().iEnd(); it++)
302 std::find(m_strongC0.begin(), m_strongC0.end(), *it) == m_strongC0.end()
303 && std::find(m_strongC1.begin(), m_strongC1.end(), *it) == m_strongC1.end()
304 && std::find(m_weakC0.begin(), m_weakC0.end(), *it) == m_weakC0.end()
305 && std::find(m_weakC1.begin(), m_weakC1.end(), *it) == m_weakC1.end()
306 && std::find(m_uncoupled.begin(), m_uncoupled.end(), *it) == m_uncoupled.end()
309 if (m_IfcDefault==-1)
311 else if (m_IfcDefault==0)
312 m_weakC0.push_back(*it);
313 else if (m_IfcDefault==1)
314 m_weakC1.push_back(*it);
323 template<
short_t d,
class T,
bool bending>
324 void gsThinShellAssembler<d, T, bending>::_assembleNeumann()
326 _assembleNeumann_impl<d>();
329 template <
short_t d,
class T,
bool bending>
330 template <
short_t _d>
331 typename std::enable_if<(_d==3), void>::type
332 gsThinShellAssembler<d, T, bending>::_assembleNeumann_impl()
334 geometryMap m_ori = m_assembler.getMap(m_patches);
336 space m_space = m_assembler.trialSpace(0);
337 auto g_N = m_assembler.getBdrFunction(m_ori);
338 m_assembler.assembleBdr(m_bcs.get(
"Neumann"),m_space * g_N *
meas(m_ori));
341 template <
short_t d,
class T,
bool bending>
342 template <
short_t _d>
343 typename std::enable_if<!(_d==3), void>::type
344 gsThinShellAssembler<d, T, bending>::_assembleNeumann_impl()
346 geometryMap m_ori = m_assembler.getMap(m_patches);
348 space m_space = m_assembler.trialSpace(0);
349 auto g_N = m_assembler.getBdrFunction(m_ori);
350 m_assembler.assembleBdr(m_bcs.get(
"Neumann"), m_space * g_N *
meas(m_ori));
353 template<
short_t d,
class T,
bool bending>
354 template<
bool _matrix>
355 void gsThinShellAssembler<d, T, bending>::_assemblePressure(
const gsFunction<T> & pressFun)
358 _assemblePressure_impl<d,_matrix>(pressFun);
361 template <
short_t d,
class T,
bool bending>
362 template <
short_t _d,
bool matrix>
363 typename std::enable_if<(_d==3) && matrix, void>::type
364 gsThinShellAssembler<d, T, bending>::_assemblePressure_impl(
const gsFunction<T> &)
369 template <
short_t d,
class T,
bool bending>
370 template <
short_t _d,
bool _matrix>
371 typename std::enable_if<(_d==3) && !_matrix, void>::type
372 gsThinShellAssembler<d, T, bending>::_assemblePressure_impl(
const gsFunction<T> & pressFun)
374 gsMultiPatch<T> & defpatches = m_patches;
375 geometryMap m_ori = m_assembler.getMap(m_patches);
376 geometryMap m_def = m_assembler.getMap(defpatches);
378 space m_space = m_assembler.trialSpace(0);
380 auto m_pressure = m_assembler.getCoeff(pressFun, m_ori);
381 GISMO_ASSERT(pressFun.targetDim()==1,
"Pressure function has dimension "<<pressFun.targetDim()<<
", but expected 1");
383 m_assembler.assemble(
384 m_pressure.val() * m_space * usn(m_def) *
meas(m_ori)
388 template <
short_t d,
class T,
bool bending>
389 template <
short_t _d,
bool _matrix>
390 typename std::enable_if<!(_d==3), void>::type
391 gsThinShellAssembler<d, T, bending>::_assemblePressure_impl(
const gsFunction<T> &)
396 template<
short_t d,
class T,
bool bending>
397 template<
bool _matrix>
398 void gsThinShellAssembler<d, T, bending>::_assemblePressure(
const gsFunction<T> & pressFun,
const gsFunctionSet<T> & deformed)
401 _assemblePressure_impl<d,_matrix>(pressFun,deformed);
404 template <
short_t d,
class T,
bool bending>
405 template <
short_t _d,
bool matrix>
406 typename std::enable_if<(_d==3) && matrix, void>::type
407 gsThinShellAssembler<d, T, bending>::_assemblePressure_impl(
const gsFunction<T> & pressFun,
const gsFunctionSet<T> & deformed)
409 geometryMap m_ori = m_assembler.getMap(m_patches);
410 geometryMap m_def = m_assembler.getMap(deformed);
412 space m_space = m_assembler.trialSpace(0);
414 auto m_pressure = m_assembler.getCoeff(pressFun, m_ori);
415 GISMO_ASSERT(pressFun.targetDim()==1,
"Pressure function has dimension "<<pressFun.targetDim()<<
", but expected 1");
417 m_assembler.assemble(
418 -m_pressure.val() * m_space * var1(m_space,m_def).tr()*
meas(m_ori)
423 template <
short_t d,
class T,
bool bending>
424 template <
short_t _d,
bool _matrix>
425 typename std::enable_if<(_d==3) && !_matrix, void>::type
426 gsThinShellAssembler<d, T, bending>::_assemblePressure_impl(
const gsFunction<T> & pressFun,
const gsFunctionSet<T> & deformed)
428 geometryMap m_ori = m_assembler.getMap(m_patches);
429 geometryMap m_def = m_assembler.getMap(deformed);
431 space m_space = m_assembler.trialSpace(0);
433 auto m_pressure = m_assembler.getCoeff(pressFun, m_ori);
434 GISMO_ASSERT(pressFun.targetDim()==1,
"Pressure function has dimension "<<pressFun.targetDim()<<
", but expected 1");
437 m_assembler.assemble(
438 m_pressure.val() * m_space * sn(m_def).normalized() *
meas(m_ori)
442 template <
short_t d,
class T,
bool bending>
443 template <
short_t _d,
bool _matrix>
444 typename std::enable_if<!(_d==3), void>::type
445 gsThinShellAssembler<d, T, bending>::_assemblePressure_impl(
const gsFunction<T> & ,
const gsFunctionSet<T> & )
450 template<
short_t d,
class T,
bool bending>
451 template<
bool _matrix>
452 void gsThinShellAssembler<d, T, bending>::_assembleFoundation(
const gsFunction<T> & foundFun)
455 _assembleFoundation_impl<d,_matrix>(foundFun);
458 template <
short_t d,
class T,
bool bending>
459 template <
short_t _d,
bool _matrix>
460 typename std::enable_if<(_d==3) && _matrix, void>::type
461 gsThinShellAssembler<d, T, bending>::_assembleFoundation_impl(
const gsFunction<T> & foundFun)
466 template <
short_t d,
class T,
bool bending>
467 template <
short_t _d,
bool _matrix>
468 typename std::enable_if<(_d==3) && !_matrix, void>::type
469 gsThinShellAssembler<d, T, bending>::_assembleFoundation_impl(
const gsFunction<T> & foundFun)
471 geometryMap m_ori = m_assembler.getMap(m_patches);
473 space m_space = m_assembler.trialSpace(0);
475 auto m_foundation = m_assembler.getCoeff(foundFun, m_ori);
476 GISMO_ASSERT(foundFun.targetDim()==3,
"Foundation function has dimension "<<foundFun.targetDim()<<
", but expected 3");
478 m_assembler.assemble(
479 m_space * m_foundation.asDiag() * m_space.tr() *
meas(m_ori)
483 template <
short_t d,
class T,
bool bending>
484 template <
short_t _d,
bool _matrix>
485 typename std::enable_if<!(_d==3), void>::type
486 gsThinShellAssembler<d, T, bending>::_assembleFoundation_impl(
const gsFunction<T> & )
491 template<
short_t d,
class T,
bool bending>
492 template<
bool _matrix>
493 void gsThinShellAssembler<d, T, bending>::_assembleFoundation(
const gsFunction<T> & foundFun,
const gsFunctionSet<T> & deformed)
496 _assembleFoundation_impl<d,_matrix>(foundFun,deformed);
499 template <
short_t d,
class T,
bool bending>
500 template <
short_t _d,
bool matrix>
501 typename std::enable_if<(_d==3) && matrix, void>::type
502 gsThinShellAssembler<d, T, bending>::_assembleFoundation_impl(
const gsFunction<T> & foundFun,
const gsFunctionSet<T> & deformed)
504 geometryMap m_ori = m_assembler.getMap(m_patches);
506 space m_space = m_assembler.trialSpace(0);
508 auto m_foundation = m_assembler.getCoeff(foundFun, m_ori);
509 GISMO_ASSERT(foundFun.targetDim()==3,
"Foundation function has dimension "<<foundFun.targetDim()<<
", but expected 3");
511 m_assembler.assemble(
512 m_space * m_foundation.asDiag() * m_space.tr() *
meas(m_ori)
516 template <
short_t d,
class T,
bool bending>
517 template <
short_t _d,
bool _matrix>
518 typename std::enable_if<(_d==3) && !_matrix, void>::type
519 gsThinShellAssembler<d, T, bending>::_assembleFoundation_impl(
const gsFunction<T> & foundFun,
const gsFunctionSet<T> & deformed)
521 geometryMap m_ori = m_assembler.getMap(m_patches);
522 geometryMap m_def = m_assembler.getMap(deformed);
524 space m_space = m_assembler.trialSpace(0);
526 auto m_foundation = m_assembler.getCoeff(foundFun, m_ori);
527 GISMO_ASSERT(foundFun.targetDim()==3,
"Foundation function has dimension "<<foundFun.targetDim()<<
", but expected 3");
530 m_assembler.assemble(
531 m_space * m_foundation.asDiag() * (m_def - m_ori) *
meas(m_ori)
535 template <
short_t d,
class T,
bool bending>
536 template <
short_t _d,
bool _matrix>
537 typename std::enable_if<!(_d==3), void>::type
538 gsThinShellAssembler<d, T, bending>::_assembleFoundation_impl(
const gsFunction<T> & ,
const gsFunctionSet<T> & )
543 template<
short_t d,
class T,
bool bending>
544 template<
bool _matrix>
545 void gsThinShellAssembler<d, T, bending>::_assembleWeakBCs()
548 _assembleWeakBCs_impl<d,_matrix>();
551 template <
short_t d,
class T,
bool bending>
552 template <
short_t _d,
bool _matrix>
553 typename std::enable_if<(_d==3) && _matrix, void>::type
554 gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl()
556 gsMultiPatch<T> & defpatches = m_patches;
557 geometryMap m_ori = m_assembler.getMap(m_patches);
559 space m_space = m_assembler.trialSpace(0);
562 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&defpatches);
563 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&defpatches);
564 auto mmA = m_assembler.getCoeff(m_mmA);
565 auto mmD = m_assembler.getCoeff(m_mmD);
567 auto cart2cov = cartcov(m_ori);
568 auto con2cartI = cartcon(m_ori).inv();
570 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
571 auto mmDcart = (con2cartI *
reshape(mmD,3,3) * cart2cov);
573 element el = m_assembler.getElement();
574 auto alpha_d = m_alpha_d_bc *
reshape(mmAcart,9,1).max().val() / el.area(m_ori);
575 auto alpha_r = m_alpha_r_bc *
reshape(mmDcart,9,1).max().val() / el.area(m_ori);
578 m_assembler.assembleBdr
580 m_bcs.get(
"Weak Dirichlet")
582 -(alpha_d * m_space * m_space.tr()) *
meas(m_ori)
586 m_assembler.assembleBdr
588 m_bcs.get(
"Weak Clamped")
591 alpha_r * ( ( var1(m_space,m_ori) * unv(m_ori) ) * ( var1(m_space,m_ori) * unv(m_ori) ).tr() )
596 template <
short_t d,
class T,
bool bending>
597 template <
short_t _d,
bool _matrix>
598 typename std::enable_if<(_d==3) && !_matrix, void>::type
599 gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl()
601 gsMultiPatch<T> & defpatches = m_patches;
602 geometryMap m_ori = m_assembler.getMap(m_patches);
604 space m_space = m_assembler.trialSpace(0);
605 auto g_N = m_assembler.getBdrFunction(m_ori);
607 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&defpatches);
608 auto mmA = m_assembler.getCoeff(m_mmA);
610 auto cart2cov = cartcov(m_ori);
611 auto con2cartI = cartcon(m_ori).inv();
613 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
615 element el = m_assembler.getElement();
616 auto alpha_d = m_alpha_d_bc *
reshape(mmAcart,9,1).max().val() / el.area(m_ori);
620 m_assembler.assembleBdr
622 m_bcs.get(
"Weak Dirichlet")
624 -(alpha_d * m_space * g_N ) *
meas(m_ori)
631 template <
short_t d,
class T,
bool bending>
632 template <
short_t _d,
bool _matrix>
633 typename std::enable_if<!(_d==3) && _matrix, void>::type
634 gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl()
636 gsMultiPatch<T> & defpatches = m_patches;
637 geometryMap m_ori = m_assembler.getMap(m_patches);
639 space m_space = m_assembler.trialSpace(0);
642 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&defpatches);
643 auto mmA = m_assembler.getCoeff(m_mmA);
645 auto cart2cov = cartcov(m_ori);
646 auto con2cartI = cartcon(m_ori).inv();
648 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
650 element el = m_assembler.getElement();
651 auto alpha_d = m_alpha_d_bc *
reshape(mmAcart,9,1).max().val() / el.area(m_ori);
654 m_assembler.assembleBdr
656 m_bcs.get(
"Weak Dirichlet")
658 -(alpha_d * m_space * m_space.tr()) *
meas(m_ori)
662 template <
short_t d,
class T,
bool bending>
663 template <
short_t _d,
bool _matrix>
664 typename std::enable_if<!(_d==3) && !_matrix, void>::type
665 gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl()
667 geometryMap m_ori = m_assembler.getMap(m_patches);
669 space m_space = m_assembler.trialSpace(0);
670 auto g_N = m_assembler.getBdrFunction(m_ori);
673 m_assembler.assembleBdr
675 m_bcs.get(
"Weak Dirichlet")
677 (m_alpha_d_bc * (m_space * (m_ori - m_ori) - m_space * (g_N) )) *
meas(m_ori)
681 template <
short_t d,
class T,
bool bending>
682 template <
bool _matrix>
683 void gsThinShellAssembler<d, T, bending>::_assembleWeakBCs(
const gsFunctionSet<T> & deformed)
686 _assembleWeakBCs_impl<d,_matrix>(deformed);
689 template <
short_t d,
class T,
bool bending>
690 template <
short_t _d,
bool _matrix>
691 typename std::enable_if<(_d==3) && _matrix, void>::type
692 gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl(
const gsFunctionSet<T> & deformed)
694 geometryMap m_ori = m_assembler.getMap(m_patches);
695 geometryMap m_def = m_assembler.getMap(deformed);
697 space m_space = m_assembler.trialSpace(0);
700 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
701 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&deformed);
702 auto mmA = m_assembler.getCoeff(m_mmA);
703 auto mmD = m_assembler.getCoeff(m_mmD);
705 auto cart2cov = cartcov(m_ori);
706 auto con2cartI = cartcon(m_ori).inv();
708 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
709 auto mmDcart = (con2cartI *
reshape(mmD,3,3) * cart2cov);
711 element el = m_assembler.getElement();
712 auto alpha_d = m_alpha_d_bc *
reshape(mmAcart,9,1).max().val() / el.area(m_ori);
713 auto alpha_r = m_alpha_r_bc *
reshape(mmDcart,9,1).max().val() / el.area(m_ori);
716 auto du = m_def - m_ori;
717 auto dnN = ( usn(m_def).tr()*unv(m_ori) - usn(m_ori).tr()*unv(m_ori) ).val();
720 m_assembler.assembleBdr
722 m_bcs.get(
"Weak Dirichlet")
724 -alpha_d * m_space * m_space.tr() *
meas(m_ori)
728 m_assembler.assembleBdr
730 m_bcs.get(
"Weak Clamped")
733 alpha_r * dnN * ( var2deriv2(m_space,m_space,m_def,unv(m_ori).tr()) )
735 alpha_r * ( ( var1(m_space,m_def) * unv(m_ori) ) * ( var1(m_space,m_def) * unv(m_ori) ).tr() )
740 template <
short_t d,
class T,
bool bending>
741 template <
short_t _d,
bool _matrix>
742 typename std::enable_if<(_d==3) && !_matrix, void>::type
743 gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl(
const gsFunctionSet<T> & deformed)
745 geometryMap m_ori = m_assembler.getMap(m_patches);
746 geometryMap m_def = m_assembler.getMap(deformed);
748 space m_space = m_assembler.trialSpace(0);
749 auto g_N = m_assembler.getBdrFunction(m_ori);
751 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
752 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&deformed);
753 auto mmA = m_assembler.getCoeff(m_mmA);
754 auto mmD = m_assembler.getCoeff(m_mmD);
756 auto cart2cov = cartcov(m_ori);
757 auto con2cartI = cartcon(m_ori).inv();
759 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
760 auto mmDcart = (con2cartI *
reshape(mmD,3,3) * cart2cov);
762 element el = m_assembler.getElement();
763 auto alpha_d = m_alpha_d_bc *
reshape(mmAcart,9,1).max().val() / el.area(m_ori);
764 auto alpha_r = m_alpha_r_bc *
reshape(mmDcart,9,1).max().val() / el.area(m_ori);
766 auto du = m_def - m_ori;
767 auto dnN = ( usn(m_def).tr()*
nv(m_ori) - usn(m_ori).tr()*
nv(m_ori) ).val();
770 m_assembler.assembleBdr
772 m_bcs.get(
"Weak Dirichlet")
774 alpha_d * (m_space * du - m_space * (g_N) ) *
meas(m_ori)
778 m_assembler.assembleBdr
780 m_bcs.get(
"Weak Clamped")
783 - alpha_r * dnN * ( var1(m_space,m_def) * usn(m_ori) )
788 template <
short_t d,
class T,
bool bending>
789 template <
short_t _d,
bool _matrix>
790 typename std::enable_if<!(_d==3) && _matrix, void>::type
791 gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl(
const gsFunctionSet<T> & deformed)
793 geometryMap m_ori = m_assembler.getMap(m_patches);
795 space m_space = m_assembler.trialSpace(0);
797 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
798 auto mmA = m_assembler.getCoeff(m_mmA);
800 auto cart2cov = cartcov(m_ori);
801 auto con2cartI = cartcon(m_ori).inv();
803 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
805 element el = m_assembler.getElement();
806 auto alpha_d = m_alpha_d_bc *
reshape(mmAcart,9,1).max().val() / el.area(m_ori);
809 m_assembler.assembleBdr
811 m_bcs.get(
"Weak Dirichlet")
813 -alpha_d * m_space * m_space.tr() *
meas(m_ori)
817 template <
short_t d,
class T,
bool bending>
818 template <
short_t _d,
bool _matrix>
819 typename std::enable_if<!(_d==3) && !_matrix, void>::type
820 gsThinShellAssembler<d, T, bending>::_assembleWeakBCs_impl(
const gsFunctionSet<T> & deformed)
822 geometryMap m_ori = m_assembler.getMap(m_patches);
823 geometryMap m_def = m_assembler.getMap(deformed);
825 space m_space = m_assembler.trialSpace(0);
826 auto g_N = m_assembler.getBdrFunction(m_ori);
828 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
829 auto mmA = m_assembler.getCoeff(m_mmA);
831 auto cart2cov = cartcov(m_ori);
832 auto con2cartI = cartcon(m_ori).inv();
834 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
836 element el = m_assembler.getElement();
837 auto alpha_d = m_alpha_d_bc *
reshape(mmAcart,9,1).max().val() / el.area(m_ori);
840 m_assembler.assembleBdr
842 m_bcs.get(
"Weak Dirichlet")
844 alpha_d * (m_space * (m_def - m_ori) - m_space * (g_N) ) *
meas(m_ori)
848 template<
short_t d,
class T,
bool bending>
849 template<
bool _matrix>
850 void gsThinShellAssembler<d, T, bending>::_assembleWeakIfc()
853 if (m_weakC0.size()==0 && m_weakC1.size()==0)
855 _assembleWeakIfc_impl<d,_matrix>();
858 template <
short_t d,
class T,
bool bending>
859 template <
short_t _d,
bool _matrix>
860 typename std::enable_if<(_d==3) && _matrix, void>::type
861 gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl()
863 gsMultiPatch<T> & defpatches = m_patches;
864 geometryMap m_ori = m_assembler.getMap(m_patches);
866 space m_space = m_assembler.trialSpace(0);
869 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&defpatches);
870 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&defpatches);
871 auto mmA = m_assembler.getCoeff(m_mmA);
872 auto mmD = m_assembler.getCoeff(m_mmD);
874 auto cart2cov = cartcov(m_ori);
875 auto con2cartI = cartcon(m_ori).inv();
877 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
878 auto mmDcart = (con2cartI *
reshape(mmD,3,3) * cart2cov);
880 element el = m_assembler.getElement();
881 auto h = (el.area(m_ori.left()) + el.area(m_ori.right())) / 2;
882 auto alpha_d = m_alpha_d_ifc *
reshape(mmAcart,9,1).max().val() / h;
883 auto alpha_r = m_alpha_r_ifc *
reshape(mmDcart,9,1).max().val() / h;
886 m_assembler.assembleIfc(m_weakC0,
887 alpha_d * m_space.left() * m_space.left().tr() *
meas(m_ori)
889 -alpha_d * m_space.right()* m_space.left() .tr() *
meas(m_ori)
891 -alpha_d * m_space.left() * m_space.right().tr() *
meas(m_ori)
893 alpha_d * m_space.right()* m_space.right().tr() *
meas(m_ori)
899 m_assembler.assembleIfc(m_weakC1,
900 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)
902 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)
904 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)
906 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)
909 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)
911 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)
913 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)
915 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)
920 m_assembler.assembleIfc(m_weakC1,
921 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)
923 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)
925 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)
927 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)
929 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)
931 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)
933 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)
935 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)
939 template <
short_t d,
class T,
bool bending>
940 template <
short_t _d,
bool _matrix>
941 typename std::enable_if<(_d==3) && !_matrix, void>::type
942 gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl()
949 template <
short_t d,
class T,
bool bending>
950 template <
short_t _d,
bool _matrix>
951 typename std::enable_if<!(_d==3) && _matrix, void>::type
952 gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl()
954 gsMultiPatch<T> & defpatches = m_patches;
955 geometryMap m_ori = m_assembler.getMap(m_patches);
957 space m_space = m_assembler.trialSpace(0);
959 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&defpatches);
960 auto mmA = m_assembler.getCoeff(m_mmA);
962 auto cart2cov = cartcov(m_ori);
963 auto con2cartI = cartcon(m_ori).inv();
965 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
967 element el = m_assembler.getElement();
968 auto h = (el.area(m_ori.left()) + el.area(m_ori.right())) / 2;
969 auto alpha_d = m_alpha_d_ifc *
reshape(mmAcart,9,1).max().val() / h;
972 m_assembler.assembleIfc(m_weakC0,
973 alpha_d * m_space.left() * m_space.left().tr() *
meas(m_ori) *
meas(m_ori)
975 -alpha_d * m_space.right()* m_space.left() .tr() *
meas(m_ori) *
meas(m_ori)
977 -alpha_d * m_space.left() * m_space.right().tr() *
meas(m_ori) *
meas(m_ori)
979 alpha_d * m_space.right()* m_space.right().tr() *
meas(m_ori) *
meas(m_ori)
985 template <
short_t d,
class T,
bool bending>
986 template <
short_t _d,
bool _matrix>
987 typename std::enable_if<!(_d==3) && !_matrix, void>::type
988 gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl()
995 template<
short_t d,
class T,
bool bending>
996 template<
bool _matrix>
997 void gsThinShellAssembler<d, T, bending>::_assembleWeakIfc(
const gsFunctionSet<T> & deformed)
1000 _assembleWeakIfc_impl<d,_matrix>(deformed);
1003 template <
short_t d,
class T,
bool bending>
1004 template <
short_t _d,
bool _matrix>
1005 typename std::enable_if<(_d==3) && _matrix, void>::type
1006 gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl(
const gsFunctionSet<T> & deformed)
1008 geometryMap m_ori = m_assembler.getMap(m_patches);
1009 geometryMap m_def = m_assembler.getMap(deformed);
1011 space m_space = m_assembler.trialSpace(0);
1013 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1014 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&deformed);
1015 auto mmA = m_assembler.getCoeff(m_mmA);
1016 auto mmD = m_assembler.getCoeff(m_mmD);
1018 auto cart2cov = cartcov(m_ori);
1019 auto con2cartI = cartcon(m_ori).inv();
1021 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
1022 auto mmDcart = (con2cartI *
reshape(mmD,3,3) * cart2cov);
1024 element el = m_assembler.getElement();
1025 auto h = (el.area(m_ori.left()) + el.area(m_ori.right())) / 2;
1026 auto alpha_d = m_alpha_d_ifc *
reshape(mmAcart,9,1).max().val() / h;
1027 auto alpha_r = m_alpha_r_ifc *
reshape(mmDcart,9,1).max().val() / h;
1029 auto du = ((m_def.left()-m_ori.left()) - (m_def.right()-m_ori.right()));
1031 auto dN_lr = (usn(m_def.left()).tr()*usn(m_def.right())
1032 - usn(m_ori.left()).tr()*usn(m_ori.right())).val();
1034 auto dN_rl = (usn(m_def.right()).tr()*usn(m_def.left())
1035 - usn(m_ori.right()).tr()*usn(m_ori.left())).val();
1037 auto dnN_lr= (unv(m_def.left()).tr()*usn(m_def.right())
1038 - unv(m_ori.left()).tr()*usn(m_ori.right())).val();
1040 auto dnN_rl= (unv(m_def.right()).tr()*usn(m_def.left())
1041 - unv(m_ori.right()).tr()*usn(m_ori.left())).val();
1044 m_assembler.assembleIfc(m_weakC0,
1045 alpha_d * m_space.left() * m_space.left().tr() *
meas(m_ori)
1047 -alpha_d * m_space.right()* m_space.left() .tr() *
meas(m_ori)
1049 -alpha_d * m_space.left() * m_space.right().tr() *
meas(m_ori)
1051 alpha_d * m_space.right()* m_space.right().tr() *
meas(m_ori)
1057 m_assembler.assembleIfc(m_weakC1,
1058 alpha_r * dN_lr * var2(m_space.left() ,m_space.left() ,m_def.left() ,usn(m_def.right()).tr() ) *
meas(m_ori)
1060 alpha_r * dN_rl * var2( m_space.left(),m_space.left(),m_def.left(),usn(m_def.right() ).tr() ) *
meas(m_ori)
1062 alpha_r * dN_lr * ( var1(m_space.left() ,m_def.left() ) * var1(m_space.right(),m_def.right()).tr() ) *
meas(m_ori)
1064 alpha_r * dN_rl * ( var1(m_space.left(),m_def.left()) * var1(m_space.right() ,m_def.right() ).tr() ) *
meas(m_ori)
1066 alpha_r * dN_lr * ( var1(m_space.right(),m_def.right()) * var1(m_space.left() ,m_def.left() ).tr() ) *
meas(m_ori)
1068 alpha_r * dN_rl * ( var1(m_space.right() ,m_def.right() ) * var1(m_space.left(),m_def.left()).tr() ) *
meas(m_ori)
1070 alpha_r * dN_lr * var2( m_space.right(),m_space.right(),m_def.right(),usn(m_def.left() ).tr() ) *
meas(m_ori)
1072 alpha_r * dN_rl * var2(m_space.right() ,m_space.right() ,m_def.right() ,usn(m_def.left()).tr() ) *
meas(m_ori)
1077 m_assembler.assembleIfc(m_weakC1,
1078 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)
1080 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)
1082 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)
1084 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)
1087 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)
1089 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)
1091 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)
1093 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)
1098 m_assembler.assembleIfc(m_weakC1,
1099 alpha_r * dnN_lr * ovar2(m_space.left(),m_space.left(),m_def.left(),usn(m_def.right()).tr()) *
meas(m_ori)
1101 alpha_r * dnN_rl * ovar2(m_space.left(),m_space.left(),m_def.left(),usn(m_def.right()).tr()) *
meas(m_ori)
1103 alpha_r * dnN_lr * ( ovar1(m_space.left() ,m_def.left() ) * var1(m_space.right(),m_def.right()).tr() ) *
meas(m_ori)
1105 alpha_r * dnN_rl * ( ovar1(m_space.left() ,m_def.left() ) * var1(m_space.right(),m_def.right()).tr() ) *
meas(m_ori)
1107 alpha_r * dnN_lr * ( ovar1(m_space.right(),m_def.right()) * var1(m_space.left() ,m_def.left() ).tr() ) *
meas(m_ori)
1109 alpha_r * dnN_rl * ( ovar1(m_space.right(),m_def.right()) * var1(m_space.left() ,m_def.left() ).tr() ) *
meas(m_ori)
1111 alpha_r * dnN_lr * ovar2(m_space.right(),m_space.right(),m_def.right(),usn(m_def.left()).tr()) *
meas(m_ori)
1113 alpha_r * dnN_rl * ovar2(m_space.right(),m_space.right(),m_def.right(),usn(m_def.left()).tr()) *
meas(m_ori)
1118 m_assembler.assembleIfc(m_weakC1,
1119 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)
1121 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)
1123 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)
1125 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)
1127 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)
1129 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)
1131 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)
1133 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)
1137 template <
short_t d,
class T,
bool bending>
1138 template <
short_t _d,
bool _matrix>
1139 typename std::enable_if<(_d==3) && !_matrix, void>::type
1140 gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl(
const gsFunctionSet<T> & deformed)
1142 geometryMap m_ori = m_assembler.getMap(m_patches);
1143 geometryMap m_def = m_assembler.getMap(deformed);
1145 space m_space = m_assembler.trialSpace(0);
1147 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1148 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&deformed);
1149 auto mmA = m_assembler.getCoeff(m_mmA);
1150 auto mmD = m_assembler.getCoeff(m_mmD);
1152 auto cart2cov = cartcov(m_ori);
1153 auto con2cartI = cartcon(m_ori).inv();
1155 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
1156 auto mmDcart = (con2cartI *
reshape(mmD,3,3) * cart2cov);
1158 element el = m_assembler.getElement();
1159 auto h = (el.area(m_ori.left()) + el.area(m_ori.right())) / 2;
1160 auto alpha_d = m_alpha_d_ifc *
reshape(mmAcart,9,1).max().val() / h;
1161 auto alpha_r = m_alpha_r_ifc *
reshape(mmDcart,9,1).max().val() / h;
1163 auto du = ((m_def.left()-m_ori.left()) - (m_def.right()-m_ori.right()));
1165 auto dN_lr = (usn(m_def.left()).tr()*usn(m_def.right())
1166 - usn(m_ori.left()).tr()*usn(m_ori.right())).val();
1168 auto dN_rl = (usn(m_def.right()).tr()*usn(m_def.left())
1169 - usn(m_ori.right()).tr()*usn(m_ori.left())).val();
1171 auto dnN_lr= (unv(m_def.left()).tr()*usn(m_def.right())
1172 - unv(m_ori.left()).tr()*usn(m_ori.right())).val();
1174 auto dnN_rl= (unv(m_def.right()).tr()*usn(m_def.left())
1175 - unv(m_ori.right()).tr()*usn(m_ori.left())).val();
1178 m_assembler.assembleIfc(m_weakC0,
1179 -alpha_d * m_space.left() * du *
meas(m_ori)
1181 alpha_d * m_space.right()* du *
meas(m_ori)
1185 m_assembler.assembleIfc(m_weakC1,
1186 -alpha_r * dN_lr * var1(m_space.left(),m_def.left()) * usn(m_def.right()) *
meas(m_ori)
1188 -alpha_r * dN_lr * var1(m_space.right(),m_def.right()) * usn(m_def.left() ) *
meas(m_ori)
1191 -alpha_r * dN_rl * var1(m_space.right(),m_def.right()) * usn(m_def.left()) *
meas(m_ori)
1193 -alpha_r * dN_rl * var1(m_space.left(),m_def.left()) * usn(m_def.right() ) *
meas(m_ori)
1198 m_assembler.assembleIfc(m_weakC1,
1199 -alpha_r * dnN_lr* ovar1(m_space.left(),m_def.left()) * usn(m_def.right()) *
meas(m_ori)
1201 -alpha_r * dnN_lr* var1(m_space.right(),m_def.right()) * unv(m_def.left() ) *
meas(m_ori)
1204 -alpha_r * dnN_rl* ovar1(m_space.right(),m_def.right()) * usn(m_def.left()) *
meas(m_ori)
1206 -alpha_r * dnN_rl* var1(m_space.left(),m_def.left()) * unv(m_def.right() ) *
meas(m_ori)
1210 template <
short_t d,
class T,
bool bending>
1211 template <
short_t _d,
bool _matrix>
1212 typename std::enable_if<!(_d==3) && _matrix, void>::type
1213 gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl(
const gsFunctionSet<T> & deformed)
1215 geometryMap m_ori = m_assembler.getMap(m_patches);
1216 geometryMap m_def = m_assembler.getMap(deformed);
1218 space m_space = m_assembler.trialSpace(0);
1220 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1221 auto mmA = m_assembler.getCoeff(m_mmA);
1223 auto cart2cov = cartcov(m_ori);
1224 auto con2cartI = cartcon(m_ori).inv();
1226 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
1228 element el = m_assembler.getElement();
1229 auto h = (el.area(m_ori.left()) + el.area(m_ori.right())) / 2;
1230 auto alpha_d = m_alpha_d_ifc *
reshape(mmAcart,9,1).max().val() / h;
1232 auto du = ((m_def.left()-m_ori.left()) - (m_def.right()-m_ori.right()));
1235 m_assembler.assembleIfc(m_weakC0,
1236 alpha_d * m_space.left() * m_space.left().tr() *
meas(m_ori)
1238 -alpha_d * m_space.right()* m_space.left() .tr() *
meas(m_ori)
1240 -alpha_d * m_space.left() * m_space.right().tr() *
meas(m_ori)
1242 alpha_d * m_space.right()* m_space.right().tr() *
meas(m_ori)
1248 template <
short_t d,
class T,
bool bending>
1249 template <
short_t _d,
bool _matrix>
1250 typename std::enable_if<!(_d==3) && !_matrix, void>::type
1251 gsThinShellAssembler<d, T, bending>::_assembleWeakIfc_impl(
const gsFunctionSet<T> & deformed)
1253 geometryMap m_ori = m_assembler.getMap(m_patches);
1254 geometryMap m_def = m_assembler.getMap(deformed);
1256 space m_space = m_assembler.trialSpace(0);
1258 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1259 auto mmA = m_assembler.getCoeff(m_mmA);
1261 auto cart2cov = cartcov(m_ori);
1262 auto con2cartI = cartcon(m_ori).inv();
1264 auto mmAcart = (con2cartI *
reshape(mmA,3,3) * cart2cov);
1266 element el = m_assembler.getElement();
1267 auto h = (el.area(m_ori.left()) + el.area(m_ori.right())) / 2;
1268 auto alpha_d = m_alpha_d_ifc *
reshape(mmAcart,9,1).max().val() / h;
1270 auto du = ((m_def.left()-m_ori.left()) - (m_def.right()-m_ori.right()));
1273 m_assembler.assembleIfc(m_weakC0,
1274 alpha_d * m_space.left() * du *
meas(m_ori)
1276 -alpha_d * m_space.right()* du *
meas(m_ori)
1282 template<
short_t d,
class T,
bool bending>
1283 void gsThinShellAssembler<d, T, bending>::_assembleDirichlet()
1285 this->_getOptions();
1286 space m_space = m_assembler.trialSpace(0);
1288 m_space.setup(m_bcs, dirichlet::l2Projection, m_continuity);
1292 template<
short_t d,
class T,
bool bending>
1295 this->_getOptions();
1296 space m_space = m_assembler.trialSpace(0);
1297 m_space.setup(m_bcs, dirichlet::homogeneous, m_continuity);
1302 template<
short_t d,
class T,
bool bending>
1308 space m_space = m_assembler.trialSpace(0);
1309 m_mapper = m_space.mapper();
1311 for (
size_t i = 0; i< m_pLoads.numLoads(); ++i )
1313 GISMO_ASSERT(m_pLoads[i].value.size()==d,
"Point load has wrong dimension "<<m_pLoads[i].value.size()<<
" instead of "<<d<<
"\n");
1314 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");
1316 if ( m_pLoads[i].parametric )
1318 if (
const gsMappedBasis<2,T> * mbasis =
dynamic_cast<const gsMappedBasis<2,T> *
>(m_spaceBasis))
1320 mbasis->active_into(m_pLoads[i].patch,m_pLoads[i].point, acts );
1321 mbasis->eval_into (m_pLoads[i].patch,m_pLoads[i].point, bVals );
1323 else if (
const gsMultiBasis<T> * mbasis =
dynamic_cast<const gsMultiBasis<T> *
>(m_spaceBasis))
1325 mbasis->basis(m_pLoads[i].patch).active_into( m_pLoads[i].point, acts);
1326 mbasis->basis(m_pLoads[i].patch).eval_into ( m_pLoads[i].point, bVals);
1333 gsMatrix<T> forcePoint;
1334 m_patches.patch(m_pLoads[i].patch).invertPoints(m_pLoads[i].point,forcePoint);
1336 if (
const gsMappedBasis<2,T> * mbasis =
dynamic_cast<const gsMappedBasis<2,T> *
>(m_spaceBasis))
1338 mbasis->active_into(m_pLoads[i].patch,forcePoint, acts );
1339 mbasis->eval_into (m_pLoads[i].patch,forcePoint, bVals );
1341 else if (
const gsMultiBasis<T> * mbasis =
dynamic_cast<const gsMultiBasis<T> *
>(m_spaceBasis))
1343 mbasis->basis(m_pLoads[i].patch).active_into( forcePoint, acts);
1344 mbasis->basis(m_pLoads[i].patch).eval_into ( forcePoint, bVals);
1351 for (
size_t j = 0; j< d; ++j)
1353 if (m_pLoads[i].value[j] != 0.0)
1355 m_mapper.localToGlobal(acts, m_pLoads[i].patch, globalActs,j);
1356 for (
index_t k=0; k < globalActs.rows(); ++k)
1358 if (m_mapper.is_free_index(globalActs(k,0)))
1359 m_rhs(globalActs(k,0), 0) += bVals(k,0) * m_pLoads[i].value[j];
1366 template<
short_t d,
class T,
bool bending>
1367 void gsThinShellAssembler<d, T, bending>::_applyMass()
1370 gsMatrix<index_t> acts,globalActs;
1372 space m_space = m_assembler.trialSpace(0);
1373 m_mapper = m_space.mapper();
1375 GISMO_ASSERT(m_mass.rows()!=0,
"Mass matrix must be assembled first");
1377 for (
size_t i = 0; i< m_pMass.numLoads(); ++i )
1379 GISMO_ASSERT(m_pMass[i].value.size()==1,
"Mass should be one-dimensional");
1382 if ( m_pMass[i].parametric )
1384 m_basis.front().basis(m_pMass[i].patch).active_into( m_pMass[i].point, acts );
1385 m_basis.front().basis(m_pMass[i].patch).eval_into ( m_pMass[i].point, bVals);
1389 gsMatrix<T> forcePoint;
1390 m_patches.patch(m_pMass[i].patch).invertPoints(m_pMass[i].point,forcePoint);
1391 m_basis.front().basis(m_pMass[i].patch).active_into( forcePoint, acts );
1392 m_basis.front().basis(m_pMass[i].patch).eval_into ( forcePoint, bVals);
1396 for (
size_t j = 0; j< d; ++j)
1398 if (m_pMass[i].value[0] != 0.0)
1400 m_mapper.localToGlobal(acts, m_pMass[i].patch, globalActs,j);
1401 for (
index_t k=0; k < globalActs.rows(); ++k)
1403 for (
index_t l=0; l < globalActs.rows(); ++l)
1405 if (m_mapper.is_free_index(globalActs(k,0)) && m_mapper.is_free_index(globalActs(l,0)))
1406 m_mass(globalActs(k,0), globalActs(l,0)) += bVals(k,0) * bVals(l,0) * m_pMass[i].value[0];
1414 template<
short_t d,
class T,
bool bending>
1417 m_assembler.cleanUp();
1418 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1419 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1421 geometryMap m_ori = m_assembler.getMap(m_patches);
1424 m_assembler.initSystem();
1426 gsMaterialMatrixIntegrate<T,MaterialOutput::Density> m_mm(m_materialMatrices,&m_patches);
1427 auto mm0 = m_assembler.getCoeff(m_mm);
1429 space m_space = m_assembler.trialSpace(0);
1430 m_space.setup(m_bcs, dirichlet::homogeneous, m_continuity);
1435 pt.setConstant(.25);
1441 m_assembler.assemble(mm0.val()*m_space*m_space.tr()*
meas(m_ori));
1443 m_assembler.assemble(mm0.val()*(m_space.rowSum())*
meas(m_ori));
1465 m_assembler.cleanUp();
1472 template<
short_t d,
class T,
bool bending>
1475 m_assembler.cleanUp();
1476 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1477 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1479 geometryMap m_ori = m_assembler.getMap(m_patches);
1482 m_assembler.initSystem();
1483 auto m_foundation = m_assembler.getCoeff(*m_foundFun, m_ori);
1484 GISMO_ASSERT(m_foundFun->targetDim()==3,
"Foundation function has dimension "<<m_foundFun->targetDim()<<
", but expected 3");
1486 space m_space = m_assembler.trialSpace(0);
1490 m_assembler.assemble(m_space * m_foundation.asDiag() * m_space.tr() *
meas(m_ori));
1495 m_assembler.cleanUp();
1501 template<
short_t d,
class T,
bool bending>
1504 return assemble_impl<d, bending>();
1514 template <
short_t d,
typename T,
bool bending>
1515 template <
short_t _d,
bool _bending>
1516 typename std::enable_if<(_d==3) && _bending, ThinShellAssemblerStatus>::type
1519 this->_getOptions();
1521 m_assembler.cleanUp();
1522 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1523 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1527 geometryMap m_ori = m_assembler.getMap(m_patches);
1528 geometryMap m_def = m_assembler.getMap(defpatches);
1531 m_assembler.initSystem();
1532 m_assembler.initVector(1);
1534 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&defpatches);
1535 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixB> m_mmB(m_materialMatrices,&m_patches,&defpatches);
1536 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixC> m_mmC(m_materialMatrices,&m_patches,&defpatches);
1537 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&defpatches);
1538 auto mmA = m_assembler.getCoeff(m_mmA);
1539 auto mmB = m_assembler.getCoeff(m_mmB);
1540 auto mmC = m_assembler.getCoeff(m_mmC);
1541 auto mmD = m_assembler.getCoeff(m_mmD);
1544 auto m_m2 = m_assembler.getCoeff(mult2t);
1546 space m_space = m_assembler.trialSpace(0);
1548 auto m_force = m_assembler.getCoeff(*m_forceFun, m_ori);
1551 auto m_Em_der =
flat(
jac(m_def).tr() *
jac(m_space) );
1552 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);
1554 auto m_N_der = m_Em_der *
reshape(mmA,3,3) + m_Ef_der *
reshape(mmB,3,3);
1555 auto m_M_der = m_Em_der *
reshape(mmC,3,3) + m_Ef_der *
reshape(mmD,3,3);
1561 this->_assembleFoundation<true>(*m_foundFun);
1562 this->_assembleFoundation<false>(*m_foundFun);
1566 this->_assemblePressure<true>(*m_pressFun);
1567 this->_assemblePressure<false>(*m_pressFun);
1570 m_assembler.assemble(
1572 m_N_der * m_Em_der.tr()
1574 m_M_der * m_Ef_der.tr()
1577 m_space * m_force *
meas(m_ori)
1580 this->_assembleWeakBCs<true>();
1581 this->_assembleWeakBCs<false>();
1582 this->_assembleWeakIfc<true>();
1583 this->_assembleWeakIfc<false>();
1584 this->_assembleNeumann();
1587 if ( m_pLoads.numLoads() != 0 )
1589 m_rhs = m_assembler.rhs();
1596 m_assembler.cleanUp();
1602 template <
short_t d,
typename T,
bool bending>
1603 template <
short_t _d,
bool _bending>
1604 typename std::enable_if<!(_d==3 && _bending), ThinShellAssemblerStatus>::type
1607 this->_getOptions();
1609 m_assembler.cleanUp();
1610 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1611 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1615 geometryMap m_ori = m_assembler.getMap(m_patches);
1616 geometryMap m_def = m_assembler.getMap(defpatches);
1619 m_assembler.initSystem();
1621 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&defpatches);
1622 auto mmA = m_assembler.getCoeff(m_mmA);
1624 space m_space = m_assembler.trialSpace(0);
1625 auto m_force = m_assembler.getCoeff(*m_forceFun, m_ori);
1627 auto jacG =
jac(m_def);
1628 auto m_Em_der =
flat( jacG.tr() *
jac(m_space) ) ;
1629 auto m_N_der = m_Em_der *
reshape(mmA,3,3);
1635 this->_assembleFoundation<true>(*m_foundFun);
1636 this->_assembleFoundation<false>(*m_foundFun);
1640 this->_assemblePressure<true>(*m_pressFun);
1641 this->_assemblePressure<false>(*m_pressFun);
1644 m_assembler.assemble(
1646 m_N_der * m_Em_der.tr()
1649 m_space * m_force *
meas(m_ori)
1652 this->_assembleWeakBCs<true>();
1653 this->_assembleWeakBCs<false>();
1654 this->_assembleWeakIfc<true>();
1655 this->_assembleWeakIfc<false>();
1656 this->_assembleNeumann();
1659 if ( m_pLoads.numLoads() != 0 )
1661 m_rhs = m_assembler.rhs();
1669 m_assembler.cleanUp();
1675 template<
short_t d,
class T,
bool bending>
1678 return assembleMatrix_impl<d, bending>(deformed);
1681 template <
short_t d,
typename T,
bool bending>
1682 template <
short_t _d,
bool _bending>
1683 typename std::enable_if<(_d==3) && _bending, ThinShellAssemblerStatus>::type
1686 m_assembler.cleanUp();
1687 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1688 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1690 geometryMap m_ori = m_assembler.getMap(m_patches);
1691 geometryMap m_def = m_assembler.getMap(deformed);
1694 m_assembler.initSystem();
1695 m_assembler.initMatrix();
1697 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1698 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixB> m_mmB(m_materialMatrices,&m_patches,&deformed);
1699 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixC> m_mmC(m_materialMatrices,&m_patches,&deformed);
1700 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&deformed);
1701 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
1702 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1(m_materialMatrices,&m_patches,&deformed);
1703 auto mmA = m_assembler.getCoeff(m_mmA);
1704 auto mmB = m_assembler.getCoeff(m_mmB);
1705 auto mmC = m_assembler.getCoeff(m_mmC);
1706 auto mmD = m_assembler.getCoeff(m_mmD);
1707 auto S0 = m_assembler.getCoeff(m_S0);
1708 auto S1 = m_assembler.getCoeff(m_S1);
1711 auto m_m2 = m_assembler.getCoeff(mult2t);
1713 space m_space = m_assembler.trialSpace(0);
1715 this->homogenizeDirichlet();
1718 pt.setConstant(0.25);
1722 auto m_Em_der =
flat(
jac(m_def).tr() *
jac(m_space) ) ;
1723 auto m_Em_der2 = flatdot(
jac(m_space),
jac(m_space).tr(), m_N );
1727 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);
1728 auto m_Ef_der2 = -(flatdot2( deriv2(m_space), var1(m_space,m_def).tr(), m_M ).symmetrize()
1729 + var2deriv2(m_space,m_space,m_def, m_M ));
1731 auto m_N_der = m_Em_der *
reshape(mmA,3,3) + m_Ef_der *
reshape(mmB,3,3);
1732 auto m_M_der = m_Em_der *
reshape(mmC,3,3) + m_Ef_der *
reshape(mmD,3,3);
1736 if (m_foundInd) this->_assembleFoundation<true>(*m_foundFun,deformed);
1737 if (m_pressInd) this->_assemblePressure<true>(*m_pressFun,deformed);
1740 m_assembler.assemble(
1742 m_N_der * m_Em_der.tr()
1746 m_M_der * m_Ef_der.tr()
1752 this->_assembleWeakBCs<true>(deformed);
1753 this->_assembleWeakIfc<true>(deformed);
1759 m_assembler.cleanUp();
1765 template <
short_t d,
typename T,
bool bending>
1766 template <
short_t _d,
bool _bending>
1767 typename std::enable_if<!(_d==3 && _bending), ThinShellAssemblerStatus>::type
1770 m_assembler.cleanUp();
1771 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1772 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1774 geometryMap m_ori = m_assembler.getMap(m_patches);
1775 geometryMap m_def = m_assembler.getMap(deformed);
1778 m_assembler.initSystem();
1779 m_assembler.initMatrix();
1781 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1782 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
1783 auto mmA = m_assembler.getCoeff(m_mmA);
1784 auto S0 = m_assembler.getCoeff(m_S0);
1786 space m_space = m_assembler.trialSpace(0);
1789 this->homogenizeDirichlet();
1792 auto m_Em_der =
flat(
jac(m_def).tr() *
jac(m_space) ) ;
1793 auto m_Em_der2 = flatdot(
jac(m_space),
jac(m_space).tr(), m_N );
1795 auto m_N_der = m_Em_der *
reshape(mmA,3,3);
1800 if (m_foundInd) this->_assembleFoundation<true>(*m_foundFun,deformed);
1801 if (m_pressInd) this->_assemblePressure<true>(*m_pressFun,deformed);
1803 m_assembler.assemble(
1805 m_N_der * m_Em_der.tr()
1810 this->_assembleWeakBCs<true>(deformed);
1811 this->_assembleWeakIfc<true>(deformed);
1817 m_assembler.cleanUp();
1823 template<
short_t d,
class T,
bool bending>
1827 constructSolution(solVector, def);
1828 return assembleMatrix(def);
1831 template<
short_t d,
class T,
bool bending>
1834 return assembleMatrix_impl<d, bending>(deformed, previous, update);
1837 template <
short_t d,
typename T,
bool bending>
1838 template <
short_t _d,
bool _bending>
1839 typename std::enable_if<(_d==3) && _bending, ThinShellAssemblerStatus>::type
1842 m_assembler.cleanUp();
1843 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1844 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1846 geometryMap m_ori = m_assembler.getMap(m_patches);
1847 geometryMap m_def = m_assembler.getMap(deformed);
1848 geometryMap m_prev = m_assembler.getMap(previous);
1850 m_assembler.initSystem();
1851 m_assembler.initMatrix();
1853 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1854 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixB> m_mmB(m_materialMatrices,&m_patches,&deformed);
1855 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixC> m_mmC(m_materialMatrices,&m_patches,&deformed);
1856 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&deformed);
1857 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
1858 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1(m_materialMatrices,&m_patches,&deformed);
1859 auto mmA = m_assembler.getCoeff(m_mmA);
1860 auto mmB = m_assembler.getCoeff(m_mmB);
1861 auto mmC = m_assembler.getCoeff(m_mmC);
1862 auto mmD = m_assembler.getCoeff(m_mmD);
1866 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmAd(m_materialMatrices,&m_patches,&previous);
1867 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixB> m_mmBd(m_materialMatrices,&m_patches,&previous);
1868 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixC> m_mmCd(m_materialMatrices,&m_patches,&previous);
1869 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmDd(m_materialMatrices,&m_patches,&previous);
1870 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0d(m_materialMatrices,&m_patches,&previous);
1871 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1d(m_materialMatrices,&m_patches,&previous);
1872 auto mmAp = m_assembler.getCoeff(m_mmAd);
1873 auto mmBp = m_assembler.getCoeff(m_mmBd);
1874 auto mmCp = m_assembler.getCoeff(m_mmCd);
1875 auto mmDp = m_assembler.getCoeff(m_mmDd);
1876 auto S0 = m_assembler.getCoeff(m_S0d);
1877 auto S1 = m_assembler.getCoeff(m_S1d);
1880 auto m_m2 = m_assembler.getCoeff(mult2t);
1882 space m_space = m_assembler.trialSpace(0);
1883 solution m_du = m_assembler.getSolution(m_space,update);
1885 this->homogenizeDirichlet();
1887 auto m_E_mc =
flat(
jac(m_prev).tr() *
grad(m_du) ) ;
1888 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);
1889 auto m_N_c = m_E_mc *
reshape(mmAp,3,3) + m_E_fc *
reshape(mmBp,3,3);
1890 auto m_M_c = m_E_mc *
reshape(mmCp,3,3) + m_E_fc *
reshape(mmDp,3,3);
1892 auto m_N = S0.tr() + m_N_c;
1893 auto m_Em_der =
flat(
jac(m_def).tr() *
jac(m_space) ) ;
1894 auto m_Em_der2 = flatdot(
jac(m_space),
jac(m_space).tr(), m_N );
1896 auto m_M = S1.tr() + m_M_c;
1897 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);
1898 auto m_Ef_der2 = -(flatdot2( deriv2(m_space), var1(m_space,m_def).tr(), m_M ).symmetrize()
1899 + var2deriv2(m_space,m_space,m_def, m_M ));
1901 auto m_N_der = m_Em_der *
reshape(mmA,3,3) + m_Ef_der *
reshape(mmB,3,3);
1902 auto m_M_der = m_Em_der *
reshape(mmC,3,3) + m_Ef_der *
reshape(mmD,3,3);
1906 if (m_foundInd) this->_assembleFoundation<true>(*m_foundFun,deformed);
1907 if (m_pressInd) this->_assemblePressure<true>(*m_pressFun,deformed);
1910 m_assembler.assemble(
1912 m_N_der * m_Em_der.tr()
1916 m_M_der * m_Ef_der.tr()
1921 this->_assembleWeakBCs<true>(deformed);
1922 this->_assembleWeakIfc<true>(deformed);
1928 m_assembler.cleanUp();
1942 template<
short_t d,
class T,
bool bending>
1950 constructSolution(solVector, def);
1951 constructSolution(prevVector, it);
1953 return assembleMatrix(def,it,update);
1956 template<
short_t d,
class T,
bool bending>
1959 return assembleVector_impl<d, bending>(deformed,homogenize);
1962 template <
short_t d,
typename T,
bool bending>
1963 template <
short_t _d,
bool _bending>
1964 typename std::enable_if<(_d==3) && _bending, ThinShellAssemblerStatus>::type
1967 m_assembler.cleanUp();
1968 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1969 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1971 geometryMap m_ori = m_assembler.getMap(m_patches);
1972 geometryMap m_def = m_assembler.getMap(deformed);
1975 m_assembler.initVector(1);
1977 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
1978 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1(m_materialMatrices,&m_patches,&deformed);
1979 auto S0 = m_assembler.getCoeff(m_S0);
1980 auto S1 = m_assembler.getCoeff(m_S1);
1983 auto m_m2 = m_assembler.getCoeff(mult2t);
1985 space m_space = m_assembler.trialSpace(0);
1986 auto m_force = m_assembler.getCoeff(*m_forceFun, m_ori);
1989 if (homogenize) this->homogenizeDirichlet();
1990 else this->_assembleDirichlet();
1993 auto m_Em_der =
flat(
jac(m_def).tr() *
jac(m_space) ) ;
1996 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);
2000 if (m_foundInd) this->_assembleFoundation<false>(*m_foundFun,deformed);
2001 if (m_pressInd) this->_assemblePressure<false>(*m_pressFun,deformed);
2004 m_assembler.assemble(m_space * m_force *
meas(m_ori) -
2005 ( ( m_N * m_Em_der.tr() + m_M * m_Ef_der.tr() ) *
meas(m_ori) ).tr()
2008 this->_assembleWeakBCs<false>(deformed);
2009 this->_assembleWeakIfc<false>(deformed);
2010 this->_assembleNeumann();
2013 if ( m_pLoads.numLoads() != 0 )
2015 m_rhs = m_assembler.rhs();
2023 m_assembler.cleanUp();
2029 template <
short_t d,
typename T,
bool bending>
2030 template <
short_t _d,
bool _bending>
2031 typename std::enable_if<!(_d==3 && _bending), ThinShellAssemblerStatus>::type
2034 m_assembler.cleanUp();
2035 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2036 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2038 geometryMap m_ori = m_assembler.getMap(m_patches);
2039 geometryMap m_def = m_assembler.getMap(deformed);
2042 m_assembler.initVector(1);
2044 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
2045 auto S0 = m_assembler.getCoeff(m_S0);
2047 space m_space = m_assembler.trialSpace(0);
2048 auto m_force = m_assembler.getCoeff(*m_forceFun, m_ori);
2050 if (homogenize) this->homogenizeDirichlet();
2051 else this->_assembleDirichlet();
2054 auto m_Em_der =
flat(
jac(m_def).tr() *
jac(m_space) ) ;
2058 if (m_foundInd) this->_assembleFoundation<false>(*m_foundFun,deformed);
2059 if (m_pressInd) this->_assemblePressure<false>(*m_pressFun,deformed);
2062 m_assembler.assemble(m_space * m_force *
meas(m_ori) -
2063 ( ( m_N * m_Em_der.tr() ) *
meas(m_ori) ).tr()
2066 this->_assembleWeakBCs<false>(deformed);
2067 this->_assembleWeakIfc<false>(deformed);
2068 this->_assembleNeumann();
2071 if ( m_pLoads.numLoads() != 0 )
2073 m_rhs = m_assembler.rhs();
2081 m_assembler.cleanUp();
2087 template<
short_t d,
class T,
bool bending>
2092 this->_assemblePressure<true>(pressFun);
2102 template<
short_t d,
class T,
bool bending>
2108 this->_assemblePressure<true>(pressFun);
2118 template<
short_t d,
class T,
bool bending>
2123 this->_assemblePressure<true>(pressFun,deformed);
2133 template<
short_t d,
class T,
bool bending>
2139 this->_assemblePressure<true>(pressFun, deformed);
2149 template<
short_t d,
class T,
bool bending>
2154 this->_assemblePressure<false>(pressFun);
2164 template<
short_t d,
class T,
bool bending>
2170 this->_assemblePressure<false>(pressFun);
2180 template<
short_t d,
class T,
bool bending>
2185 this->_assemblePressure<false>(pressFun,deformed);
2195 template<
short_t d,
class T,
bool bending>
2201 this->_assemblePressure<false>(pressFun, deformed);
2211 template<
short_t d,
class T,
bool bending>
2216 this->assemblePressureVector(*m_pressFun,deformed);
2226 template<
short_t d,
class T,
bool bending>
2231 this->assembleFoundationVector(*m_foundFun,deformed);
2241 template<
short_t d,
class T,
bool bending>
2246 this->_assembleFoundation<false>(foundFun,deformed);
2256 template<
short_t d,
class T,
bool bending>
2259 return boundaryForce_impl<d, bending>(deformed,patchSides);
2262 template <
short_t d,
typename T,
bool bending>
2263 template <
short_t _d,
bool _bending>
2264 typename std::enable_if<(_d==3) && _bending, gsMatrix<T> >::type
2272 u.setup(bc, dirichlet::l2Projection, m_continuity);
2279 std::vector<std::unordered_set<index_t>> indices(d);
2281 for (std::vector<patchSide>::const_iterator bdr = patchSides.begin(); bdr != patchSides.end(); bdr++)
2283 boundary = mbasis->basis(bdr->patch).boundary(bdr->side());
2284 for (
index_t k=0; k!=boundary.rows(); k++)
2286 indices[c].insert(u.mapper().
index(boundary.
at(k),bdr->patch,c));
2291 geometryMap m_ori = assembler.
getMap(m_patches);
2292 geometryMap m_def = assembler.
getMap(deformed);
2297 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
2298 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1(m_materialMatrices,&m_patches,&deformed);
2299 auto S0 = assembler.
getCoeff(m_S0);
2300 auto S1 = assembler.
getCoeff(m_S1);
2303 auto m_m2 = assembler.
getCoeff(mult2t);
2308 auto m_Em_der =
flat(
jac(m_def).tr() *
jac(u) ) ;
2311 auto m_Ef_der = -( deriv2(u,sn(m_def).normalized().tr() ) + deriv2(m_def,var1(u,m_def) ) ) *
reshape(m_m2,3,3);
2317 - ( ( m_N * m_Em_der.tr() + m_M * m_Ef_der.tr() ) *
meas(m_ori) ).tr()
2322 GISMO_ERROR(
"Assembly of the force vector failed.");
2326 for (
index_t c = 0; c != d; c++)
2327 for (std::unordered_set<index_t>::const_iterator it = indices[c].begin(); it!=indices[c].end(); it++)
2328 F[c] += assembler.
rhs().
at(*it);
2336 template <
short_t d,
typename T,
bool bending>
2337 template <
short_t _d,
bool _bending>
2338 typename std::enable_if<!(_d==3 && _bending), gsMatrix<T> >::type
2346 u.setup(bc, dirichlet::l2Projection, m_continuity);
2353 std::vector<std::unordered_set<index_t>> indices(d);
2355 for (std::vector<patchSide>::const_iterator bdr = patchSides.begin(); bdr != patchSides.end(); bdr++)
2357 boundary = mbasis->basis(bdr->patch).boundary(bdr->side());
2358 for (
index_t k=0; k!=boundary.rows(); k++)
2360 indices[c].insert(u.mapper().
index(boundary.
at(k),bdr->patch,c));
2365 geometryMap m_ori = assembler.
getMap(m_patches);
2366 geometryMap m_def = assembler.
getMap(deformed);
2371 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
2372 auto S0 = assembler.
getCoeff(m_S0);
2377 auto m_Em_der =
flat(
jac(m_def).tr() *
jac(u) ) ;
2383 - ( ( m_N * m_Em_der.tr() ) *
meas(m_ori) ).tr()
2388 GISMO_ERROR(
"Assembly of the force vector failed.");
2392 for (
index_t c = 0; c != d; c++)
2393 for (std::unordered_set<index_t>::const_iterator it = indices[c].begin(); it!=indices[c].end(); it++)
2394 F[c] += assembler.
rhs().
at(*it);
2402 template<
short_t d,
class T,
bool bending>
2406 constructSolution(solVector, def);
2407 return assembleVector(def,homogenize);
2410 template<
short_t d,
class T,
bool bending>
2412 const bool Matrix,
const bool homogenize)
2417 status = assembleMatrix(deformed);
2422 return assembleVector(deformed,homogenize);
2424 template<
short_t d,
class T,
bool bending>
2426 const bool Matrix,
const bool homogenize)
2429 constructSolution(solVector, def);
2430 return assemble(def,Matrix,homogenize);
2433 template <
short_t d,
class T,
bool bending>
2438 for (
size_t k =0; k!=displacement.
nPatches(); ++k)
2439 mp.
patch(k).coefs() += displacement.
patch(k).coefs();;
2444 template <
short_t d,
class T,
bool bending>
2447 return _constructSolution(solVector,m_patches);
2450 template <
short_t d,
class T,
bool bending>
2453 deformed = _constructSolution(solVector,m_patches);
2456 template <
short_t d,
class T,
bool bending>
2459 mp = _constructSolution(solVector,mp);
2462 template<
short_t d,
class T,
bool bending>
2465 m_assembler.cleanUp();
2466 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2467 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2469 geometryMap G = m_assembler.getMap(geometry);
2476 template<
short_t d,
class T,
bool bending>
2479 m_assembler.cleanUp();
2480 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2481 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2483 geometryMap m_ori = m_assembler.getMap(m_patches);
2484 geometryMap m_def = m_assembler.getMap(deformed);
2486 auto u = m_def - m_ori;
2489 T result = evaluator.
integral( u.tr() * u *
meas(m_def));
2492 return std::pow(result/area,0.5);
2495 template<
short_t d,
class T,
bool bending>
2498 m_assembler.cleanUp();
2499 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2500 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2502 geometryMap m_ori = m_assembler.getMap(m_patches);
2503 geometryMap m_def = m_assembler.getMap(deformed);
2505 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&deformed);
2506 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1(m_materialMatrices,&deformed);
2507 auto S0 = m_assembler.getCoeff(m_S0);
2508 auto S1 = m_assembler.getCoeff(m_S1);
2509 auto u = m_def - m_ori;
2515 T result = evaluator.
integral(0.5 * ( u.tr() * ( m_N + m_M ).tr() ) *
meas(m_def));
2519 template<
short_t d,
class T,
bool bending>
2522 m_solvector = solVector;
2523 space m_space = m_assembler.trialSpace(0);
2524 solution m_solution = m_assembler.getSolution(m_space, m_solvector);
2525 geometryMap G = m_assembler.getMap(m_patches);
2527 ev.options().
setSwitch(
"plot.elements",
false);
2528 ev.options().
setInt (
"plot.npts" , 500);
2532 template<
short_t d,
class T,
bool bending>
2535 geometryMap G = m_assembler.getMap(deformed);
2537 ev.integralInterface( ( G.left() - G.right() ).sqNorm() , iFaces);
2542 template<
short_t d,
class T,
bool bending>
2545 geometryMap G = m_assembler.getMap(deformed);
2546 gsExprEvaluator<T> ev(m_assembler);
2547 ev.integralInterface( (sn(G.left()).normalized()-sn(G.right()).normalized()).sqNorm() , iFaces);
2552 template<
short_t d,
class T,
bool bending>
2555 geometryMap G = m_assembler.getMap(deformed);
2556 gsExprEvaluator<T> ev(m_assembler);
2557 ev.maxInterface( (sn(G.left())-sn(G.right())).norm() , iFaces);
2561 template<
short_t d,
class T,
bool bending>
2564 geometryMap G = m_assembler.getMap(deformed);
2565 gsExprEvaluator<T> ev(m_assembler);
2566 ev.maxInterface(
abs( (fform(G.left() ).inv()*
fform2nd(G.left() )).det() -
2567 (fform(G.right()).inv()*
fform2nd(G.right())).det() ) , iFaces);
2570 template<
short_t d,
class T,
bool bending>
2573 geometryMap G = m_assembler.getMap(deformed);
2574 gsExprEvaluator<T> ev(m_assembler);
2575 ev.maxInterface(
abs( (fform(G.left() ).inv()*
fform2nd(G.left() )).trace().val() -
2576 (fform(G.right()).inv()*
fform2nd(G.right())).trace().val() ) , iFaces);
2579 template<
short_t d,
class T,
bool bending>
2582 m_solvector = solVector;
2583 space m_space = m_assembler.trialSpace(0);
2584 m_space.setup(m_bcs, dirichlet::l2Projection, m_continuity);
2587 if (
const gsMappedBasis<2,T> * mbasis =
dynamic_cast<const gsMappedBasis<2,T> *
>(m_spaceBasis))
2590 const index_t dim = m_space.dim();
2591 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());
2597 for (
index_t p =0; p!=m_patches.nPieces(); ++p)
2599 for (
index_t c = 0; c!=dim; c++)
2602 for (
size_t i = 0; i < m_mapper.patchSize(p,c); ++i)
2604 const index_t ii = m_mapper.index(i, p, c);
2605 if ( m_mapper.is_free_index(ii) )
2606 cc(i,c) = m_solvector.at(ii);
2609 cc(i,c) = m_ddofs.at( m_mapper.global_to_bindex(ii) );
2616 mbasis->global_coef_to_local_coef(cc,tmp);
2617 return mbasis->exportToPatches(tmp);
2623 solution m_solution = m_assembler.getSolution(m_space, m_solvector);
2626 for (
index_t p =0; p!=m_patches.nPieces(); ++p)
2628 m_solution.extract(cc, p);
2629 result.
addPatch(m_basis.basis(p).makeGeometry(
give(cc) ));
2635 template<
short_t d,
class T,
bool bending>
2638 return constructMultiPatch(solVector);
2641 template<
short_t d,
class T,
bool bending>
2645 space m_space = m_assembler.trialSpace(0);
2646 m_space.setup(m_bcs, dirichlet::l2Projection, m_continuity);
2647 solution m_solution = m_assembler.getSolution(m_space, solVector);
2649 m_solution.extractFull(result);
2650 return result.col(0);
2653 template<
short_t d,
class T,
bool bending>
2658 for (
size_t p=0; p!=displacements.
nPatches(); p++)
2660 for (
size_t dim = 0; dim!=d; dim++)
2662 for (
size_t k=0; k!=m_mapper.patchSize(p,dim); k++)
2664 if (m_mapper.is_free(k,p,dim))
2666 result.
at(m_mapper.index(k,p,dim)) = displacements.
patch(p).coefs()(k,dim);
2675 template<
short_t d,
class T,
bool bending>
2678 deformed = constructDisplacement(solVector);
2689 template<
short_t d,
class T,
bool bending>
2699 this->_getOptions();
2701 m_assembler.cleanUp();
2702 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2703 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2709 gsMaterialMatrixEval<T,MaterialOutput::Stretch> m_mm(m_materialMatrices,&deformed,zmat);
2710 auto mm0 = m_assembler.getCoeff(m_mm);
2714 for (
index_t k = 0; k != u.cols(); ++k)
2715 result.col(k) = evaluator.
eval(mm0,u.col(k));
2719 template <
short_t d,
class T,
bool bending>
2729 this->_getOptions();
2731 m_assembler.cleanUp();
2732 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2733 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2739 gsMaterialMatrixEval<T,MaterialOutput::PStress> m_mm(m_materialMatrices,&deformed,zmat);
2740 auto mm0 = m_assembler.getCoeff(m_mm);
2744 for (
index_t k = 0; k != u.cols(); ++k)
2746 result.col(k) = evaluator.
eval(mm0,u.col(k));
2751 template<
short_t d,
class T,
bool bending>
2756 constructStress(m_patches,deformed,result,type);
2759 template<
short_t d,
class T,
bool bending>
2768 for (
size_t p = 0; p < m_patches.nPatches(); ++p )
2788 template<
short_t d,
class T,
bool bending>
2816 template<
short_t d,
class T,
bool bending>
2825 space m_space = m_assembler.trialSpace(0);
2826 m_space.setup(m_bcs, dirichlet::l2Projection, m_continuity);
2829 solution m_solution = m_assembler.getSolution(m_space, tmp);
2832 for (
size_t k =0; k!=mp.
nPatches(); ++k)
2835 m_solution.extract(cc, k);
2836 mp.
patch(k).coefs() += cc;
2841 template<
short_t d,
class T,
bool bending>
2847 this->projectL2_into(fun,result);
2851 template <
short_t d,
class T,
bool bending>
2854 m_assembler.cleanUp();
2855 m_assembler.setOptions(m_options);
2857 geometryMap ori = m_assembler.getMap(original);
2858 geometryMap def = m_assembler.getMap(deformed);
2861 T result = evaluator.
integral(def.sqNorm() *
meas(ori));
2865 template<
short_t d,
class T,
bool bending>
2868 geometryMap m_ori = m_assembler.getMap(m_patches);
2874 for (gsBoxTopology::const_iiterator it = m_patches.topology().iBegin(); it!=m_patches.topology().iEnd(); it++)
2877 ev.integralInterface( (sn(m_ori.left()).normalized()-sn(m_ori.right()).normalized()).sqNorm() );
2884 if (ev.value() < tol)
2885 m_inPlane.push_back(*it);
2887 m_outPlane.push_back(*it);
2891 template<
short_t d,
class T,
bool bending>
2892 bool gsThinShellAssembler<d, T, bending>::_isInPlane(
const boundaryInterface & ifc,
const T tol)
2894 geometryMap m_ori = m_assembler.getMap(m_patches);
2895 gsExprEvaluator<T> ev(m_assembler);
2898 ev.integralInterface( (sn(m_ori.left()).normalized()-sn(m_ori.right()).normalized()).sqNorm() );
2905 return (ev.value() < tol);
Provides an evaluator for material matrices for thin shells.
index_t addPatch(typename gsGeometry< T >::uPtr g)
Add a patch from a gsGeometry<T>::uPtr.
Definition: gsMultiPatch.hpp:210
void constructStress(const gsFunctionSet< T > &deformed, gsPiecewiseFunction< T > &result, stress_type::type type)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2752
Compute Cauchy stresses for a previously computed/defined displacement field. Can be pushed into gsPi...
Definition: gsThinShellFunctions.h:80
T integral(const expr::_expr< E > &expr)
Calculates the integral of the expression expr on the whole integration domain.
Definition: gsExprEvaluator.h:154
Definition: gsExprAssembler.h:30
std::enable_if<(_d==3)&&_bending, ThinShellAssemblerStatus >::type assembleVector_impl(const gsFunctionSet< T > &deformed, const bool homogenize)
Implementation of assembleVector for surfaces (3D)
Definition: gsThinShellAssembler.hpp:1965
ThinShellAssemblerStatus
Definition: gsThinShellAssembler.h:53
Provides declaration of FunctionExpr class.
T getArea(const gsFunctionSet< T > &geometry)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2463
ThinShellAssemblerStatus assembleMatrix(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:1676
void _initialize()
Initializes the method.
Definition: gsThinShellAssembler.hpp:226
gsMultiPatch< T > _constructSolution(const gsMatrix< T > &solVector, const gsMultiPatch< T > &undeformed) const
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2434
Struct that defines the boundary sides and corners and types of a geometric object.
Definition: gsBoundary.h:55
T interfaceErrorC0(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.h:470
This class serves as the evaluator of material matrices, based on gsMaterialMatrixBase.
Definition: gsMaterialMatrixContainer.h:33
void setSwitch(const std::string &label, const bool &value)
Sets an existing option label to be equal to value.
Definition: gsOptionList.cpp:174
std::enable_if<(_d==3)&&_bending, ThinShellAssemblerStatus >::type assemble_impl()
Specialisation of assemble() for surfaces (3D)
Definition: gsThinShellAssembler.hpp:1517
T interfaceErrorNormal(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.h:480
S give(S &x)
Definition: gsMemory.h:266
void assemble(const expr &...args)
Adds the expressions args to the system matrix/rhs The arguments are considered as integrals over the...
Definition: gsExprAssembler.h:756
Assembly failed due to an error in the expression (e.g. overflow)
#define index_t
Definition: gsConfig.h:32
#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
std::enable_if<(_d==3)&&_bending, gsMatrix< T > >::type boundaryForce_impl(const gsFunctionSet< T > &deformed, const std::vector< patchSide > &patchSides) const
Implementation of the boundary force vector for surfaces (3D)
Definition: gsThinShellAssembler.hpp:2265
EIGEN_STRONG_INLINE fform2nd_expr< T > fform2nd(const gsGeometryMap< T > &G)
The second fundamental form of G.
Definition: gsExpressions.h:4523
Provides declaration of functions writing Paraview files.
gsMatrix< T > computePrincipalStresses(const gsMatrix< T > &points, const gsFunctionSet< T > &deformed, const T z=0)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2720
ThinShellAssemblerStatus assembleMass(const bool lumped=false)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:1415
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
This class defines the base class for material matrices.
Definition: gsMaterialMatrixBase.h:32
T interfaceErrorGaussCurvature(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.h:485
gsVector< T > constructSolutionVector(const gsMultiPatch< T > &deformed) const
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2654
T getElasticEnergy(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2496
gsMultiPatch< T > constructMultiPatch(const gsMatrix< T > &solVector) const
Construct solution field from computed solution vector solVector and returns a multipatch.
Definition: gsThinShellAssembler.hpp:2580
ThinShellAssemblerStatus assemblePressureVector(const gsFunction< T > &pressFun)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2150
void projectL2_into(const gsFunction< T > &fun, gsMatrix< T > &result)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2789
const gsMatrix< T > & rhs() const
Returns the right-hand side vector(s)
Definition: gsExprAssembler.h:129
Provides an evaluator for material matrices for thin shells.
gsMatrix< T > boundaryForce(const gsFunctionSet< T > &deformed, const std::vector< patchSide > &patchSides) const
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2257
Provides declaration of gsWeightMapper class.
index_t index(index_t i, index_t k=0, index_t c=0) const
Returns the global dof index associated to local dof i of patch k.
Definition: gsDofMapper.h:325
T at(index_t i) const
Returns the i-th element of the vectorization of the matrix.
Definition: gsMatrix.h:211
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition: gsVector.h:35
void setInt(const std::string &label, const index_t &value)
Sets an existing option label to be equal to value.
Definition: gsOptionList.cpp:158
ThinShellAssemblerStatus assembleFoundation()
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:1473
Holds a set of patch-wise bases and their topology information.
Definition: gsMultiBasis.h:36
EIGEN_STRONG_INLINE onormal_expr< T > nv(const gsGeometryMap< T > &u)
The (outer pointing) boundary normal of a geometry map.
Definition: gsExpressions.h:4506
gsGeometry< T > & patch(size_t i) const
Return the i-th patch.
Definition: gsMultiPatch.h:226
T interfaceErrorG1(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.h:475
size_t nPatches() const
Number of patches.
Definition: gsMultiPatch.h:208
ThinShellAssemblerStatus assembleVector(const gsFunctionSet< T > &deformed, const bool homogenize=true)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:1957
gsMultiPatch< T > constructDisplacement(const gsMatrix< T > &solVector) const
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2636
Assembles the system matrix and vectors for 2D and 3D shell problems, including geometric nonlinearit...
Definition: gsThinShellAssembler.h:76
T deformationNorm(const gsMultiPatch< T > &deformed, const gsMultiPatch< T > &original)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2852
Definition: gsDirichletValues.h:23
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
T at(index_t i) const
Returns the i-th element of the vector.
Definition: gsVector.h:177
void eval(const expr::_expr< E > &expr, gsGridIterator< T, mode, d > &git, const index_t patchInd=0)
geometryMap getMap(const gsFunctionSet< T > &g)
Registers g as an isogeometric geometry map and return a handle to it.
Definition: gsExprAssembler.h:161
Provides declaration of a gsPiecewiseFunction class.
gsOptionList wrapIntoGroup(const std::string &gn) const
Creates a new gsOptionList where all labels are wrapped into a groupname gn.
Definition: gsOptionList.cpp:284
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
Generic evaluator of isogeometric expressions.
Definition: gsExprEvaluator.h:38
space getSpace(const gsFunctionSet< T > &mp, index_t dim=1, index_t id=0)
Definition: gsExprAssembler.h:166
ThinShellAssemblerStatus assembleFoundationVector(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2227
Provides hyperelastic material matrices.
void update(const gsOptionList &other, updateType type=ignoreIfUnknown)
Updates the object using the data from other.
Definition: gsOptionList.cpp:253
type
Definition: gsThinShellFunctions.h:40
void clear()
Clear (delete) all functions.
Definition: gsPiecewiseFunction.h:148
void setOptions(gsOptionList &options)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:212
EIGEN_STRONG_INLINE reshape_expr< E > const reshape(E const &u, index_t n, index_t m)
Reshape an expression.
Definition: gsExpressions.h:1925
gsThinShellAssembler & operator=(const gsThinShellAssembler &other)
Assignment operator.
Definition: gsThinShellAssembler.hpp:84
ThinShellAssemblerStatus assemblePressureMatrix(const gsFunction< T > &pressFun)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2088
EIGEN_STRONG_INLINE flat_expr< E > const flat(E const &u)
Make a matrix 2x2 expression "flat".
Definition: gsExpressions.h:2031
Class containing a set of boundary conditions.
Definition: gsBoundaryConditions.h:341
Class defining a multivariate (real or vector) function given by a string mathematical expression...
Definition: gsFunctionExpr.h:51
EIGEN_STRONG_INLINE grad_expr< E > grad(const E &u)
The gradient of a variable.
Definition: gsExpressions.h:4490
Provides gsBoundaryConditions class.
gsMatrix< T > computePrincipalStretches(const gsMatrix< T > &points, const gsFunctionSet< T > &deformed, const T z=0)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2690
T getDisplacementNorm(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2477
ThinShellAssemblerStatus assemble()
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:1502
Provides a base class for material matrices.
#define GISMO_ERROR(message)
Definition: gsDebug.h:118
gsMatrix< T > projectL2(const gsFunction< T > &fun)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2842
EIGEN_STRONG_INLINE meas_expr< T > meas(const gsGeometryMap< T > &G)
The measure of a geometry map.
Definition: gsExpressions.h:4555
EIGEN_STRONG_INLINE abs_expr< E > abs(const E &u)
Absolute value.
Definition: gsExpressions.h:4486
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
T interfaceErrorMeanCurvature(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.h:490
A function depending on an index i, typically referring to a patch/sub-domain. On each patch a differ...
Definition: gsPiecewiseFunction.h:28
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:323
gsThinShellAssembler()
Constructor for te shell assembler.
Definition: gsThinShellAssembler.h:129
gsMatrix< T > fullSolutionVector(const gsMatrix< T > &vector) const
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2642
void setIntegrationElements(const gsMultiBasis< T > &mesh)
Sets the domain of integration.
Definition: gsExprAssembler.h:136
gsMultiPatch< T > constructSolution(const gsMatrix< T > &solVector) const
Construct deformed shell geometry from computed solution vector solVector and returns a multipatch...
Definition: gsThinShellAssembler.hpp:2445
Provides linear and nonlinear assemblers for thin shells.
void initSystem(const index_t numRhs=1)
Initializes the sparse system (sparse matrix and rhs)
Definition: gsExprAssembler.h:290
variable getCoeff(const gsFunctionSet< T > &func)
Definition: gsExprAssembler.h:260
std::enable_if<(_d==3)&&_bending, ThinShellAssemblerStatus >::type assembleMatrix_impl(const gsFunctionSet< T > &deformed)
Implementation of assembleMatrix for surfaces (3D)
Definition: gsThinShellAssembler.hpp:1684
Class defining a globally constant function.
Definition: gsConstantFunction.h:33
EIGEN_STRONG_INLINE jac_expr< E > jac(const symbol_expr< E > &u)
The Jacobian matrix of a FE variable.
Definition: gsExpressions.h:4528
void plotSolution(std::string string, const gsMatrix< T > &solVector)
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:2520
void homogenizeDirichlet()
See gsThinShellAssemblerBase for details.
Definition: gsThinShellAssembler.hpp:1293