28 gsMultiPatch<T> gsPanelCreator<T>::Plate(T
const & Lp, T
const & Wp, T
const & x, T
const & y, T
const & z)
30 gsMultiPatch<T> result;
32 gsKnotVector<T> KV (0,1,0,2) ;
36 C.row(1)<< Lp+x ,y ,z;
37 C.row(2)<< x ,Wp+y ,z;
38 C.row(3)<< Lp+x ,Wp+y ,z;
40 result.addPatch(gsTensorBSpline<2,T>(KV,KV,
give(C)));
46 gsMultiPatch<T> gsPanelCreator<T>::Strip(T
const & Lb, T
const & Hw, T
const & x, T
const & y, T
const & z)
48 gsMultiPatch<T> result;
50 gsKnotVector<T> KV (0,1,0,2) ;
55 C.row(2)<< x ,y ,Hw+z;
56 C.row(3)<< Lb+x,y ,Hw+z;
58 result.addPatch(gsTensorBSpline<2,T>(KV,KV,
give(C)));
64 gsMultiPatch<T> gsPanelCreator<T>::IBeam(T
const & Lb, T
const & Hw, T
const & Wf, T
const & x, T
const & y, T
const & z)
66 gsMultiPatch<T> result;
70 tmp = Strip(Lb,Hw,0,0,-Hw/2.);
71 result.addPatch(tmp.patch(0));
73 tmp = Plate(Lb,Wf/2.,0,0,Hw/2.);
74 result.addPatch(tmp.patch(0));
76 tmp = Plate(Lb,Wf/2.,0,-Wf/2.,Hw/2.);
77 result.addPatch(tmp.patch(0));
79 tmp = Plate(Lb,Wf/2.,0,0,-Hw/2.);
80 result.addPatch(tmp.patch(0));
82 tmp = Plate(Lb,Wf/2.,0,-Wf/2.,-Hw/2.);
83 result.addPatch(tmp.patch(0));
85 for (
size_t p = 0; p!=result.nPatches(); p++)
87 result.patch(p).coefs().col(0).array() += x;
88 result.patch(p).coefs().col(1).array() += y;
89 result.patch(p).coefs().col(2).array() += z;
92 result.computeTopology();
93 result.addAutoBoundaries();
98 gsMultiPatch<T> gsPanelCreator<T>::TBeam(T
const & Lb, T
const & Hw, T
const & Wf, T
const & x, T
const & y, T
const & z)
100 gsMultiPatch<T> result;
104 tmp = Strip(Lb,Hw,0,0,0);
105 result.addPatch(tmp.patch(0));
108 tmp = Plate(Lb,Wf/2,0,0,Hw);
109 result.addPatch(tmp.patch(0));
112 tmp = Plate(Lb,Wf/2,0,-Wf/2,Hw);
113 result.addPatch(tmp.patch(0));
115 for (
size_t p = 0; p!=result.nPatches(); p++)
117 result.patch(p).coefs().col(0).array() += x;
118 result.patch(p).coefs().col(1).array() += y;
119 result.patch(p).coefs().col(2).array() += z;
122 result.computeTopology();
128 result.addAutoBoundaries();
133 gsMultiPatch<T> gsPanelCreator<T>::LBeam(T
const & Lb, T
const & Hw, T
const & Wf, T
const & x, T
const & y, T
const & z)
135 gsMultiPatch<T> result;
139 tmp = Strip(Lb,Hw,0,0,0);
140 for (
size_t p=0; p!=tmp.nPatches(); p++)
141 result.addPatch(tmp.patch(p));
144 tmp = Plate(Lb,Wf,0,0,Hw);
145 for (
size_t p=0; p!=tmp.nPatches(); p++)
146 result.addPatch(tmp.patch(p));
148 for (
size_t p = 0; p!=result.nPatches(); p++)
150 result.patch(p).coefs().col(0).array() += x;
151 result.patch(p).coefs().col(1).array() += y;
152 result.patch(p).coefs().col(2).array() += z;
155 result.addInterface(&result.patch(0),4,&result.patch(1),1);
157 result.addAutoBoundaries();
163 gsMultiPatch<T> gsPanelCreator<T>::PanelT(T
const & Lp, T
const & Wp, T
const & Hw, T
const & Wf, T
const & x, T
const & y, T
const & z)
166 gsMultiPatch<T> result;
171 tmp = Plate(Lp,Wp/2,0,0,0);
172 for (
size_t p=0; p!=tmp.nPatches(); p++)
173 result.addPatch(tmp.patch(p));
176 tmp = Plate(Lp,Wp/2,0,-Wp/2,0);
177 for (
size_t p=0; p!=tmp.nPatches(); p++)
178 result.addPatch(tmp.patch(p));
181 gsMultiPatch<> beam = TBeam(Lp,Hw,Wf);
183 for (
size_t p=0; p!=beam.nPatches(); p++)
184 result.addPatch(beam.patch(p));
186 for (
size_t p = 0; p!=result.nPatches(); p++)
188 result.patch(p).coefs().col(0).array() += x;
189 result.patch(p).coefs().col(1).array() += y;
190 result.patch(p).coefs().col(2).array() += z;
198 result.computeTopology();
199 result.addAutoBoundaries();
205 gsMultiPatch<T> gsPanelCreator<T>::PanelStrip(T
const & Lp, T
const & Wp, T
const & Hw, T
const & x, T
const & y, T
const & z)
207 gsMultiPatch<T> result, tmp;
208 std::vector<gsMultiPatch<T>> panels(3);
209 panels.at(0) = Plate(Lp,Wp/2,0,0,0);
210 panels.at(1) = Plate(Lp,Wp/2,0,-Wp/2.,0);
211 panels.at(2) = Strip(Lp,Hw);
213 for (
typename std::vector<gsMultiPatch<T>>::iterator it = panels.begin(); it!=panels.end(); it++)
214 for (
size_t p = 0; p!=it->nPatches(); p++)
215 result.addPatch(it->patch(p));
217 for (
size_t p = 0; p!=result.nPatches(); p++)
219 result.patch(p).coefs().col(0).array() += x;
220 result.patch(p).coefs().col(1).array() += y;
221 result.patch(p).coefs().col(2).array() += z;
224 result.computeTopology();
225 result.addAutoBoundaries();
230 gsMultiPatch<T> gsPanelCreator<T>::PanelL(T
const & Lp, T
const & Wp, T
const & Hw, T
const & Wf, T
const & x, T
const & y, T
const & z)
232 gsMultiPatch<T> result, tmp;
233 std::vector<gsMultiPatch<T>> panels(4);
234 panels.at(0) = Plate(Lp,Wp/2,0,-Wp/2.,0);
235 panels.at(1) = Plate(Lp,Wf,0,0,0);
236 panels.at(2) = Plate(Lp,Wp/2-Wf,0,Wf,0);
239 panels.at(3) = LBeam(Lp,Hw,Wf);
240 for (
typename std::vector<gsMultiPatch<T>>::iterator it = panels.begin(); it!=panels.end(); it++)
241 for (
size_t p = 0; p!=it->nPatches(); p++)
242 result.addPatch(it->patch(p));
244 for (
size_t p = 0; p!=result.nPatches(); p++)
246 result.patch(p).coefs().col(0).array() += x;
247 result.patch(p).coefs().col(1).array() += y;
248 result.patch(p).coefs().col(2).array() += z;
251 result.computeTopology();
252 result.addAutoBoundaries();
257 gsMultiPatch<T> gsPanelCreator<T>::PlateGirderL(T
const & Lp, T
const & Wp, T
const & Hwg, T
const & Wfg, T
const & Hws, T
const & Wfs, T
const & x, T
const & y, T
const & z)
259 gsMultiPatch<T> result, tmp;
262 std::vector<gsMultiPatch<T>> panels(14);
263 panels.at(0) = Plate(Lp/2.,Wp/2., 0., -Wp/2., 0.);
264 panels.at(1) = Plate(Lp/2.,Wfs, 0., 0., 0.);
265 panels.at(2) = Plate(Lp/2.,Wp/2.-Wfs, 0., Wfs, 0.);
266 panels.at(3) = Plate(Lp/2.,Wp/2., -Lp/2., -Wp/2., 0.);
267 panels.at(4) = Plate(Lp/2.,Wfs, -Lp/2., 0., 0.);
268 panels.at(5) = Plate(Lp/2.,Wp/2.-Wfs, -Lp/2., Wfs, 0.);
270 panels.at(6) = LBeam(Lp/2.,Hws,Wfs,0);
271 panels.at(7) = LBeam(Lp/2.,Hws,Wfs,-Lp/2.);
273 panels.at(8) = TBeam(Wfs, Hwg-Hws,Wfg,0,0,Hws);
274 panels.at(9) = TBeam(Wp/2.-Wfs,Hwg-Hws,Wfg,0,0,Hws);
275 panels.at(10) = TBeam(Wp/2., Hwg-Hws,Wfg,0,0,Hws);
277 for (
size_t p = 0; p!=panels[8].nPatches(); p++)
279 panels[8].patch(p).coefs().col(0).swap(panels[8].patch(p).coefs().col(1));
282 for (
size_t p = 0; p!=panels[9].nPatches(); p++)
284 panels[9].patch(p).coefs().col(0).swap(panels[9].patch(p).coefs().col(1));
285 panels[9].patch(p).coefs().col(1).array() += Wfs;
287 for (
size_t p = 0; p!=panels[10].nPatches(); p++)
289 panels[10].patch(p).coefs().col(0).swap(panels[10].patch(p).coefs().col(1));
290 panels[10].patch(p).coefs().col(1).array() -= Wp / 2.;
294 panels.at(11) = Strip(Wfs, Hws);
295 panels.at(12) = Strip(Wp/2.-Wfs,Hws);
296 panels.at(13) = Strip(Wp/2., Hws);
297 for (
size_t p = 0; p!=panels[11].nPatches(); p++)
299 panels[11].patch(p).coefs().col(0).swap(panels[11].patch(p).coefs().col(1));
302 for (
size_t p = 0; p!=panels[12].nPatches(); p++)
304 panels[12].patch(p).coefs().col(0).swap(panels[12].patch(p).coefs().col(1));
305 panels[12].patch(p).coefs().col(1).array() += Wfs;
307 for (
size_t p = 0; p!=panels[13].nPatches(); p++)
309 panels[13].patch(p).coefs().col(0).swap(panels[13].patch(p).coefs().col(1));
310 panels[13].patch(p).coefs().col(1).array() -= Wp / 2.;
314 for (
typename std::vector<gsMultiPatch<T>>::iterator it = panels.begin(); it!=panels.end(); it++)
315 for (
size_t p = 0; p!=it->nPatches(); p++)
316 result.addPatch(it->patch(p));
319 result.computeTopology();
320 result.addAutoBoundaries();
Knot vector for B-splines.
Represents a tensor-product B-spline patch.
S give(S &x)
Definition: gsMemory.h:266
Provides declaration of the MultiPatch class.