SheafSystem  0.0.0.0
sec_e2_uniform.cc
Go to the documentation of this file.
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 #include "SheafSystem/sec_e2_uniform.h"
22 
23 #include "SheafSystem/assert_contract.h"
24 #include "SheafSystem/base_space_poset.h"
25 #include "SheafSystem/binary_section_space_schema_member.impl.h"
26 #include "SheafSystem/at0_space.h"
27 #include "SheafSystem/at1_space.h"
28 #include "SheafSystem/e2.h"
29 #include "SheafSystem/fiber_bundles_namespace.h"
30 #include "SheafSystem/sec_at0.h"
31 #include "SheafSystem/sec_at0_space.h"
32 #include "SheafSystem/sec_at1_space.h"
33 #include "SheafSystem/structured_block_2d.h"
34 #include "SheafSystem/sec_tuple.impl.h"
35 #include "SheafSystem/sec_tuple_space.impl.h"
36 #include "SheafSystem/sec_vd.impl.h"
37 
38 using namespace std;
39 using namespace fiber_bundle; // Workaround for MS C++ bug.
40 
41 //==============================================================================
42 // CLASS SEC_E2_UNIFORM
43 //==============================================================================
44 
45 
46 // ===========================================================
47 // HOST FACTORY FACET OF CLASS SEC_E2_UNIFORM
48 // ===========================================================
49 
50 // PUBLIC MEMBER FUNCTIONS
51 
55  const poset_path& xhost_path,
56  const poset_path& xschema_path,
57  const poset_path& xscalar_space_path,
58  bool xauto_access)
59 {
60  // cout << endl << "Entering sec_e2_uniform::new_host." << endl;
61 
62  // Preconditions:
63 
64  require(xns.state_is_auto_read_write_accessible(xauto_access));
65 
66  require(!xhost_path.empty());
67  require(!xns.contains_path(xhost_path, xauto_access));
68 
69  require(xschema_path.full());
70  require(xns.path_is_auto_read_accessible<schema_type::host_type>(xschema_path, xauto_access));
71  require(host_type::fiber_space_conforms<fiber_type::host_type>(xns, xschema_path, xauto_access));
72 
73  require(xns.path_is_auto_read_accessible<scalar_type::host_type>(xscalar_space_path, xauto_access));
74 
75  require(host_type::same_scalar_fiber_space(xns, xschema_path, xscalar_space_path, xauto_access));
76 
77  // Body:
78 
79  host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xscalar_space_path, xauto_access);
80 
81  // Postconditions:
82 
83  ensure(xns.owns(result, xauto_access));
84  ensure(result.path(true) == xhost_path);
85  ensure(result.state_is_not_read_accessible());
86  ensure(result.schema(true).path(xauto_access) == xschema_path);
87 
88  ensure(result.factor_ct(true) == result.schema(true).fiber_space<fiber_type::host_type>().factor_ct(xauto_access));
89  ensure(result.d(true) == result.schema(true).fiber_space<fiber_type::host_type>().d(xauto_access));
90  ensure(result.d(true) == result.dd(true));
91  ensure(result.scalar_space_path(true) == xscalar_space_path);
92  ensure(result.p(true) == result.schema(true).fiber_space<fiber_type::host_type>().p(xauto_access));
93  ensure(result.p(true) == 1);
94  ensure(result.dd(true) == result.schema(true).fiber_space<fiber_type::host_type>().dd(xauto_access));
95  ensure(result.vector_space_path(true) == xhost_path);
96 
97  // Exit:
98 
99  // cout << "Leaving sec_e2_uniform::new_host." << endl;
100  return result;
101 }
102 
106  const poset_path& xbase_path,
107  const poset_path& xrep_path,
108  const std::string& xsection_suffix,
109  const std::string& xfiber_suffix,
110  bool xauto_access)
111 {
112  // cout << endl << "Entering sec_e2_uniform::new_host." << endl;
113 
114  // Preconditions:
115 
116  require(xns.state_is_auto_read_write_accessible(xauto_access));
117 
118  require(xbase_path.full());
119  require(xns.path_is_auto_read_accessible<base_space_poset>(xbase_path, xauto_access));
120 
121  require(xrep_path.empty() || xrep_path.full());
122  require(xrep_path.empty() || xns.path_is_auto_read_accessible<sec_rep_descriptor_poset>(xrep_path, xauto_access));
123 
124  require(xsection_suffix.empty() || poset_path::is_valid_name(xsection_suffix));
125 
126  require(xfiber_suffix.empty() || poset_path::is_valid_name(xfiber_suffix));
127 
128  require(standard_host_is_available<sec_e2_uniform>(xns, xbase_path, xrep_path, xsection_suffix, xfiber_suffix, xauto_access));
129  require(fiber_type::standard_host_is_available<fiber_type>(xns, xfiber_suffix, xauto_access));
130  require(schema_type::standard_host_is_available<sec_e2_uniform>(xns, xbase_path, xrep_path, xfiber_suffix, xauto_access));
131 
132  // Body:
133 
134  poset_path lstd_path = standard_host_path<sec_e2_uniform>(xbase_path, xrep_path, xsection_suffix, xfiber_suffix);
135 
136  host_type* lresult_ptr;
137 
138  if(xns.contains_path(lstd_path, xauto_access))
139  {
140  // Standard host already exists, just return it.
141 
142  lresult_ptr = &xns.member_poset<host_type>(lstd_path, xauto_access);
143  }
144  else
145  {
146  // Standard host doesn't exist, have to create it.
147 
148  // Apply default for rep path if needed.
149 
150  poset_path lrep_path = (!xrep_path.empty() ? xrep_path : standard_rep_path());
151 
152  // Find or create the standard schema member.
153 
154  poset_path lstd_schema_path =
155  schema_type::standard_member<sec_e2_uniform>(xns, xbase_path, lrep_path, xfiber_suffix, xauto_access);
156 
157  // Find or create the standard scalar space.
158 
159  poset_path lscalar_space_path =
160  scalar_type::standard_host(xns, xbase_path, lrep_path, xsection_suffix, xfiber_suffix, xauto_access).path(xauto_access);
161 
162  // Create the standard host.
163 
164  lresult_ptr = &new_host(xns, lstd_path, lstd_schema_path, lscalar_space_path, xauto_access);
165  }
166 
167  host_type& result = *lresult_ptr;
168 
169  // Postconditions:
170 
171  ensure(xns.owns(result, xauto_access));
172  ensure(result.path(true) == standard_host_path<sec_e2_uniform>(xbase_path, xrep_path, xsection_suffix, xfiber_suffix));
173  ensure(result.state_is_not_read_accessible());
174  ensure(result.schema(true).path(xauto_access) ==
175  schema_type::standard_member_path<sec_e2_uniform>(xbase_path, xrep_path, xfiber_suffix));
176 
177  ensure(result.factor_ct(true) == result.schema(true).fiber_space<fiber_type::host_type>().factor_ct(xauto_access));
178  ensure(result.d(true) == result.schema(true).fiber_space<fiber_type::host_type>().d(xauto_access));
179  ensure(result.d(true) == result.dd(true));
180  ensure(result.scalar_space_path(true) ==
181  scalar_type::standard_host_path<scalar_type>(xbase_path, result.rep().path(xauto_access), xsection_suffix, xfiber_suffix));
182  ensure(result.p(true) == result.schema(true).fiber_space<fiber_type::host_type>().p(xauto_access));
183  ensure(result.p(true) == 1);
184  ensure(result.dd(true) == result.schema(true).fiber_space<fiber_type::host_type>().dd(xauto_access));
185  ensure(result.vector_space_path(true) == result.path(true));
186 
187  // Exit:
188 
189  // cout << "Leaving sec_e2_uniform::new_host." << endl;
190  return result;
191 }
192 
193 // PROTECTED MEMBER FUNCTIONS
194 
195 // PRIVATE MEMBER FUNCTIONS
196 
197 
198 //==============================================================================
199 // E2_UNIFORM FACET OF CLASS SEC_E2_UNIFORM
200 //==============================================================================
201 
202 // PUBLIC MEMBER FUNCTIONS
203 
206 {
207 
208  // Preconditions:
209 
210  // Body:
211 
212  // Postconditions:
213 
214  ensure(invariant());
215 }
216 
217 
218 // =============================================================================
219 // NEW HANDLE, NEW STATE CONSTRUCTORS
220 // =============================================================================
221 
224  const block<dof_type>& xmin,
225  const block<dof_type>& xmax,
226  bool xauto_access)
227 {
228  // Preconditions:
229 
230  require(precondition_of(new_jim_state(xhost, xmin, xmax, xauto_access)));
231 
232  // Body:
233 
234  new_jim_state(xhost, xmin, xmax, xauto_access);
235 
236  // Postconditions:
237 
238  ensure(postcondition_of(new_jim_state(xhost, xmin, xmax, xauto_access)));
239 
240  // Exit:
241 
242  return;
243 }
244 
245 
247 sec_e2_uniform(sec_rep_space* xhost, section_dof_map* xdof_map, bool xauto_access)
248 {
249  // Preconditions:
250 
251  require(precondition_of(new_jim_state(xhost, xdof_map, false, xauto_access)));
252 
253  // Body:
254 
255  new_jim_state(xhost, xdof_map, false, xauto_access);
256 
257  // Postconditions:
258 
259  ensure(postcondition_of(new_jim_state(xhost, xdof_map, false, xauto_access)));
260 
261  // Exit:
262 
263  return;
264 }
265 
268  abstract_poset_member& xbase_mbr,
269  int xbase_version,
270  bool xauto_access)
271 {
272 
273  // Preconditions:
274 
275  require(precondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
276 
277  // Body:
278 
279  new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access);
280 
281  // Postconditions:
282 
283  ensure(postcondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
284 
285  // Exit:
286 
287  return;
288 }
289 
291 sec_e2_uniform(sec_rep_space* xhost, const subposet& xbase_parts, bool xauto_access)
292 {
293  // Preconditions:
294 
295  require(precondition_of(new_jim_state(xhost, xbase_parts, xauto_access)));
296 
297  // Body:
298 
299  new_jrm_state(xhost, xbase_parts, xauto_access);
300 
301  // Postconditions:
302 
303  require(postcondition_of(new_jim_state(xhost, xbase_parts, xauto_access)));
304 
305  // Exit:
306 
307  return;
308 }
309 
310 // =============================================================================
311 // NEW HANDLE, EXISTING STATE CONSTRUCTORS
312 // =============================================================================
313 
316 {
317  // Preconditions:
318 
319  require(xhost != 0);
320  require(xhost->state_is_read_accessible());
321  require(xhost->contains_member(xindex));
322 
323  // Body:
324 
325  attach_to_state(xhost, xindex);
326 
327  // Postconditions:
328 
329  ensure(invariant());
330  //ensure(host() == xhost);
331  ensure(index() == xindex);
332  ensure(is_attached());
333  ensure(!is_restricted());
334 }
335 
337 sec_e2_uniform(const sec_rep_space* xhost, const scoped_index& xindex)
338 {
339 
340  // Preconditions:
341 
342  require(xhost != 0);
343  require(xhost->state_is_read_accessible());
344  require(xhost->contains_member(xindex));
345 
346  // Body:
347 
348  attach_to_state(xhost, xindex.hub_pod());
349 
350  // Postconditions:
351 
352  ensure(invariant());
353  //ensure(host() == xhost);
354  ensure(index() ==~ xindex);
355  ensure(is_attached());
356  ensure(!is_restricted());
357 
358 }
359 
361 sec_e2_uniform(const sec_rep_space* xhost, const std::string& xname)
362 {
363 
364  // Preconditions:
365 
366  require(xhost != 0);
367  require(xhost->state_is_read_accessible());
368  require(!xname.empty());
369  require(xhost->contains_member(xname));
370 
371  // Body:
372 
373  attach_to_state(xhost, xname);
374 
375  // Postconditions:
376 
377  ensure(invariant());
378  //ensure(host() == xhost);
379  ensure(name() == xname);
380  ensure(is_attached());
381  ensure(!is_restricted());
382 
383 }
384 
385 
387 sec_e2_uniform(const namespace_poset* xnamespace,
388  const poset_path& xpath,
389  bool xauto_access)
390 {
391 
392  // Preconditions:
393 
394  require(precondition_of(attach_to_state(same args)));
395 
396  // Body:
397 
398  attach_to_state(xnamespace, xpath, xauto_access);
399 
400  // Postconditions:
401 
402  ensure(postcondition_of(attach_to_state(same args)));
403 
404  // Exit:
405 
406  return;
407 }
408 
409 
412 {
413 
414  // Preconditions:
415 
416  require(xother != 0);
417 
418  // Body:
419 
420  attach_to_state(xother);
421 
422  // Postconditions:
423 
424  ensure(invariant());
425  ensure(is_attached());
426  ensure(is_same_state(xother));
427  ensure(is_same_restriction(xother));
428 
429 }
430 
433 {
434 
435  // Preconditions:
436 
437  // Body:
438 
439  // Postconditions:
440 
441 }
442 
443 // =============================================================================
444 // EXISTING HANDLE, NEW STATE "CONSTRUCTORS"
445 // =============================================================================
446 
447 void
450  const block<dof_type>& xmin,
451  const block<dof_type>& xmax,
452  bool xauto_access)
453 {
454  // Preconditions:
455 
456  require(precondition_of(new_jim_state(xhost, 0, false, xauto_access)));
457  require(xmin.ct() >= 2);
458  require(xmax.ct() >= 2);
459  require_for_all(i, 0, 2, xmin[i] <= xmax[i]);
460 
461  // Body:
462 
463  new_jim_state(xhost, static_cast<poset_dof_map*>(0), false, xauto_access);
464  put_bounds(xmin, xmax, xauto_access);
465 
466  // Postconditions:
467 
468  ensure(min_x(xauto_access) == xmin[0]);
469  ensure(min_y(xauto_access) == xmin[1]);
470  ensure(max_x(xauto_access) == xmax[0]);
471  ensure(max_y(xauto_access) == xmax[1]);
472 
473  // Exit:
474 
475  return;
476 }
477 
478 
479 // ===========================================================================
480 // OTHER
481 // ===========================================================================
482 
483 
487 {
488  // Preconditions:
489 
490  require(is_ancestor_of(&xother));
491  require(precondition_of(attach_to_state(&xother)));
492 
493  // Body:
494 
495  attach_to_state(&xother);
496 
497  // Postconditions:
498 
499  ensure(postcondition_of(attach_to_state(&xother)));
500 
501  // Exit:
502 
503  return *this;
504 }
505 
508 operator=(const sec_e2_uniform& xother)
509 {
510  // Preconditions:
511 
512  require(precondition_of(attach_to_state(&xother)));
513 
514  // Body:
515 
516  attach_to_state(&xother);
517 
518  // Postconditions:
519 
520  ensure(postcondition_of(attach_to_state(&xother)));
521 
522  // Exit:
523 
524  return *this;
525 }
526 
529 operator=(const e2& xfiber)
530 {
531  // Preconditions:
532 
533  require(precondition_of(sec_vd::operator=(xfiber)));
534 
535  // Body:
536 
537  sec_vd::operator=(xfiber);
538 
539  // Postconditions:
540 
541  ensure(postcondition_of(sec_vd::operator=(xfiber)));
542 
543  // Exit:
544 
545  return *this;
546 }
547 
550 operator=(const e2_lite& xfiber)
551 {
552  // Preconditions:
553 
554  require(precondition_of(sec_vd::operator=(xfiber)));
555 
556  // Body:
557 
558  sec_vd::operator=(xfiber);
559 
560  // Postconditions:
561 
562  ensure(postcondition_of(sec_vd::operator=(xfiber)));
563 
564  // Exit:
565 
566  return *this;
567 }
568 
572 {
573  // Preconditions:
574 
575  // Body:
576 
577  static const fiber_type result;
578 
579  // Postconditions:
580 
581  // Exit:
582 
583  return result;
584 }
585 
586 void
589  const block<dof_type>& xmax,
590  bool xauto_access)
591 {
592  // Preconditions:
593 
594  require(xmin.ct() >= 2);
595  require(xmax.ct() >= 2);
596  require_for_all(i, 0, 2, xmin[i] <= xmax[i]);
597  require(xauto_access || state_is_read_write_accessible());
598 
599  // Body:
600 
601  if(xauto_access)
602  {
603  get_read_write_access(true);
604  }
605 
606  // Set the coordinates dofs;
607  // uniform coordinates have only 8 dofs in 2d,
608  // the x,y coordinates at the corners of the domain.
609  // (Even these aren't all independent).
610 
612 
613  // Structured_block_2d ctor sets client ids to match the order
614  // for a normal quad.
615 
616  // xmin, ymin; client id 0.
617 
618  lfiber[0] = xmin[0];
619  lfiber[1] = xmin[1];
620  put_fiber(0, lfiber);
621 
622  // xmax, ymin; client id 1:
623 
624  lfiber[0] = xmax[0];
625  lfiber[1] = xmin[1];
626  put_fiber(1, lfiber);
627 
628  // xmax, ymax; client id 2.
629 
630  lfiber[0] = xmax[0];
631  lfiber[1] = xmax[1];
632  put_fiber(2, lfiber);
633 
634  // xmin, ymax; client id 3.
635 
636  lfiber[0] = xmin[0];
637  lfiber[1] = xmax[1];
638  put_fiber(3, lfiber);
639 
640  if(xauto_access)
641  {
642  release_access();
643  }
644 
645  // Postconditions:
646 
647  ensure(min_x(xauto_access) == xmin[0]);
648  ensure(min_y(xauto_access) == xmin[1]);
649  ensure(max_x(xauto_access) == xmax[0]);
650  ensure(max_y(xauto_access) == xmax[1]);
651 
652  // Exit:
653 
654  return;
655 }
656 
657 void
659 get_bounds(block<dof_type>& xmin, block<dof_type>& xmax, bool xauto_access) const
660 {
661  // Preconditions:
662 
663  require(xauto_access || state_is_read_accessible());
664 
665  // Body:
666 
667  if(xauto_access)
668  {
669  get_read_access();
670  }
671 
672  xmin.reserve(2);
673  xmin.set_ct(2);
674 
675  xmax.reserve(2);
676  xmax.set_ct(2);
677 
678  // Structured_block_2d ctor sets client ids to match the order
679  // for a normal quad.
680 
681  // xmin, ymin; client id 0.
682 
683  get_fiber(0, xmin.base(), xmin.ct()*sizeof(dof_type));
684 
685  // xmax, ymax; client id 2.
686 
687  get_fiber(2, xmax.base(), xmax.ct()*sizeof(dof_type));
688 
689  if(xauto_access)
690  {
691  release_access();
692  }
693 
694  // Postconditions:
695 
696  ensure(xmin.ct() == 2);
697  ensure(xmax.ct() == 2);
698  ensure_for_all(i, 0, 2, xmin[i] <= xmax[i]);
699 
700  // Exit:
701 
702  return;
703 }
704 
707 min_x(bool xauto_access) const
708 {
709  dof_type result;
710 
711  // Preconditions:
712 
713  require(xauto_access || state_is_read_accessible());
714 
715  // Body:
716 
717  if(xauto_access)
718  {
719  get_read_access();
720  }
721 
722  // min_x; client id 0.
723 
725  get_fiber(0, lfiber);
726 
727  result = lfiber[0];
728 
729  if(xauto_access)
730  {
731  release_access();
732  }
733 
734  // Postconditions:
735 
736 
737  // Exit:
738 
739  return result;
740 }
741 
744 min_y(bool xauto_access) const
745 {
746  dof_type result;
747 
748  // Preconditions:
749 
750  require(xauto_access || state_is_read_accessible());
751 
752  // Body:
753 
754  if(xauto_access)
755  {
756  get_read_access();
757  }
758 
759  // min_x; client id 0.
760 
762  get_fiber(0, lfiber);
763 
764  result = lfiber[1];
765 
766  if(xauto_access)
767  {
768  release_access();
769  }
770 
771  // Postconditions:
772 
773 
774  // Exit:
775 
776  return result;
777 }
778 
781 max_x(bool xauto_access) const
782 {
783  dof_type result;
784 
785  // Preconditions:
786 
787  require(xauto_access || state_is_read_accessible());
788 
789  // Body:
790 
791  if(xauto_access)
792  {
793  get_read_access();
794  }
795 
796  // max_x; client id 2.
797 
799  get_fiber(2, lfiber);
800 
801  result = lfiber[0];
802 
803  if(xauto_access)
804  {
805  release_access();
806  }
807 
808  // Postconditions:
809 
810 
811  // Exit:
812 
813  return result;
814 }
815 
818 max_y(bool xauto_access) const
819 {
820  dof_type result;
821 
822  // Preconditions:
823 
824  require(xauto_access || state_is_read_accessible());
825 
826  // Body:
827 
828  if(xauto_access)
829  {
830  get_read_access();
831  }
832 
833  // max_x; client id 2.
834 
836  get_fiber(2, lfiber);
837 
838  result = lfiber[1];
839 
840  if(xauto_access)
841  {
842  release_access();
843  }
844 
845  // Postconditions:
846 
847 
848  // Exit:
849 
850  return result;
851 }
852 
855 inc_x(bool xauto_access) const
856 {
857  dof_type result;
858 
859  // Preconditions:
860 
861  require(xauto_access || state_is_read_accessible());
862 
863  // Body:
864 
865  if(xauto_access)
866  {
867  get_read_access();
868  }
869 
870  // Get the number of zones in the x direction.
871 
872  base_space_poset& lbase_host = schema().host()->base_space();
873  pod_index_type lbase_id = schema().base_space_id();
875  lbase_host.member_dof_tuple(lbase_id, &ltuple, sizeof(ltuple), false);
876 
877  if(ltuple.i_size == 0)
878  {
879  result = 0;
880  }
881  else
882  {
883  result = (max_x(false) - min_x(false))/ltuple.i_size;
884  }
885 
886  if(xauto_access)
887  {
888  release_access();
889  }
890 
891  // Postconditions:
892 
893 
894  // Exit:
895 
896  return result;
897 }
898 
901 inc_y(bool xauto_access) const
902 {
903  dof_type result;
904 
905  // Preconditions:
906 
907  require(xauto_access || state_is_read_accessible());
908 
909  // Body:
910 
911  if(xauto_access)
912  {
913  get_read_access();
914  }
915 
916  // Get the number of zones in the x direction.
917 
918  base_space_poset& lbase_host = schema().host()->base_space();
919  pod_index_type lbase_id = schema().base_space_id();
921  lbase_host.member_dof_tuple(lbase_id, &ltuple, sizeof(ltuple), false);
922 
923  if(ltuple.j_size == 0)
924  {
925  result = 0;
926  }
927  else
928  {
929  result = (max_y(false) - min_y(false))/ltuple.j_size;
930  }
931 
932  if(xauto_access)
933  {
934  release_access();
935  }
936 
937  // Postconditions:
938 
939 
940  // Exit:
941 
942  return result;
943 }
944 
945 // PROTECTED MEMBER FUNCTIONS
946 
947 // PRIVATE MEMBER FUNCTIONS
948 
949 
950 //==============================================================================
951 // E2 FACET OF CLASS SEC_E2_UNIFORM
952 //==============================================================================
953 
954 // PUBLIC MEMBER FUNCTIONS
955 
956 // PROTECTED MEMBER FUNCTIONS
957 
958 // PRIVATE MEMBER FUNCTIONS
959 
960 
961 //==============================================================================
962 // ED FACET OF CLASS SEC_E2_UNIFORM
963 //==============================================================================
964 
965 // PUBLIC MEMBER FUNCTIONS
966 
967 // PROTECTED MEMBER FUNCTIONS
968 
969 // PRIVATE MEMBER FUNCTIONS
970 
971 
972 //==============================================================================
973 // AT1 FACET OF CLASS SEC_E2_UNIFORM
974 //==============================================================================
975 
976 // PUBLIC MEMBER FUNCTIONS
977 
978 // PROTECTED MEMBER FUNCTIONS
979 
980 // PRIVATE MEMBER FUNCTIONS
981 
982 
983 //==============================================================================
984 // ATP FACET OF CLASS SEC_E2_UNIFORM
985 //==============================================================================
986 
987 // PUBLIC MEMBER FUNCTIONS
988 
989 // PROTECTED MEMBER FUNCTIONS
990 
991 // PRIVATE MEMBER FUNCTIONS
992 
993 
994 //==============================================================================
995 // TP FACET OF CLASS SEC_E2_UNIFORM
996 //==============================================================================
997 
998 // PUBLIC MEMBER FUNCTIONS
999 
1000 // PROTECTED MEMBER FUNCTIONS
1001 
1002 // PRIVATE MEMBER FUNCTIONS
1003 
1004 
1005 //==============================================================================
1006 // VD FACET OF CLASS SEC_E2_UNIFORM
1007 //==============================================================================
1008 
1009 // PUBLIC MEMBER FUNCTIONS
1010 
1011 // PROTECTED MEMBER FUNCTIONS
1012 
1013 // PRIVATE MEMBER FUNCTIONS
1014 
1015 
1016 //==============================================================================
1017 // TUPLE FACET OF CLASS SEC_E2_UNIFORM
1018 //==============================================================================
1019 
1020 // PUBLIC MEMBER FUNCTIONS
1021 
1022 const sheaf::poset_path&
1025 {
1026 
1027  // Preconditions:
1028 
1029 
1030  // Body:
1031 
1032  static const poset_path
1033  result(sec_rep_descriptor::standard_host_path().poset_name(), "vertex_block_uniform");
1034 
1035  // Postconditions:
1036 
1037  ensure(result.full());
1038 
1039  // Exit:
1040 
1041  return result;
1042 }
1043 
1044 // PROTECTED MEMBER FUNCTIONS
1045 
1046 // PRIVATE MEMBER FUNCTIONS
1047 
1048 
1049 //==============================================================================
1050 // ABSTRACT POSET MEMBER FACET OF CLASS SEC_E2_UNIFORM
1051 //==============================================================================
1052 
1053 // PUBLIC MEMBER FUNCTIONS
1054 
1055 const std::string&
1057 class_name() const
1058 {
1059  // Preconditions:
1060 
1061  // Body:
1062 
1063  const string& result = static_class_name();
1064 
1065  // Postconditions:
1066 
1067  ensure(!result.empty());
1068 
1069  // Exit:
1070 
1071  return result;
1072 }
1073 
1074 const std::string&
1077 {
1078  // Preconditions:
1079 
1080  // Body:
1081 
1082  static const string result("sec_e2_uniform");
1083 
1084  // Postconditions:
1085 
1086  ensure(!result.empty());
1087 
1088  // Exit:
1089 
1090  return result;
1091 }
1092 
1095 clone() const
1096 {
1097 
1098  // Preconditions:
1099 
1100  // Body:
1101 
1102  // create new handle of the current class.
1103 
1104  sec_e2_uniform *result = new sec_e2_uniform();
1105 
1106  // Postconditions:
1107 
1108  ensure(result != 0);
1109  ensure(result->invariant());
1110 
1111  // Exit:
1112 
1113  return result;
1114 
1115 }
1116 
1117 // PROTECTED MEMBER FUNCTIONS
1118 
1119 // PRIVATE MEMBER FUNCTIONS
1120 
1121 
1122 //==============================================================================
1123 // ANY FACET OF CLASS SEC_E2_UNIFORM
1124 //==============================================================================
1125 
1126 // PUBLIC MEMBER FUNCTIONS
1127 
1128 bool
1130 is_ancestor_of(const any* xother) const
1131 {
1132  // Preconditions:
1133 
1134  require(xother != 0);
1135 
1136  // Body:
1137 
1138  // If other may be dynamically cast to the type of this then this is an
1139  // ancestor of other.
1140 
1141  bool result = dynamic_cast<const sec_e2_uniform*>(xother) != 0;
1142 
1143  // Postconditions:
1144 
1145  //ensure(invariant());
1146 
1147  // Exit:
1148 
1149  return result;
1150 
1151 }
1152 
1153 bool
1155 invariant() const
1156 {
1157  bool result = true;
1158 
1159  // Preconditions:
1160 
1161  // Body:
1162 
1163  // Must satisfy base class invariant
1164 
1165  invariance(sec_e2::invariant());
1166 
1167  if (invariant_check())
1168  {
1169  // Prevent recursive calls to invariant
1170 
1171  disable_invariant_check();
1172 
1173  // Finished, turn invariant checking back on.
1174 
1175  enable_invariant_check();
1176  }
1177 
1178  // Postconditions:
1179 
1180  ensure(is_derived_query);
1181 
1182  // Exit:
1183 
1184  return result;
1185 }
1186 
1187 // PROTECTED MEMBER FUNCTIONS
1188 
1189 // PRIVATE MEMBER FUNCTIONS
1190 
1191 
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
virtual poset_path path(bool xauto_access=true) const
The path of this poset.
bool state_is_auto_read_write_accessible(bool xauto_access) const
True if state is auto accessible for read and write, that is, if the state is already accessible for ...
A client handle for a subposet.
Definition: subposet.h:86
dof_type min_x(bool xauto_access) const
The minimum value of the x component.
sec_e2_uniform()
Default constructor; creates an unattached handle.
dof_type max_y(bool xauto_access) const
The maximum value of the y component.
dof_type max_x(bool xauto_access) const
The maximum value of the x component.
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
virtual const std::string & class_name() const
The name of this class.
static host_type & standard_host(namespace_type &xns, const poset_path &xbase_path, const poset_path &xrep_path, const std::string &xsection_suffix, const std::string &xfiber_suffix, bool xauto_access)
The standard host for sections of this type with base space xbase_path, representation xrep_path...
size_type ct() const
The number of items currently in use.
bool is_ancestor_of(const any *other) const
True if other conforms to current.
A Cartesian product section space.
The abstract map from section dof ids to section dof values of heterogeneous type.
Euclidean vector space of dimension 2 (persistent version).
Definition: e2.h:405
void put_bounds(const block< dof_type > &xmin, const block< dof_type > &xmax, bool xauto_access)
Sets the dofs to match the rectangle defined by xmin and xmax.
A space of scalars viewed as an antisymmetric tensor section space of degree 1.
Definition: sec_at1_space.h:48
static const poset_path & standard_rep_path()
The path to the standard rep for sections of this type.
virtual sec_e2_uniform * clone() const
Virtual constructor; makes a new instance of the same type as this.
poset_path path(bool xauto_access=true) const
A path to this component.
The default name space; a poset which contains other posets as members.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
bool path_is_auto_read_accessible(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath exists and is auto read accessible.
A general antisymmetric tensor of degree 1 over an abstract vector space (persistent version)...
Definition: at1.h:211
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
A general antisymmetric tensor of degree 1 over an abstract vector space (volatile version)...
Definition: at1.h:44
bool invariant() const
Class invariant.
A path defined by a poset name and a member name separated by a forward slash (&#39;/&#39;). For example: "cell_definitions/triangle".
Definition: poset_path.h:48
A member of a sec_rep_space; a section.
poset_path vector_space_path() const
The path of the underlying vector space.
STL namespace.
void reserve(index_type xub)
Makes ub() at least xub; if new storage is allocated, it is uninitialized.
A schema poset for a section space. A binary Cartesian product subspace of the binary tensor product ...
poset_state_handle & member_poset(pod_index_type xhub_id, bool xauto_access=true) const
The poset_state_handle object referred to by hub id xhub_id.
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, const poset_path &xscalar_space_path, bool xauto_access)
Creates a new host table for members of this type. The poset is created in namespace xns with path xh...
The poset for sec_rep_descriptors.
namespace_poset * host() const
The namespace this poset resides in. Obsolete; use name_space() instead.
Abstract base class with useful features for all objects.
Definition: any.h:39
int p() const
The tensor degree of this space.
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
sec_rep_descriptor & rep()
A representation descriptor for this sec rep space (mutable version).
virtual section_space_schema_member & schema()
The schema for this poset (mutable version)
dof_type inc_x(bool xauto_access) const
The increment of the x component; the change in the x component when the x vertex index is incremente...
size_type i_size
The upper bound on the x direction index for structured blocks.
Euclidean vector space of dimension 2 (volatile version).
Definition: e2.h:112
pointer_type base() const
The underlying storage array.
bool owns(const poset_state_handle &xposet, bool xauto_access) const
True if and only if this contains the poset xposet. synonym for contains_poset(xposet.poset_path(true), xauto_access)
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
virtual bool contains_member(pod_index_type xmbr_hub_id, bool xauto_access=true) const
True if some version of this poset contains poset member with hub id xmbr_hub_id. ...
virtual sec_e2_uniform & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
dof_type min_y(bool xauto_access) const
The minimum value of the y component.
int dd() const
The dimension of the underlying ("domain") vector space.
virtual const fiber_type & fiber_prototype() const
Virtual constructor for the associated fiber type.
bool empty() const
True if both poset name and member name are empty.
Definition: poset_path.cc:291
size_type j_size
The upper bound on the y direction index for structured blocks.
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
Definition: at1_space.h:42
void get_bounds(block< dof_type > &xmin, block< dof_type > &xmax, bool xauto_access) const
Gets the bounds.
static const std::string & static_class_name()
The name of this class.
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
A section of a fiber bundle with a 2-dimensional Euclidean vector space fiber.
poset_path scalar_space_path() const
The path of the underlying space of scalars.
poset & fiber_space()
The fiber space for section spaces on this schema (mutable version).
sec_vd_dof_type dof_type
The type of degree of freedom.
Definition: sec_vd.h:91
An abstract client handle for a member of a poset.
std::string path() const
The full path as a string.
Definition: poset_path.cc:450
The type of row dof tuple for base_space_member.
row_dof_tuple_type * member_dof_tuple(pod_index_type xmbr_hub_id, bool xrequire_write_access=false) const
The row dof tuple for the member with member hub id xmbr_hub_id.
An auto_block with a no-initialization initialization policy.
Namespace for the fiber_bundles component of the sheaf system.
dof_type inc_y(bool xauto_access) const
The increment of the y component; the change in the y component when the y vertex index is incremente...
virtual int d(int xp, int xdd) const
Dimension d() as a function of degree xp and domain dimension xdd.
bool state_is_not_read_accessible() const
True if this is attached and if the state is accessible for read or if access control is disabled...
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:710
void new_jim_state(sec_rep_space *xhost, const block< dof_type > &xmin, const block< dof_type > &xmax, bool xauto_access)
Attaches this to a new state in xhost with min_x() == xmin_x and max_x() == xmax_x.
A handle for a poset whose members are numerical representations of sections of a fiber bundle...
Definition: sec_rep_space.h:61