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 auto m_physforce = m_assembler.getCoeff(*m_forceFun,m_ori);
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 if (m_parametricForce)
1678 m_assembler.assemble(m_space * m_parforce *
meas(m_ori));
1680 m_assembler.assemble(m_space * m_physforce *
meas(m_ori));
1682 this->_assembleWeakBCs<true>();
1683 this->_assembleWeakBCs<false>();
1684 this->_assembleWeakIfc<true>();
1685 this->_assembleWeakIfc<false>();
1686 this->_assembleNeumann();
1689 if ( m_pLoads.numLoads() != 0 )
1691 m_rhs = m_assembler.rhs();
1699 m_assembler.cleanUp();
1705template<
short_t d,
class T,
bool bending>
1708 return assembleMatrix_impl<d, bending>(deformed);
1711template <
short_t d,
typename T,
bool bending>
1712template <
short_t _d,
bool _bending>
1716 m_assembler.cleanUp();
1717 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1718 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1720 geometryMap m_ori = m_assembler.getMap(m_patches);
1721 geometryMap m_def = m_assembler.getMap(deformed);
1724 m_assembler.initSystem();
1725 m_assembler.initMatrix();
1727 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1728 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixB> m_mmB(m_materialMatrices,&m_patches,&deformed);
1729 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixC> m_mmC(m_materialMatrices,&m_patches,&deformed);
1730 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&deformed);
1731 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
1732 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1(m_materialMatrices,&m_patches,&deformed);
1733 auto mmA = m_assembler.getCoeff(m_mmA);
1734 auto mmB = m_assembler.getCoeff(m_mmB);
1735 auto mmC = m_assembler.getCoeff(m_mmC);
1736 auto mmD = m_assembler.getCoeff(m_mmD);
1737 auto S0 = m_assembler.getCoeff(m_S0);
1738 auto S1 = m_assembler.getCoeff(m_S1);
1741 auto m_m2 = m_assembler.getCoeff(mult2t);
1743 space m_space = m_assembler.trialSpace(0);
1745 this->homogenizeDirichlet();
1748 auto m_Em_der = flat( jac(m_def).tr() * jac(m_space) ) ;
1749 auto m_Em_der2 = flatdot( jac(m_space),jac(m_space).tr(), m_N );
1753 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);
1754 auto m_Ef_der2 = -(flatdot2( deriv2(m_space), var1(m_space,m_def).tr(), m_M ).symmetrize()
1755 + var2deriv2(m_space,m_space,m_def, m_M ));
1757 auto m_N_der = m_Em_der * reshape(mmA,3,3) + m_Ef_der * reshape(mmB,3,3);
1758 auto m_M_der = m_Em_der * reshape(mmC,3,3) + m_Ef_der * reshape(mmD,3,3);
1762 if (m_foundInd) this->_assembleFoundation<true>(*m_foundFun,deformed);
1763 if (m_pressInd) this->_assemblePressure<true>(*m_pressFun,deformed);
1766 m_assembler.assemble(
1768 m_N_der * m_Em_der.tr()
1772 m_M_der * m_Ef_der.tr()
1778 this->_assembleWeakBCs<true>(deformed);
1779 this->_assembleWeakIfc<true>(deformed);
1785 m_assembler.cleanUp();
1791template <
short_t d,
typename T,
bool bending>
1792template <
short_t _d,
bool _bending>
1796 m_assembler.cleanUp();
1797 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1798 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1800 geometryMap m_ori = m_assembler.getMap(m_patches);
1801 geometryMap m_def = m_assembler.getMap(deformed);
1804 m_assembler.initSystem();
1805 m_assembler.initMatrix();
1807 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1808 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
1809 auto mmA = m_assembler.getCoeff(m_mmA);
1810 auto S0 = m_assembler.getCoeff(m_S0);
1812 space m_space = m_assembler.trialSpace(0);
1815 this->homogenizeDirichlet();
1818 auto m_Em_der = flat( jac(m_def).tr() * jac(m_space) ) ;
1819 auto m_Em_der2 = flatdot( jac(m_space),jac(m_space).tr(), m_N );
1821 auto m_N_der = m_Em_der * reshape(mmA,3,3);
1826 if (m_foundInd) this->_assembleFoundation<true>(*m_foundFun,deformed);
1827 if (m_pressInd) this->_assemblePressure<true>(*m_pressFun,deformed);
1829 m_assembler.assemble(
1831 m_N_der * m_Em_der.tr()
1836 this->_assembleWeakBCs<true>(deformed);
1837 this->_assembleWeakIfc<true>(deformed);
1843 m_assembler.cleanUp();
1849template<
short_t d,
class T,
bool bending>
1853 constructSolution(solVector, def);
1854 return assembleMatrix(def);
1857template<
short_t d,
class T,
bool bending>
1860 return assembleMatrix_impl<d, bending>(deformed, previous, update);
1863template <
short_t d,
typename T,
bool bending>
1864template <
short_t _d,
bool _bending>
1868 m_assembler.cleanUp();
1869 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1870 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1872 geometryMap m_ori = m_assembler.getMap(m_patches);
1873 geometryMap m_def = m_assembler.getMap(deformed);
1874 geometryMap m_prev = m_assembler.getMap(previous);
1876 m_assembler.initSystem();
1877 m_assembler.initMatrix();
1879 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmA(m_materialMatrices,&m_patches,&deformed);
1880 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixB> m_mmB(m_materialMatrices,&m_patches,&deformed);
1881 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixC> m_mmC(m_materialMatrices,&m_patches,&deformed);
1882 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmD(m_materialMatrices,&m_patches,&deformed);
1883 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
1884 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1(m_materialMatrices,&m_patches,&deformed);
1885 auto mmA = m_assembler.getCoeff(m_mmA);
1886 auto mmB = m_assembler.getCoeff(m_mmB);
1887 auto mmC = m_assembler.getCoeff(m_mmC);
1888 auto mmD = m_assembler.getCoeff(m_mmD);
1892 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixA> m_mmAd(m_materialMatrices,&m_patches,&previous);
1893 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixB> m_mmBd(m_materialMatrices,&m_patches,&previous);
1894 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixC> m_mmCd(m_materialMatrices,&m_patches,&previous);
1895 gsMaterialMatrixIntegrate<T,MaterialOutput::MatrixD> m_mmDd(m_materialMatrices,&m_patches,&previous);
1896 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0d(m_materialMatrices,&m_patches,&previous);
1897 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1d(m_materialMatrices,&m_patches,&previous);
1898 auto mmAp = m_assembler.getCoeff(m_mmAd);
1899 auto mmBp = m_assembler.getCoeff(m_mmBd);
1900 auto mmCp = m_assembler.getCoeff(m_mmCd);
1901 auto mmDp = m_assembler.getCoeff(m_mmDd);
1902 auto S0 = m_assembler.getCoeff(m_S0d);
1903 auto S1 = m_assembler.getCoeff(m_S1d);
1906 auto m_m2 = m_assembler.getCoeff(mult2t);
1908 space m_space = m_assembler.trialSpace(0);
1909 solution m_du = m_assembler.getSolution(m_space,update);
1911 this->homogenizeDirichlet();
1913 auto m_E_mc = flat( jac(m_prev).tr() * grad(m_du) ) ;
1914 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);
1915 auto m_N_c = m_E_mc * reshape(mmAp,3,3) + m_E_fc * reshape(mmBp,3,3);
1916 auto m_M_c = m_E_mc * reshape(mmCp,3,3) + m_E_fc * reshape(mmDp,3,3);
1918 auto m_N = S0.tr() + m_N_c;
1919 auto m_Em_der = flat( jac(m_def).tr() * jac(m_space) ) ;
1920 auto m_Em_der2 = flatdot( jac(m_space),jac(m_space).tr(), m_N );
1922 auto m_M = S1.tr() + m_M_c;
1923 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);
1924 auto m_Ef_der2 = -(flatdot2( deriv2(m_space), var1(m_space,m_def).tr(), m_M ).symmetrize()
1925 + var2deriv2(m_space,m_space,m_def, m_M ));
1927 auto m_N_der = m_Em_der * reshape(mmA,3,3) + m_Ef_der * reshape(mmB,3,3);
1928 auto m_M_der = m_Em_der * reshape(mmC,3,3) + m_Ef_der * reshape(mmD,3,3);
1932 if (m_foundInd) this->_assembleFoundation<true>(*m_foundFun,deformed);
1933 if (m_pressInd) this->_assemblePressure<true>(*m_pressFun,deformed);
1936 m_assembler.assemble(
1938 m_N_der * m_Em_der.tr()
1942 m_M_der * m_Ef_der.tr()
1947 this->_assembleWeakBCs<true>(deformed);
1948 this->_assembleWeakIfc<true>(deformed);
1954 m_assembler.cleanUp();
1968template<
short_t d,
class T,
bool bending>
1976 constructSolution(solVector, def);
1977 constructSolution(prevVector, it);
1979 return assembleMatrix(def,it,update);
1982template<
short_t d,
class T,
bool bending>
1985 return assembleVector_impl<d, bending>(deformed,homogenize);
1988template <
short_t d,
typename T,
bool bending>
1989template <
short_t _d,
bool _bending>
1993 m_assembler.cleanUp();
1994 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
1995 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
1997 geometryMap m_ori = m_assembler.getMap(m_patches);
1998 geometryMap m_def = m_assembler.getMap(deformed);
2001 m_assembler.initVector(1);
2003 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
2004 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1(m_materialMatrices,&m_patches,&deformed);
2005 auto S0 = m_assembler.getCoeff(m_S0);
2006 auto S1 = m_assembler.getCoeff(m_S1);
2009 auto m_m2 = m_assembler.getCoeff(mult2t);
2011 space m_space = m_assembler.trialSpace(0);
2012 auto m_physforce = m_assembler.getCoeff(*m_forceFun,m_ori);
2013 auto m_parforce = m_assembler.getCoeff(*m_forceFun);
2016 if (homogenize) this->homogenizeDirichlet();
2017 else this->_assembleDirichlet();
2020 auto m_Em_der = flat( jac(m_def).tr() * jac(m_space) ) ;
2023 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);
2027 if (m_foundInd) this->_assembleFoundation<false>(*m_foundFun,deformed);
2028 if (m_pressInd) this->_assemblePressure<false>(*m_pressFun,deformed);
2032 if (m_parametricForce)
2033 m_assembler.assemble(m_space * m_parforce * meas(m_ori));
2035 m_assembler.assemble(m_space * m_physforce * meas(m_ori));
2038 m_assembler.assemble(
2040 - ( ( m_N * m_Em_der.tr() + m_M * m_Ef_der.tr() ) * meas(m_ori) ).tr()
2044 this->_assembleWeakBCs<false>(deformed);
2045 this->_assembleWeakIfc<false>(deformed);
2046 this->_assembleNeumann();
2049 if ( m_pLoads.numLoads() != 0 )
2051 m_rhs = m_assembler.rhs();
2059 m_assembler.cleanUp();
2065template <
short_t d,
typename T,
bool bending>
2066template <
short_t _d,
bool _bending>
2070 m_assembler.cleanUp();
2071 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2072 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2074 geometryMap m_ori = m_assembler.getMap(m_patches);
2075 geometryMap m_def = m_assembler.getMap(deformed);
2078 m_assembler.initVector(1);
2080 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
2081 auto S0 = m_assembler.getCoeff(m_S0);
2083 space m_space = m_assembler.trialSpace(0);
2084 auto m_physforce = m_assembler.getCoeff(*m_forceFun,m_ori);
2085 auto m_parforce = m_assembler.getCoeff(*m_forceFun);
2087 if (homogenize) this->homogenizeDirichlet();
2088 else this->_assembleDirichlet();
2091 auto m_Em_der = flat( jac(m_def).tr() * jac(m_space) ) ;
2095 if (m_foundInd) this->_assembleFoundation<false>(*m_foundFun,deformed);
2096 if (m_pressInd) this->_assemblePressure<false>(*m_pressFun,deformed);
2100 if (m_parametricForce)
2101 m_assembler.assemble(m_space * m_parforce * meas(m_ori));
2103 m_assembler.assemble(m_space * m_physforce * meas(m_ori));
2106 m_assembler.assemble(
2108 - ( ( m_N * m_Em_der.tr() ) * meas(m_ori) ).tr()
2112 this->_assembleWeakBCs<false>(deformed);
2113 this->_assembleWeakIfc<false>(deformed);
2114 this->_assembleNeumann();
2117 if ( m_pLoads.numLoads() != 0 )
2119 m_rhs = m_assembler.rhs();
2127 m_assembler.cleanUp();
2133template<
short_t d,
class T,
bool bending>
2138 this->_assemblePressure<true>(pressFun);
2148template<
short_t d,
class T,
bool bending>
2154 this->_assemblePressure<true>(pressFun);
2164template<
short_t d,
class T,
bool bending>
2169 this->_assemblePressure<true>(pressFun,deformed);
2179template<
short_t d,
class T,
bool bending>
2185 this->_assemblePressure<true>(pressFun, deformed);
2195template<
short_t d,
class T,
bool bending>
2200 this->_assemblePressure<false>(pressFun);
2210template<
short_t d,
class T,
bool bending>
2216 this->_assemblePressure<false>(pressFun);
2226template<
short_t d,
class T,
bool bending>
2231 this->_assemblePressure<false>(pressFun,deformed);
2241template<
short_t d,
class T,
bool bending>
2247 this->_assemblePressure<false>(pressFun, deformed);
2257template<
short_t d,
class T,
bool bending>
2262 this->assemblePressureVector(*m_pressFun,deformed);
2272template<
short_t d,
class T,
bool bending>
2277 this->assembleFoundationVector(*m_foundFun,deformed);
2287template<
short_t d,
class T,
bool bending>
2292 this->_assembleFoundation<false>(foundFun,deformed);
2302template<
short_t d,
class T,
bool bending>
2305 return boundaryForce_impl<d, bending>(deformed,patchSides);
2308template <
short_t d,
typename T,
bool bending>
2309template <
short_t _d,
bool _bending>
2310typename std::enable_if<(_d==3) && _bending,
gsMatrix<T> >::type
2314 assembler.setIntegrationElements(m_basis);
2315 space u = assembler.getSpace(*m_spaceBasis, d, 0);
2318 u.setup(bc, dirichlet::l2Projection, m_continuity);
2325 std::vector<std::unordered_set<index_t>> indices(d);
2327 for (std::vector<patchSide>::const_iterator bdr = patchSides.begin(); bdr != patchSides.end(); bdr++)
2329 boundary = mbasis->basis(bdr->patch).boundary(bdr->side());
2332 indices[c].insert(u.mapper().index(
boundary.at(k),bdr->patch,c));
2335 assembler.initSystem();
2337 geometryMap m_ori = assembler.getMap(m_patches);
2338 geometryMap m_def = assembler.getMap(deformed);
2343 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
2344 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1(m_materialMatrices,&m_patches,&deformed);
2345 auto S0 = assembler.getCoeff(m_S0);
2346 auto S1 = assembler.getCoeff(m_S1);
2349 auto m_m2 = assembler.getCoeff(mult2t);
2354 auto m_Em_der = flat( jac(m_def).tr() * jac(u) ) ;
2357 auto m_Ef_der = -( deriv2(u,sn(m_def).normalized().tr() ) + deriv2(m_def,var1(u,m_def) ) ) * reshape(m_m2,3,3);
2363 - ( ( m_N * m_Em_der.tr() + m_M * m_Ef_der.tr() ) * meas(m_ori) ).tr()
2368 GISMO_ERROR(
"Assembly of the force vector failed.");
2372 for (
index_t c = 0; c != d; c++)
2373 for (std::unordered_set<index_t>::const_iterator it = indices[c].begin(); it!=indices[c].end(); it++)
2374 F[c] += assembler.rhs().at(*it);
2382template <
short_t d,
typename T,
bool bending>
2383template <
short_t _d,
bool _bending>
2384typename std::enable_if<!(_d==3 && _bending),
gsMatrix<T> >::type
2388 assembler.setIntegrationElements(m_basis);
2389 space u = assembler.getSpace(*m_spaceBasis, d, 0);
2392 u.setup(bc, dirichlet::l2Projection, m_continuity);
2399 std::vector<std::unordered_set<index_t>> indices(d);
2401 for (std::vector<patchSide>::const_iterator bdr = patchSides.begin(); bdr != patchSides.end(); bdr++)
2403 boundary = mbasis->basis(bdr->patch).boundary(bdr->side());
2406 indices[c].insert(u.mapper().index(
boundary.at(k),bdr->patch,c));
2409 assembler.initSystem();
2411 geometryMap m_ori = assembler.getMap(m_patches);
2412 geometryMap m_def = assembler.getMap(deformed);
2417 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&m_patches,&deformed);
2418 auto S0 = assembler.getCoeff(m_S0);
2423 auto m_Em_der = flat( jac(m_def).tr() * jac(u) ) ;
2429 - ( ( m_N * m_Em_der.tr() ) * meas(m_ori) ).tr()
2434 GISMO_ERROR(
"Assembly of the force vector failed.");
2438 for (
index_t c = 0; c != d; c++)
2439 for (std::unordered_set<index_t>::const_iterator it = indices[c].begin(); it!=indices[c].end(); it++)
2440 F[c] += assembler.rhs().at(*it);
2448template<
short_t d,
class T,
bool bending>
2452 constructSolution(solVector, def);
2453 return assembleVector(def,homogenize);
2456template<
short_t d,
class T,
bool bending>
2458 const bool Matrix,
const bool homogenize)
2463 status = assembleMatrix(deformed);
2468 return assembleVector(deformed,homogenize);
2470template<
short_t d,
class T,
bool bending>
2472 const bool Matrix,
const bool homogenize)
2475 constructSolution(solVector, def);
2476 return assemble(def,Matrix,homogenize);
2479template <
short_t d,
class T,
bool bending>
2484 for (
size_t k =0; k!=displacement.
nPatches(); ++k)
2485 mp.patch(k).coefs() += displacement.
patch(k).coefs();;
2490template <
short_t d,
class T,
bool bending>
2493 return _constructSolution(solVector,m_patches);
2496template <
short_t d,
class T,
bool bending>
2499 deformed = _constructSolution(solVector,m_patches);
2502template <
short_t d,
class T,
bool bending>
2505 mp = _constructSolution(solVector,mp);
2508template<
short_t d,
class T,
bool bending>
2511 m_assembler.cleanUp();
2512 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2513 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2515 geometryMap G = m_assembler.getMap(geometry);
2518 T result = evaluator.
integral(meas(G));
2522template<
short_t d,
class T,
bool bending>
2525 m_assembler.cleanUp();
2526 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2527 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2529 geometryMap m_ori = m_assembler.getMap(m_patches);
2530 geometryMap m_def = m_assembler.getMap(deformed);
2532 auto u = m_def - m_ori;
2535 T result = evaluator.
integral( u.tr() * u * meas(m_def));
2536 T area = evaluator.
integral(meas(m_ori));
2538 return std::pow(result/area,0.5);
2541template<
short_t d,
class T,
bool bending>
2544 m_assembler.cleanUp();
2545 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2546 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2548 geometryMap m_ori = m_assembler.getMap(m_patches);
2549 geometryMap m_def = m_assembler.getMap(deformed);
2551 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorN> m_S0(m_materialMatrices,&deformed);
2552 gsMaterialMatrixIntegrate<T,MaterialOutput::VectorM> m_S1(m_materialMatrices,&deformed);
2553 auto S0 = m_assembler.getCoeff(m_S0);
2554 auto S1 = m_assembler.getCoeff(m_S1);
2555 auto u = m_def - m_ori;
2561 T result = evaluator.
integral(0.5 * ( u.tr() * ( m_N + m_M ).tr() ) * meas(m_def));
2565template<
short_t d,
class T,
bool bending>
2568 m_solvector = solVector;
2569 space m_space = m_assembler.trialSpace(0);
2570 solution m_solution = m_assembler.getSolution(m_space, m_solvector);
2571 geometryMap G = m_assembler.getMap(m_patches);
2573 ev.options().
setSwitch(
"plot.elements",
false);
2574 ev.options().
setInt (
"plot.npts" , 500);
2578template<
short_t d,
class T,
bool bending>
2581 geometryMap G = m_assembler.getMap(deformed);
2583 ev.integralInterface( ( G.left() - G.right() ).sqNorm() , iFaces);
2588template<
short_t d,
class T,
bool bending>
2591 geometryMap G = m_assembler.getMap(deformed);
2592 gsExprEvaluator<T> ev(m_assembler);
2593 ev.integralInterface( (sn(G.left()).normalized()-sn(G.right()).normalized()).sqNorm() , iFaces);
2598template<
short_t d,
class T,
bool bending>
2601 geometryMap G = m_assembler.getMap(deformed);
2602 gsExprEvaluator<T> ev(m_assembler);
2603 ev.maxInterface( (sn(G.left())-sn(G.right())).norm() , iFaces);
2607template<
short_t d,
class T,
bool bending>
2610 geometryMap G = m_assembler.getMap(deformed);
2611 gsExprEvaluator<T> ev(m_assembler);
2612 ev.maxInterface(
abs( (fform(G.left() ).inv()*
fform2nd(G.left() )).det() -
2613 (fform(G.right()).inv()*
fform2nd(G.right())).det() ) , iFaces);
2616template<
short_t d,
class T,
bool bending>
2619 geometryMap G = m_assembler.getMap(deformed);
2620 gsExprEvaluator<T> ev(m_assembler);
2621 ev.maxInterface(
abs( (fform(G.left() ).inv()*
fform2nd(G.left() )).trace().val() -
2622 (fform(G.right()).inv()*
fform2nd(G.right())).trace().val() ) , iFaces);
2625template<
short_t d,
class T,
bool bending>
2628 m_solvector = solVector;
2629 space m_space = m_assembler.trialSpace(0);
2630 m_space.setup(m_bcs, dirichlet::l2Projection, m_continuity);
2633 if (
const gsMappedBasis<2,T> * mbasis =
dynamic_cast<const gsMappedBasis<2,T> *
>(m_spaceBasis))
2636 const index_t dim = m_space.dim();
2637 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());
2643 for (
index_t p =0; p!=m_patches.nPieces(); ++p)
2645 for (
index_t c = 0; c!=dim; c++)
2648 for (
size_t i = 0; i < m_mapper.patchSize(p,c); ++i)
2650 const index_t ii = m_mapper.index(i, p, c);
2651 if ( m_mapper.is_free_index(ii) )
2652 cc(i,c) = m_solvector.
at(ii);
2655 cc(i,c) = m_ddofs.
at( m_mapper.global_to_bindex(ii) );
2662 mbasis->global_coef_to_local_coef(cc,tmp);
2663 return mbasis->exportToPatches(tmp);
2669 solution m_solution = m_assembler.getSolution(m_space, m_solvector);
2672 for (
index_t p =0; p!=m_patches.nPieces(); ++p)
2674 m_solution.extract(cc, p);
2675 result.
addPatch(m_basis.basis(p).makeGeometry(
give(cc) ));
2681template<
short_t d,
class T,
bool bending>
2684 return constructMultiPatch(solVector);
2687template<
short_t d,
class T,
bool bending>
2691 space m_space = m_assembler.trialSpace(0);
2692 m_space.setup(m_bcs, dirichlet::l2Projection, m_continuity);
2693 solution m_solution = m_assembler.getSolution(m_space, solVector);
2695 m_solution.extractFull(result);
2696 return result.col(0);
2699template<
short_t d,
class T,
bool bending>
2704 for (
size_t p=0; p!=displacements.
nPatches(); p++)
2706 for (
size_t dim = 0; dim!=d; dim++)
2708 for (
size_t k=0; k!=m_mapper.patchSize(p,dim); k++)
2710 if (m_mapper.is_free(k,p,dim))
2712 result.
at(m_mapper.index(k,p,dim)) = displacements.
patch(p).coefs()(k,dim);
2721template<
short_t d,
class T,
bool bending>
2724 deformed = constructDisplacement(solVector);
2735template<
short_t d,
class T,
bool bending>
2745 this->_getOptions();
2747 m_assembler.cleanUp();
2748 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2749 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2755 gsMaterialMatrixEval<T,MaterialOutput::Stretch> m_mm(m_materialMatrices,&deformed,zmat);
2756 auto mm0 = m_assembler.getCoeff(m_mm);
2760 for (
index_t k = 0; k != u.cols(); ++k)
2761 result.col(k) = evaluator.
eval(mm0,u.col(k));
2765template <
short_t d,
class T,
bool bending>
2775 this->_getOptions();
2777 m_assembler.cleanUp();
2778 GISMO_ENSURE(m_options.hasGroup(
"ExprAssembler"),
"The option list does not contain options with the label 'ExprAssembler'!");
2779 m_assembler.setOptions(m_options.getGroup(
"ExprAssembler"));
2785 gsMaterialMatrixEval<T,MaterialOutput::PStress> m_mm(m_materialMatrices,&deformed,zmat);
2786 auto mm0 = m_assembler.getCoeff(m_mm);
2790 for (
index_t k = 0; k != u.cols(); ++k)
2792 result.col(k) = evaluator.
eval(mm0,u.col(k));
2797template<
short_t d,
class T,
bool bending>
2802 constructStress(m_patches,deformed,result,type);
2805template<
short_t d,
class T,
bool bending>
2814 for (
size_t p = 0; p < m_patches.nPatches(); ++p )
2834template<
short_t d,
class T,
bool bending>
2862template<
short_t d,
class T,
bool bending>
2871 space m_space = m_assembler.trialSpace(0);
2872 m_space.setup(m_bcs, dirichlet::l2Projection, m_continuity);
2875 solution m_solution = m_assembler.getSolution(m_space, tmp);
2878 for (
size_t k =0; k!=mp.nPatches(); ++k)
2881 m_solution.extract(cc, k);
2882 mp.patch(k).coefs() += cc;
2887template<
short_t d,
class T,
bool bending>
2893 this->projectL2_into(fun,result);
2897template <
short_t d,
class T,
bool bending>
2900 m_assembler.cleanUp();
2901 m_assembler.setOptions(m_options);
2903 geometryMap ori = m_assembler.getMap(original);
2904 geometryMap def = m_assembler.getMap(deformed);
2907 T result = evaluator.
integral(def.sqNorm() * meas(ori));
2911template<
short_t d,
class T,
bool bending>
2914 geometryMap m_ori = m_assembler.getMap(m_patches);
2920 for (gsBoxTopology::const_iiterator it = m_patches.topology().iBegin(); it!=m_patches.topology().iEnd(); it++)
2923 ev.integralInterface( (sn(m_ori.left()).normalized()-sn(m_ori.right()).normalized()).sqNorm() );
2930 if (ev.value() < tol)
2931 m_inPlane.push_back(*it);
2933 m_outPlane.push_back(*it);
2937template<
short_t d,
class T,
bool bending>
2938bool gsThinShellAssembler<d, T, bending>::_isInPlane(
const boundaryInterface & ,
const T tol)
2940 geometryMap m_ori = m_assembler.getMap(m_patches);
2941 gsExprEvaluator<T> ev(m_assembler);
2944 ev.integralInterface( (sn(m_ori.left()).normalized()-sn(m_ori.right()).normalized()).sqNorm() );
2951 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:2303
ThinShellAssemblerStatus assembleFoundationVector(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2273
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:2523
gsMultiPatch< T > constructDisplacement(const gsMatrix< T > &solVector) const
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2682
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:2898
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:2766
ThinShellAssemblerStatus assembleVector(const gsFunctionSet< T > &deformed, const bool homogenize=true)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:1983
void plotSolution(std::string string, const gsMatrix< T > &solVector)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2566
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:2509
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:2196
T getElasticEnergy(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2542
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:2798
gsMatrix< T > fullSolutionVector(const gsMatrix< T > &vector) const
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2688
ThinShellAssemblerStatus assembleMatrix(const gsFunctionSet< T > &deformed)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:1706
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:2491
void projectL2_into(const gsFunction< T > &fun, gsMatrix< T > &result)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2835
gsMultiPatch< T > constructMultiPatch(const gsMatrix< T > &solVector) const
Construct solution field from computed solution vector solVector and returns a multipatch.
Definition gsThinShellAssembler.hpp:2626
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:2700
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:2888
gsMultiPatch< T > _constructSolution(const gsMatrix< T > &solVector, const gsMultiPatch< T > &undeformed) const
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2480
void homogenizeDirichlet()
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:1314
ThinShellAssemblerStatus assemblePressureMatrix(const gsFunction< T > &pressFun)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2134
gsMatrix< T > computePrincipalStretches(const gsMatrix< T > &points, const gsFunctionSet< T > &deformed, const T z=0)
See gsThinShellAssemblerBase for details.
Definition gsThinShellAssembler.hpp:2736
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