SheafSystem  0.0.0.0
write_std_namespace.cc
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
20 
21 // NOTE: This example, produces the equivalent namespace to
22 // one obtained by instantiating a fiber_bundles_namespace
23 // and using a storage_agent to write it out. Briefly, the
24 // code would look like this (without error checking):
25 // ...
26 // fiber_bundles_namespace ns("std_namespace");
27 // storage_agent sa("std_namespace.hdf");
28 // sa.write_entire(ns);
29 // ...
30 //
31 
32 
33 #include "SheafSystem/at0.h"
34 #include "SheafSystem/at1.h"
35 #include "SheafSystem/atp.h"
36 #include "SheafSystem/binary_section_space_schema_poset.h"
37 #include "SheafSystem/e1.h"
38 #include "SheafSystem/e2.h"
39 #include "SheafSystem/e3.h"
40 #include "SheafSystem/ed.h"
41 #include "SheafSystem/gl3.h"
42 #include "SheafSystem/gln.h"
43 #include "SheafSystem/itp.h"
44 #include "SheafSystem/jcb.h"
45 #include "SheafSystem/jcb_e13.h"
46 #include "SheafSystem/jcb_e23.h"
47 #include "SheafSystem/jcb_e33.h"
48 #include "SheafSystem/jcb_ed.h"
49 #include "SheafSystem/met.h"
50 #include "SheafSystem/met_e1.h"
51 #include "SheafSystem/met_e2.h"
52 #include "SheafSystem/met_e3.h"
53 #include "SheafSystem/met_ed.h"
54 #include "SheafSystem/namespace_poset_member.h"
55 #include "SheafSystem/section_space_schema_poset.h"
56 #include "SheafSystem/sec_rep_descriptor.h"
57 #include "SheafSystem/sheaves_namespace.h"
58 #include "SheafSystem/storage_agent.h"
59 #include "SheafSystem/st2.h"
60 #include "SheafSystem/st2_e2.h"
61 #include "SheafSystem/st2_e3.h"
62 #include "SheafSystem/state_tuple.h"
63 #include "SheafSystem/state_tuple_component.h"
64 #include "SheafSystem/stp.h"
65 #include "SheafSystem/t11.h"
66 #include "SheafSystem/ternary_section_space_schema_poset.h"
67 #include "SheafSystem/tuple.h"
68 #include "SheafSystem/tuv.h"
69 #include "SheafSystem/vd.h"
70 
71 using namespace fiber_bundle;
72 
73 // Create cell definitions
74 void make_cell_definitions();
75 void make_vertex();
76 void make_edge();
77 void make_triangle();
78 void make_quad();
79 void make_tetrahedron();
80 void make_hexahedron();
81 void make_wedge();
82 
83 // Create schema posets for standard fiber space types
84 void make_fiber_space_schema();
85 
86 // Create standard section representation descriptors
87 void make_section_space_definitions();
88 
89 
90 // Globals (for convenience)
91 namespace_poset* ns;
92 poset* cell_definitions;
93 poset* local_coordinates;
94 
95 int
96 main()
97 {
98  // Create the namespace poset and name it.
99 
100  ns = new sheaves_namespace("std_namespace");
101 
102  // Get read-write access to the namespace.
103 
104  ns->get_read_write_access();
105 
106  // Make various definition groups.
107 
108  make_fiber_space_schema();
109 
110  // Make base space definitions.
111 
112  make_section_space_definitions();
113 
114  // Save the namespace to a file.
115 
116  storage_agent sa("std_namespace.hdf");
117  sa.write_entire(*ns);
118 
119  delete ns;
120 
121  return 0;
122 }
123 
124 
126 void
127 make_cell_definitions()
128 {
129 
130  // Preconditions:
131 
132  // Body:
133 
134  schema_poset_member local_coordinates_schema_mbr(ns,
135  "local_coordinates_schema/local_coordinates_schema", false);
136 
137  cell_definitions = new poset(ns, &local_coordinates_schema_mbr,
138  "cell definitions");
139 
140  cell_definitions->get_read_write_access();
141 
142  make_vertex();
143  make_edge();
144  make_triangle();
145  make_quad();
146  make_tetrahedron();
147  make_hexahedron();
148  make_wedge();
149 
150  cell_definitions->release_access();
151 
152  local_coordinates_schema_mbr.detach_from_state();
153 
154  // Postconditions:
155 
156  // Exit
157 
158  return;
159 }
160 
161 
163 void
164 make_vertex()
165 {
166  // Preconditions:
167 
168  // Body:
169 
170  total_poset_member local_coordinates_mbr;
171  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/vertex", false);
172 
173  poset_dof_map* pdof_map = &(local_coordinates_mbr.dof_map());
174 
175  total_poset_member mbr;
176  mbr.new_jim_state(cell_definitions, pdof_map, true);
177  mbr.put_name("vertex", true, false);
178 
179  mbr.detach_from_state();
180  local_coordinates_mbr.detach_from_state();
181 
182  // Postconditions:
183 
184  // Exit
185 
186  return;
187 }
188 
189 
191 void
192 make_edge()
193 {
194  // Preconditions:
195 
196  // Body:
197 
198  total_poset_member local_coordinates_mbr;
199  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/vertex", false);
200 
201  poset_dof_map* pdof_map = &(local_coordinates_mbr.dof_map());
202 
203  total_poset_member v0(cell_definitions, pdof_map, true);
204  v0.put_name("edge-vertex 0", true, false);
205 
206  total_poset_member v1(cell_definitions, pdof_map, true);
207  v1.put_name("edge-vertex 1", true, false);
208 
209  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/edge", false);
210  pdof_map = &(local_coordinates_mbr.dof_map());
211 
212  total_poset_member e(cell_definitions, pdof_map, true);
213  e.put_name("edge", true, false);
214 
215  e.create_cover_link(&v0);
216  e.create_cover_link(&v1);
217 
218  e.detach_from_state();
219  v0.detach_from_state();
220  v1.detach_from_state();
221  local_coordinates_mbr.detach_from_state();
222 
223  // Postconditions:
224 
225  // Exit
226 
227  return;
228 }
229 
230 
232 void
233 make_triangle()
234 {
235  // Preconditions:
236 
237  // Body:
238 
239  total_poset_member local_coordinates_mbr;
240  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/vertex", false);
241 
242  poset_dof_map* pdof_map = &(local_coordinates_mbr.dof_map());
243 
244  total_poset_member v0(cell_definitions, pdof_map, true);
245  v0.put_name("triangle-vertex 0", true, false);
246 
247  total_poset_member v1(cell_definitions, pdof_map, true);
248  v1.put_name("triangle-vertex 1", true, false);
249 
250  total_poset_member v2(cell_definitions, pdof_map, true);
251  v2.put_name("triangle-vertex 2", true, false);
252 
253  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/edge", false);
254  pdof_map = &(local_coordinates_mbr.dof_map());
255 
256  total_poset_member e0(cell_definitions, pdof_map, true);
257  e0.put_name("triangle-edge 0", true, false);
258  e0.create_cover_link(&v0);
259  e0.create_cover_link(&v1);
260 
261  total_poset_member e1(cell_definitions, pdof_map, true);
262  e1.put_name("triangle-edge 1", true, false);
263  e1.create_cover_link(&v1);
264  e1.create_cover_link(&v2);
265 
266  total_poset_member e2(cell_definitions, pdof_map, true);
267  e2.put_name("triangle-edge 2", true, false);
268  e2.create_cover_link(&v2);
269  e2.create_cover_link(&v0);
270 
271  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/triangle", false);
272  pdof_map = &(local_coordinates_mbr.dof_map());
273 
274  total_poset_member t(cell_definitions, pdof_map, true);
275  t.put_name("triangle", true, false);
276  t.create_cover_link(&e0);
277  t.create_cover_link(&e1);
278  t.create_cover_link(&e2);
279 
280  v0.detach_from_state();
281  v1.detach_from_state();
282  v2.detach_from_state();
283  e0.detach_from_state();
286  t.detach_from_state();
287  local_coordinates_mbr.detach_from_state();
288 
289  // Postconditions:
290 
291  // Exit
292 
293  return;
294 }
295 
296 
298 void
299 make_quad()
300 {
301  // Preconditions:
302 
303  // Body:
304 
305  total_poset_member local_coordinates_mbr;
306  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/vertex", false);
307 
308  poset_dof_map* pdof_map = &(local_coordinates_mbr.dof_map());
309 
310  total_poset_member v0(cell_definitions, pdof_map, true);
311  v0.put_name("quad-vertex 0", true, false);
312 
313  total_poset_member v1(cell_definitions, pdof_map, true);
314  v1.put_name("quad-vertex 1", true, false);
315 
316  total_poset_member v2(cell_definitions, pdof_map, true);
317  v2.put_name("quad-vertex 2", true, false);
318 
319  total_poset_member v3(cell_definitions, pdof_map, true);
320  v3.put_name("quad-vertex 3", true, false);
321 
322  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/edge", false);
323  pdof_map = &(local_coordinates_mbr.dof_map());
324 
325  total_poset_member e0(cell_definitions, pdof_map, true);
326  e0.put_name("quad-edge 0", true, false);
327  e0.create_cover_link(&v0);
328  e0.create_cover_link(&v1);
329 
330  total_poset_member e1(cell_definitions, pdof_map, true);
331  e1.put_name("quad-edge 1", true, false);
332  e1.create_cover_link(&v1);
333  e1.create_cover_link(&v2);
334 
335  total_poset_member e2(cell_definitions, pdof_map, true);
336  e2.put_name("quad-edge 2", true, false);
337  e2.create_cover_link(&v2);
338  e2.create_cover_link(&v3);
339 
340  total_poset_member e3(cell_definitions, pdof_map, true);
341  e3.put_name("quad-edge 3", true, false);
342  e3.create_cover_link(&v3);
343  e3.create_cover_link(&v0);
344 
345  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/quad", false);
346  pdof_map = &(local_coordinates_mbr.dof_map());
347 
348  total_poset_member q(cell_definitions, pdof_map, true);
349  q.put_name("quad", true, false);
350  q.create_cover_link(&e0);
351  q.create_cover_link(&e1);
352  q.create_cover_link(&e2);
353  q.create_cover_link(&e3);
354 
355  v0.detach_from_state();
356  v1.detach_from_state();
357  v2.detach_from_state();
358  v2.detach_from_state();
359  v3.detach_from_state();
360  e0.detach_from_state();
364  q.detach_from_state();
365  local_coordinates_mbr.detach_from_state();
366 
367  // Postconditions:
368 
369  // Exit
370 
371  return;
372 }
373 
374 
376 void
377 make_tetrahedron()
378 {
379  // Preconditions:
380 
381  // Body:
382 
383  total_poset_member local_coordinates_mbr;
384  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/vertex", false);
385 
386  poset_dof_map* pdof_map = &(local_coordinates_mbr.dof_map());
387 
388  total_poset_member v0(cell_definitions, pdof_map, true);
389  v0.put_name("tetrahedron-vertex 0", true, false);
390 
391  total_poset_member v1(cell_definitions, pdof_map, true);
392  v1.put_name("tetrahedron-vertex 1", true, false);
393 
394  total_poset_member v2(cell_definitions, pdof_map, true);
395  v2.put_name("tetrahedron-vertex 2", true, false);
396 
397  total_poset_member v3(cell_definitions, pdof_map, true);
398  v3.put_name("tetrahedron-vertex 3", true, false);
399 
400  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/edge", false);
401  pdof_map = &(local_coordinates_mbr.dof_map());
402 
403  total_poset_member e0(cell_definitions, pdof_map, true);
404  e0.put_name("tetrahedron-edge 0", true, false);
405  e0.create_cover_link(&v0);
406  e0.create_cover_link(&v1);
407 
408  total_poset_member e1(cell_definitions, pdof_map, true);
409  e1.put_name("tetrahedron-edge 1", true, false);
410  e1.create_cover_link(&v1);
411  e1.create_cover_link(&v2);
412 
413  total_poset_member e2(cell_definitions, pdof_map, true);
414  e2.put_name("tetrahedron-edge 2", true, false);
415  e2.create_cover_link(&v2);
416  e2.create_cover_link(&v0);
417 
418  total_poset_member e3(cell_definitions, pdof_map, true);
419  e3.put_name("tetrahedron-edge 3", true, false);
420  e3.create_cover_link(&v2);
421  e3.create_cover_link(&v3);
422 
423  total_poset_member e4(cell_definitions, pdof_map, true);
424  e4.put_name("tetrahedron-edge 4", true, false);
425  e4.create_cover_link(&v3);
426  e4.create_cover_link(&v1);
427 
428  total_poset_member e5(cell_definitions, pdof_map, true);
429  e5.put_name("tetrahedron-edge 5", true, false);
430  e5.create_cover_link(&v3);
431  e5.create_cover_link(&v0);
432 
433  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/triangle", false);
434  pdof_map = &(local_coordinates_mbr.dof_map());
435 
436  total_poset_member f0(cell_definitions, pdof_map, true);
437  f0.put_name("tetrahedron-face 0", true, false);
438  f0.create_cover_link(&e0);
439  f0.create_cover_link(&e1);
440  f0.create_cover_link(&e2);
441 
442  total_poset_member f1(cell_definitions, pdof_map, true);
443  f1.put_name("tetrahedron-face 1", true, false);
444  f1.create_cover_link(&e2);
445  f1.create_cover_link(&e3);
446  f1.create_cover_link(&e5);
447 
448  total_poset_member f2(cell_definitions, pdof_map, true);
449  f2.put_name("tetrahedron-face 2", true, false);
450  f2.create_cover_link(&e5);
451  f2.create_cover_link(&e4);
452  f2.create_cover_link(&e0);
453 
454  total_poset_member f3(cell_definitions, pdof_map, true);
455  f3.put_name("tetrahedron-face 3", true, false);
456  f3.create_cover_link(&e1);
457  f3.create_cover_link(&e3);
458  f3.create_cover_link(&e4);
459 
460  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/tetrahedron", false);
461  pdof_map = &(local_coordinates_mbr.dof_map());
462 
463  total_poset_member t(cell_definitions, pdof_map, true);
464  t.put_name("tetrahedron", true, false);
465  t.create_cover_link(&f0);
466  t.create_cover_link(&f1);
467  t.create_cover_link(&f2);
468  t.create_cover_link(&f3);
469 
470  v0.detach_from_state();
471  v1.detach_from_state();
472  v2.detach_from_state();
473  v3.detach_from_state();
474  e0.detach_from_state();
479  e5.detach_from_state();
480  f0.detach_from_state();
481  f1.detach_from_state();
482  f2.detach_from_state();
483  f3.detach_from_state();
484  t.detach_from_state();
485  local_coordinates_mbr.detach_from_state();
486 
487  // Postconditions:
488 
489  // Exit
490 
491  return;
492 }
493 
494 
496 void
497 make_hexahedron()
498 {
499  // Preconditions:
500 
501  // Body:
502 
503  total_poset_member local_coordinates_mbr;
504  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/vertex", false);
505 
506  poset_dof_map* pdof_map = &(local_coordinates_mbr.dof_map());
507 
508  total_poset_member v0(cell_definitions, pdof_map, true);
509  v0.put_name("hexahedron-vertex 0", true, false);
510 
511  total_poset_member v1(cell_definitions, pdof_map, true);
512  v1.put_name("hexahedron-vertex 1", true, false);
513 
514  total_poset_member v2(cell_definitions, pdof_map, true);
515  v2.put_name("hexahedron-vertex 2", true, false);
516 
517  total_poset_member v3(cell_definitions, pdof_map, true);
518  v3.put_name("hexahedron-vertex 3", true, false);
519 
520  total_poset_member v4(cell_definitions, pdof_map, true);
521  v4.put_name("hexahedron-vertex 4", true, false);
522 
523  total_poset_member v5(cell_definitions, pdof_map, true);
524  v5.put_name("hexahedron-vertex 5", true, false);
525 
526  total_poset_member v6(cell_definitions, pdof_map, true);
527  v6.put_name("hexahedron-vertex 6", true, false);
528 
529  total_poset_member v7(cell_definitions, pdof_map, true);
530  v7.put_name("hexahedron-vertex 7", true, false);
531 
532  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/edge", false);
533  pdof_map = &(local_coordinates_mbr.dof_map());
534 
535  total_poset_member e0(cell_definitions, pdof_map, true);
536  e0.put_name("hexahedron-edge 0", true, false);
537  e0.create_cover_link(&v0);
538  e0.create_cover_link(&v1);
539 
540  total_poset_member e1(cell_definitions, pdof_map, true);
541  e1.put_name("hexahedron-edge 1", true, false);
542  e1.create_cover_link(&v1);
543  e1.create_cover_link(&v2);
544 
545  total_poset_member e2(cell_definitions, pdof_map, true);
546  e2.put_name("hexahedron-edge 2", true, false);
547  e2.create_cover_link(&v2);
548  e2.create_cover_link(&v3);
549 
550  total_poset_member e3(cell_definitions, pdof_map, true);
551  e3.put_name("hexahedron-edge 3", true, false);
552  e3.create_cover_link(&v3);
553  e3.create_cover_link(&v0);
554 
555  total_poset_member e4(cell_definitions, pdof_map, true);
556  e4.put_name("hexahedron-edge 4", true, false);
557  e4.create_cover_link(&v4);
558  e4.create_cover_link(&v5);
559 
560  total_poset_member e5(cell_definitions, pdof_map, true);
561  e5.put_name("hexahedron-edge 5", true, false);
562  e5.create_cover_link(&v5);
563  e5.create_cover_link(&v6);
564 
565  total_poset_member e6(cell_definitions, pdof_map, true);
566  e6.put_name("hexahedron-edge 6", true, false);
567  e6.create_cover_link(&v6);
568  e6.create_cover_link(&v7);
569 
570  total_poset_member e7(cell_definitions, pdof_map, true);
571  e7.put_name("hexahedron-edge 7", true, false);
572  e7.create_cover_link(&v7);
573  e7.create_cover_link(&v4);
574 
575  total_poset_member e8(cell_definitions, pdof_map, true);
576  e8.put_name("hexahedron-edge 8", true, false);
577  e8.create_cover_link(&v3);
578  e8.create_cover_link(&v7);
579 
580  total_poset_member e9(cell_definitions, pdof_map, true);
581  e9.put_name("hexahedron-edge 9", true, false);
582  e9.create_cover_link(&v2);
583  e9.create_cover_link(&v6);
584 
585  total_poset_member e10(cell_definitions, pdof_map, true);
586  e10.put_name("hexahedron-edge 10", true, false);
587  e10.create_cover_link(&v1);
588  e10.create_cover_link(&v5);
589 
590  total_poset_member e11(cell_definitions, pdof_map, true);
591  e11.put_name("hexahedron-edge 11", true, false);
592  e11.create_cover_link(&v0);
593  e11.create_cover_link(&v4);
594 
595  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/quad", false);
596  pdof_map = &(local_coordinates_mbr.dof_map());
597 
598  total_poset_member f0(cell_definitions, pdof_map, true);
599  f0.put_name("hexahedron-face 0", true, false);
600  f0.create_cover_link(&e0);
601  f0.create_cover_link(&e1);
602  f0.create_cover_link(&e2);
603  f0.create_cover_link(&e3);
604 
605  total_poset_member f1(cell_definitions, pdof_map, true);
606  f1.put_name("hexahedron-face 1", true, false);
607  f1.create_cover_link(&e4);
608  f1.create_cover_link(&e5);
609  f1.create_cover_link(&e6);
610  f1.create_cover_link(&e7);
611 
612  total_poset_member f2(cell_definitions, pdof_map, true);
613  f2.put_name("hexahedron-face 2", true, false);
614  f2.create_cover_link(&e10);
615  f2.create_cover_link(&e5);
616  f2.create_cover_link(&e9);
617  f2.create_cover_link(&e1);
618 
619  total_poset_member f3(cell_definitions, pdof_map, true);
620  f3.put_name("hexahedron-face 3", true, false);
621  f3.create_cover_link(&e11);
622  f3.create_cover_link(&e7);
623  f3.create_cover_link(&e8);
624  f3.create_cover_link(&e3);
625 
626  total_poset_member f4(cell_definitions, pdof_map, true);
627  f4.put_name("hexahedron-face 4", true, false);
628  f4.create_cover_link(&e0);
629  f4.create_cover_link(&e10);
630  f4.create_cover_link(&e4);
631  f4.create_cover_link(&e11);
632 
633  total_poset_member f5(cell_definitions, pdof_map, true);
634  f5.put_name("hexahedron-face 5", true, false);
635  f5.create_cover_link(&e2);
636  f5.create_cover_link(&e9);
637  f5.create_cover_link(&e6);
638  f5.create_cover_link(&e8);
639 
640  //make_6(h, name, f0, f1, f2, f3, f4, f5);
641 
642  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/hexahedron", false);
643  pdof_map = &(local_coordinates_mbr.dof_map());
644 
645  total_poset_member h(cell_definitions, pdof_map, true);
646  h.put_name("hexahedron", true, false);
647  h.create_cover_link(&f0);
648  h.create_cover_link(&f1);
649  h.create_cover_link(&f2);
650  h.create_cover_link(&f3);
651  h.create_cover_link(&f4);
652  h.create_cover_link(&f5);
653 
654  v0.detach_from_state();
655  v1.detach_from_state();
656  v2.detach_from_state();
657  v3.detach_from_state();
658  v4.detach_from_state();
659  v5.detach_from_state();
660  v6.detach_from_state();
661  v7.detach_from_state();
662  e0.detach_from_state();
667  e5.detach_from_state();
668  e6.detach_from_state();
669  e7.detach_from_state();
670  e8.detach_from_state();
671  e9.detach_from_state();
672  e10.detach_from_state();
673  e11.detach_from_state();
674  f0.detach_from_state();
675  f1.detach_from_state();
676  f2.detach_from_state();
677  f3.detach_from_state();
678  f4.detach_from_state();
679  f5.detach_from_state();
680  h.detach_from_state();
681  local_coordinates_mbr.detach_from_state();
682 
683  // Postconditions:
684 
685  // Exit
686 
687  return;
688 }
689 
690 
692 void
693 make_wedge()
694 {
695  // Preconditions:
696 
697  // Body:
698 
699  total_poset_member local_coordinates_mbr;
700  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/vertex", false);
701 
702  poset_dof_map* pdof_map = &(local_coordinates_mbr.dof_map());
703 
704  total_poset_member v0(cell_definitions, pdof_map, true);
705  v0.put_name("wedge-vertex 0", true, false);
706 
707  total_poset_member v1(cell_definitions, pdof_map, true);
708  v1.put_name("wedge-vertex 1", true, false);
709 
710  total_poset_member v2(cell_definitions, pdof_map, true);
711  v2.put_name("wedge-vertex 2", true, false);
712 
713  total_poset_member v3(cell_definitions, pdof_map, true);
714  v3.put_name("wedge-vertex 3", true, false);
715 
716  total_poset_member v4(cell_definitions, pdof_map, true);
717  v4.put_name("wedge-vertex 4", true, false);
718 
719  total_poset_member v5(cell_definitions, pdof_map, true);
720  v5.put_name("wedge-vertex 5", true, false);
721 
722 
723  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/edge", false);
724  pdof_map = &(local_coordinates_mbr.dof_map());
725 
726  total_poset_member e0(cell_definitions, pdof_map, true);
727  e0.put_name("wedge-edge 0", true, false);
728  e0.create_cover_link(&v0);
729  e0.create_cover_link(&v1);
730 
731  total_poset_member e1(cell_definitions, pdof_map, true);
732  e1.put_name("wedge-edge 1", true, false);
733  e1.create_cover_link(&v1);
734  e1.create_cover_link(&v2);
735 
736  total_poset_member e2(cell_definitions, pdof_map, true);
737  e2.put_name("wedge-edge 2", true, false);
738  e2.create_cover_link(&v2);
739  e2.create_cover_link(&v0);
740 
741  total_poset_member e3(cell_definitions, pdof_map, true);
742  e3.put_name("wedge-edge 3", true, false);
743  e3.create_cover_link(&v3);
744  e3.create_cover_link(&v4);
745 
746  total_poset_member e4(cell_definitions, pdof_map, true);
747  e4.put_name("wedge-edge 4", true, false);
748  e4.create_cover_link(&v4);
749  e4.create_cover_link(&v5);
750 
751  total_poset_member e5(cell_definitions, pdof_map, true);
752  e5.put_name("wedge-edge 5", true, false);
753  e5.create_cover_link(&v5);
754  e5.create_cover_link(&v3);
755 
756  total_poset_member e6(cell_definitions, pdof_map, true);
757  e6.put_name("wedge-edge 6", true, false);
758  e6.create_cover_link(&v0);
759  e6.create_cover_link(&v3);
760 
761  total_poset_member e7(cell_definitions, pdof_map, true);
762  e7.put_name("wedge-edge 7", true, false);
763  e7.create_cover_link(&v1);
764  e7.create_cover_link(&v4);
765 
766  total_poset_member e8(cell_definitions, pdof_map, true);
767  e8.put_name("wedge-edge 8", true, false);
768  e8.create_cover_link(&v2);
769  e8.create_cover_link(&v5);
770 
771 
772  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/quad", false);
773  pdof_map = &(local_coordinates_mbr.dof_map());
774 
775  total_poset_member f0(cell_definitions, pdof_map, true);
776  f0.put_name("wedge-face 0", true, false);
777  f0.create_cover_link(&e1);
778  f0.create_cover_link(&e8);
779  f0.create_cover_link(&e4);
780  f0.create_cover_link(&e7);
781 
782  total_poset_member f1(cell_definitions, pdof_map, true);
783  f1.put_name("wedge-face 1", true, false);
784  f1.create_cover_link(&e2);
785  f1.create_cover_link(&e6);
786  f1.create_cover_link(&e5);
787  f1.create_cover_link(&e8);
788 
789  total_poset_member f2(cell_definitions, pdof_map, true);
790  f2.put_name("wedge-face 2", true, false);
791  f2.create_cover_link(&e0);
792  f2.create_cover_link(&e7);
793  f2.create_cover_link(&e3);
794  f2.create_cover_link(&e6);
795 
796 
797  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/triangle", false);
798  pdof_map = &(local_coordinates_mbr.dof_map());
799 
800  total_poset_member f3(cell_definitions, pdof_map, true);
801  f3.put_name("wedge-face 3", true, false);
802  f3.create_cover_link(&e0);
803  f3.create_cover_link(&e1);
804  f3.create_cover_link(&e2);
805 
806  total_poset_member f4(cell_definitions, pdof_map, true);
807  f4.put_name("wedge-face 4", true, false);
808  f4.create_cover_link(&e3);
809  f4.create_cover_link(&e4);
810  f4.create_cover_link(&e5);
811 
812  local_coordinates_mbr.attach_to_state(ns, "local_coordinates/wedge", false);
813  pdof_map = &(local_coordinates_mbr.dof_map());
814 
815  total_poset_member w(cell_definitions, pdof_map, true);
816  w.put_name("wedge", true, false);
817 
818  w.create_cover_link(&f0);
819  w.create_cover_link(&f1);
820  w.create_cover_link(&f2);
821  w.create_cover_link(&f3);
822  w.create_cover_link(&f4);
823 
824  v0.detach_from_state();
825  v1.detach_from_state();
826  v2.detach_from_state();
827  v3.detach_from_state();
828  v4.detach_from_state();
829  v5.detach_from_state();
830 
831  e0.detach_from_state();
836  e5.detach_from_state();
837  e6.detach_from_state();
838  e7.detach_from_state();
839  e8.detach_from_state();
840 
841  f0.detach_from_state();
842  f1.detach_from_state();
843  f2.detach_from_state();
844  f3.detach_from_state();
845  f4.detach_from_state();
846 
847  w.detach_from_state();
848  local_coordinates_mbr.detach_from_state();
849 
850  // Postconditions:
851 
852  // Exit
853 
854  return;
855 }
856 
858 void
859 make_fiber_space_schema()
860 {
861  // Preconditions:
862 
863  // Body:
864 
865  total_poset_member* primitives_schema = &(ns->primitives().schema());
866  poset* fiber_definitions = new poset(ns, primitives_schema, "fiber_space_schema");
867  fiber_definitions->get_read_write_access();
868 
869  subposet table_dofs(fiber_definitions);
870  table_dofs.put_name(schema_poset_member::table_dof_subposet_name("top"), true, false);
871 
872  subposet row_dofs(fiber_definitions);
873  row_dofs.put_name(schema_poset_member::row_dof_subposet_name("top"), true, false);
874 
875  // Make the various schema
876 
878  state_tuple::make_standard_schema(*ns);
879  state_tuple_component::make_standard_schema(*ns);
886  tuv::make_standard_schema(*ns);
887  t11::make_standard_schema(*ns);
899  itp::make_standard_schema(*ns);
907 
908  // Schematize the poset and all its members
909 
910  fiber_definitions->schematize(&table_dofs, &row_dofs, true);
911 
912  table_dofs.detach_from_state();
913  row_dofs.detach_from_state();
914 
915  fiber_definitions->release_access();
916 
917  // Postconditions:
918 
919  // Exit
920 
921  return;
922 }
923 
924 
926 void
927 make_section_space_definitions()
928 {
929  // Preconditions:
930 
931  // Body:
932 
933  // Make the section space schema schema.
934 
935  sec_rep_descriptor::make_schema(ns);
936  section_space_schema_poset::make_schema(ns);
937  binary_section_space_schema_poset::make_schema(ns);
938  ternary_section_space_schema_poset::make_schema(ns);
939 
940  // Make some standard sec rep descriptors
941 
942  poset* sec_rep_desc =
943  new poset(ns,
944  "sec_rep_descriptor_schema/sec_rep_descriptor_schema",
945  "sec_rep_descriptors" );
946 
947  sec_rep_desc->get_read_write_access();
948 
949  sec_rep_descriptor v_e_dlinear;
950 
951  v_e_dlinear.new_jim_state(sec_rep_desc);
952  v_e_dlinear.put_name("vertex_element_dlinear", true, false);
953  v_e_dlinear.put_discretization_subposet_name("__vertices");
954  v_e_dlinear.put_evaluation_subposet_name("__elements");
955  v_e_dlinear.put_evaluator_family_name("dlinear");
956  v_e_dlinear.put_url("www.lpsweb.com/libSheaf/std_namespace.html");
957  v_e_dlinear.put_multiplicity(1);
958 
959  sec_rep_descriptor e_e_const;
960 
961  e_e_const.new_jim_state(sec_rep_desc);
962  e_e_const.put_name("element_element_constant", true, false);
963  e_e_const.put_discretization_subposet_name("__elements");
964  e_e_const.put_evaluation_subposet_name("__elements");
965  e_e_const.put_evaluator_family_name("const");
966  e_e_const.put_url("www.lpsweb.com/libSheaf/std_namespace.html");
967  e_e_const.put_multiplicity(1);
968 
969  // Make sec rep space definitions group (jrm)
970 
971  namespace_poset_member lm1(ns, "sec_rep_descriptor_schema");
972  namespace_poset_member lm2(ns, "sec_rep_descriptors");
973 
974  total_poset_member* sec_defns = lm1.l_join(&lm2);
975  sec_defns->put_name("section space definitions", true, false);
976  sec_defns->detach_from_state();
977  delete sec_defns;
978 
979  // Detach all the handles allocated on the stack
980 
981  e_e_const.detach_from_state();
982  v_e_dlinear.detach_from_state();
983  lm1.detach_from_state();
984  lm2.detach_from_state();
985 
986  // Release access
987 
988  sec_rep_desc->release_access();
989 
990  // Postconditions:
991 
992  // Exit
993 
994  return;
995 }
996 
997 
virtual void get_read_write_access(bool xrelease_read_only_access=false)
Get read write access to the state associated with this. If release_read_only_access is requested...
A client handle for a subposet.
Definition: subposet.h:86
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: st2_e3.cc:611
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: st2.cc:450
virtual void schematize(subposet *xtable_dof_subposet, subposet *xrow_dof_subposet, bool xall_members=false)
Prepare this poset and its top member for use as a schema. If xall_members = true, schematize all other members as well.
virtual void create_cover_link(abstract_poset_member *xlesser)
Insert a link from this to lesser; make lesser <= this.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: e2.cc:720
virtual void new_jim_state(poset_dof_map *xdof_map=0, bool xcopy_dof_map=false, bool xauto_access=true)
Creates a new jim (join-irreducible member) state in host() and attaches this to it. If xdof_map == 0 a new dof map is created. If xdof_map != 0 and xcopy_dof_map == false, xdof_map is used as the dof map. If xdof_map != 0 and xcopy_dof_map is true, a copy of xdof_map is used.
Euclidean vector space of dimension 4 (persistent version).
Definition: e4.h:410
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: ed.cc:364
Euclidean vector space of dimension 2 (persistent version).
Definition: e2.h:405
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: e3.cc:1118
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: met_ed.cc:366
The default name space; a poset which contains other posets as members.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: jcb_e23.cc:572
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: tuple.cc:291
primitives_poset & primitives()
The poset of primitives for this namespace (mutable version)
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: st2_e2.cc:604
virtual void get_read_write_access(bool xrelease_read_only_access=false)
Get read write access to the state associated with this. If release_read_only_access is requested...
std::string row_dof_subposet_name() const
The standard name for the row dof subposet associated with this schema member. Synonym for dof_subpos...
The standard sheaves name space.
The general, abstract map from dof ids to dof values.
Definition: poset_dof_map.h:59
Euclidean vector space of dimension 3 (persistent version).
Definition: e3.h:467
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: gl3.cc:879
Euclidean vector space of dimension 1 (persistent version).
Definition: e1.h:400
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: jcb.cc:507
A client handle for a member of a namespace poset.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: jcb_ed.cc:338
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
void put_discretization_subposet_name(const std::string &xname)
Sets the name of the discretization subposet to xname.
A client handle for a mutable partially ordered set.
Definition: poset.h:40
void put_evaluation_subposet_name(const std::string &xname)
Sets the name of the evaluation subposet to xname.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: at0.cc:699
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: met_e1.cc:574
virtual void put_name(const std::string &xname, bool xunique, bool xauto_access)
Make xname a name for this; if xunique, make xname the only name.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: stp.cc:375
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: met.cc:362
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: vd.cc:746
void put_evaluator_family_name(const std::string &xname)
Sets the name of the evaluator family to xname.
void put_url(const std::string &xurl)
Sets the url for a description of this representation to xurl.
virtual void detach_from_state()
Detach this handle from its state, if any.
void put_multiplicity(int xmultiplicity)
Sets the number of degrees of freedom associated with each (discretization member, fiber_schema member) pair.
total_poset_member * l_join(abstract_poset_member *other, bool xnew_jem=true)
lattice join of this with other, auto-, pre-, and self-allocated versions the lattice join is the lea...
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: jcb_e33.cc:588
T::table_dofs_type & table_dofs(T &x0)
The table dofs pod type for x0 (mutable version).
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: met_e2.cc:627
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: e1.cc:694
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: jcb_e13.cc:566
void attach_to_state(const namespace_poset *xns, const poset_path &xpath, bool xauto_access=true)
Attach to the state specified by path xpath in the namespace xns.
virtual void new_jim_state(poset_dof_map *xdof_map=0, bool xcopy_dof_map=false, bool xauto_access=true)
Creates a new jim (join-irreducible member) state in host() and attaches this to it. If xdof_map == 0 a new dof map is created. If xdof_map != 0 and xcopy_dof_map == false, xdof_map is used as the dof map. If xdof_map != 0 and xcopy_dof_map is true, a copy of xdof_map is used.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: atp.cc:227
virtual poset_dof_map & dof_map(bool xrequire_write_access=false)
The map from schema member ids or client ids to dof values for this poset member (mutable version) ...
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: at1.cc:371
Namespace for the fiber_bundles component of the sheaf system.
std::string table_dof_subposet_name() const
The standard name for the table dof subposet associated with this schema member. Synonym for dof_subp...
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: met_e3.cc:655
A client handle for a poset member which has been prepared for use as a schema.
Agent responsible for importing and exporting posets from an external name space which resides on dis...
Definition: storage_agent.h:74
A client handle for an unrestricted member of a poset. A total_poset_member is guaranteed not to be r...
A description for a section representation scheme.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: gln.cc:572