SheafSystem  0.0.0.0
sec_e1_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_e1_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/e1.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_1d.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_E1_UNIFORM
43 //==============================================================================
44 
45 // ===========================================================
46 // HOST FACTORY FACET OF CLASS SEC_E1_UNIFORM
47 // ===========================================================
48 
49 // PUBLIC MEMBER FUNCTIONS
50 
54  const poset_path& xhost_path,
55  const poset_path& xschema_path,
56  const poset_path& xscalar_space_path,
57  bool xauto_access)
58 {
59  // cout << endl << "Entering sec_e1_uniform::new_host." << endl;
60 
61  // Preconditions:
62 
63  require(xns.state_is_auto_read_write_accessible(xauto_access));
64 
65  require(!xhost_path.empty());
66  require(!xns.contains_path(xhost_path, xauto_access));
67 
68  require(xschema_path.full());
69  require(xns.path_is_auto_read_accessible<schema_type::host_type>(xschema_path, xauto_access));
70  require(host_type::fiber_space_conforms<fiber_type::host_type>(xns, xschema_path, xauto_access));
71 
72  require(xns.path_is_auto_read_accessible<scalar_type::host_type>(xscalar_space_path, xauto_access));
73 
74  require(host_type::same_scalar_fiber_space(xns, xschema_path, xscalar_space_path, xauto_access));
75 
76  // Body:
77 
78  host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xscalar_space_path, xauto_access);
79 
80  // Postconditions:
81 
82  ensure(xns.owns(result, xauto_access));
83  ensure(result.path(true) == xhost_path);
84  ensure(result.state_is_not_read_accessible());
85  ensure(result.schema(true).path(xauto_access) == xschema_path);
86 
87  ensure(result.factor_ct(true) == result.schema(true).fiber_space<fiber_type::host_type>().factor_ct(xauto_access));
88  ensure(result.d(true) == result.schema(true).fiber_space<fiber_type::host_type>().d(xauto_access));
89  ensure(result.d(true) == result.dd(true));
90  ensure(result.scalar_space_path(true) == xscalar_space_path);
91  ensure(result.p(true) == result.schema(true).fiber_space<fiber_type::host_type>().p(xauto_access));
92  ensure(result.p(true) == 1);
93  ensure(result.dd(true) == result.schema(true).fiber_space<fiber_type::host_type>().dd(xauto_access));
94  ensure(result.vector_space_path(true) == xhost_path);
95 
96  // Exit:
97 
98  // cout << "Leaving sec_e1_uniform::new_host." << endl;
99  return result;
100 }
101 
105  const poset_path& xbase_path,
106  const poset_path& xrep_path,
107  const std::string& xsection_suffix,
108  const std::string& xfiber_suffix,
109  bool xauto_access)
110 {
111  // cout << endl << "Entering sec_e1_uniform::new_host." << endl;
112 
113  // Preconditions:
114 
115  require(xns.state_is_auto_read_write_accessible(xauto_access));
116 
117  require(xbase_path.full());
118  require(xns.path_is_auto_read_accessible<base_space_poset>(xbase_path, xauto_access));
119 
120  require(xrep_path.empty() || xrep_path.full());
121  require(xrep_path.empty() || xns.path_is_auto_read_accessible<sec_rep_descriptor_poset>(xrep_path, xauto_access));
122 
123  require(xsection_suffix.empty() || poset_path::is_valid_name(xsection_suffix));
124 
125  require(xfiber_suffix.empty() || poset_path::is_valid_name(xfiber_suffix));
126 
127  require(standard_host_is_available<sec_e1_uniform>(xns, xbase_path, xrep_path, xsection_suffix, xfiber_suffix, xauto_access));
128  require(fiber_type::standard_host_is_available<fiber_type>(xns, xfiber_suffix, xauto_access));
129  require(schema_type::standard_host_is_available<sec_e1_uniform>(xns, xbase_path, xrep_path, xfiber_suffix, xauto_access));
130 
131  // Body:
132 
133  poset_path lstd_path = standard_host_path<sec_e1_uniform>(xbase_path, xrep_path, xsection_suffix, xfiber_suffix);
134 
135  host_type* lresult_ptr;
136 
137  if(xns.contains_path(lstd_path, xauto_access))
138  {
139  // Standard host already exists, just return it.
140 
141  lresult_ptr = &xns.member_poset<host_type>(lstd_path, xauto_access);
142  }
143  else
144  {
145  // Standard host doesn't exist, have to create it.
146 
147  // Apply default for rep path if needed.
148 
149  poset_path lrep_path = (!xrep_path.empty() ? xrep_path : standard_rep_path());
150 
151  // Find or create the standard schema member.
152 
153  poset_path lstd_schema_path =
154  schema_type::standard_member<sec_e1_uniform>(xns, xbase_path, lrep_path, xfiber_suffix, xauto_access);
155 
156  // Find or create the standard scalar space.
157 
158  poset_path lscalar_space_path =
159  scalar_type::standard_host(xns, xbase_path, lrep_path, xsection_suffix, xfiber_suffix, xauto_access).path(xauto_access);
160 
161  // Create the standard host.
162 
163  lresult_ptr = &new_host(xns, lstd_path, lstd_schema_path, lscalar_space_path, xauto_access);
164  }
165 
166  host_type& result = *lresult_ptr;
167 
168  // Postconditions:
169 
170  ensure(xns.owns(result, xauto_access));
171  ensure(result.path(true) == standard_host_path<sec_e1_uniform>(xbase_path, xrep_path, xsection_suffix, xfiber_suffix));
172  ensure(result.state_is_not_read_accessible());
173  ensure(result.schema(true).path(xauto_access) ==
174  schema_type::standard_member_path<sec_e1_uniform>(xbase_path, xrep_path, xfiber_suffix));
175 
176  ensure(result.factor_ct(true) == result.schema(true).fiber_space<fiber_type::host_type>().factor_ct(xauto_access));
177  ensure(result.d(true) == result.schema(true).fiber_space<fiber_type::host_type>().d(xauto_access));
178  ensure(result.d(true) == result.dd(true));
179  ensure(result.scalar_space_path(true) ==
180  scalar_type::standard_host_path<scalar_type>(xbase_path, result.rep().path(xauto_access), xsection_suffix, xfiber_suffix));
181  ensure(result.p(true) == result.schema(true).fiber_space<fiber_type::host_type>().p(xauto_access));
182  ensure(result.p(true) == 1);
183  ensure(result.dd(true) == result.schema(true).fiber_space<fiber_type::host_type>().dd(xauto_access));
184  ensure(result.vector_space_path(true) == result.path(true));
185 
186  // Exit:
187 
188  // cout << "Leaving sec_e1_uniform::new_host." << endl;
189  return result;
190 }
191 
192 // PROTECTED MEMBER FUNCTIONS
193 
194 // PRIVATE MEMBER FUNCTIONS
195 
196 
197 //==============================================================================
198 // SEC_E1_UNIFORM FACET OF CLASS SEC_E1_UNIFORM
199 //==============================================================================
200 
201 // PUBLIC MEMBER FUNCTIONS
202 
205 {
206 
207  // Preconditions:
208 
209  // Body:
210 
211  // Postconditions:
212 
213  ensure(invariant());
214 }
215 
216 // =============================================================================
217 // NEW HANDLE, NEW STATE CONSTRUCTORS
218 // =============================================================================
219 
222  dof_type xmin_x,
223  dof_type xmax_x,
224  bool xauto_access)
225 {
226  // Preconditions:
227 
228  require(precondition_of(new_jim_state(xhost, xmin_x, xmax_x, xauto_access)));
229 
230  // Body:
231 
232  new_jim_state(xhost, xmin_x, xmax_x, xauto_access);
233 
234  // Postconditions:
235 
236  ensure(postcondition_of(new_jim_state(xhost, xmin_x, xmax_x, xauto_access)));
237 
238  // Exit:
239 
240  return;
241 }
242 
243 
245 sec_e1_uniform(sec_rep_space* xhost, section_dof_map* xdof_map, bool xauto_access)
246 {
247  // Preconditions:
248 
249  require(precondition_of(new_jim_state(xhost, xdof_map, false, xauto_access)));
250 
251  // Body:
252 
253  new_jim_state(xhost, xdof_map, false, xauto_access);
254 
255  // Postconditions:
256 
257  ensure(postcondition_of(new_jim_state(xhost, xdof_map, false, xauto_access)));
258 
259  // Exit:
260 
261  return;
262 }
263 
266  abstract_poset_member& xbase_mbr,
267  int xbase_version,
268  bool xauto_access)
269 {
270 
271  // Preconditions:
272 
273  require(precondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
274 
275  // Body:
276 
277  new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access);
278 
279  // Postconditions:
280 
281  ensure(postcondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
282 
283  // Exit:
284 
285  return;
286 }
287 
289 sec_e1_uniform(sec_rep_space* xhost, const subposet& xbase_parts, bool xauto_access)
290 {
291  // Preconditions:
292 
293  require(precondition_of(new_jim_state(xhost, xbase_parts, xauto_access)));
294 
295  // Body:
296 
297  new_jrm_state(xhost, xbase_parts, xauto_access);
298 
299  // Postconditions:
300 
301  require(postcondition_of(new_jim_state(xhost, xbase_parts, xauto_access)));
302 
303  // Exit:
304 
305  return;
306 }
307 
308 // =============================================================================
309 // NEW HANDLE, EXISTING STATE CONSTRUCTORS
310 // =============================================================================
311 
314 {
315  // Preconditions:
316 
317  require(xhost != 0);
318  require(xhost->state_is_read_accessible());
319  require(xhost->contains_member(xindex));
320 
321  // Body:
322 
323  attach_to_state(xhost, xindex);
324 
325  // Postconditions:
326 
327  ensure(invariant());
328  //ensure(host() == xhost);
329  ensure(index() == xindex);
330  ensure(is_attached());
331  ensure(!is_restricted());
332 }
333 
335 sec_e1_uniform(const sec_rep_space* xhost, const scoped_index& xindex)
336 {
337 
338  // Preconditions:
339 
340  require(xhost != 0);
341  require(xhost->state_is_read_accessible());
342  require(xhost->contains_member(xindex));
343 
344  // Body:
345 
346  attach_to_state(xhost, xindex.hub_pod());
347 
348  // Postconditions:
349 
350  ensure(invariant());
351  //ensure(host() == xhost);
352  ensure(index() ==~ xindex);
353  ensure(is_attached());
354  ensure(!is_restricted());
355 
356 }
357 
359 sec_e1_uniform(const sec_rep_space* xhost, const std::string& xname)
360 {
361 
362  // Preconditions:
363 
364  require(xhost != 0);
365  require(xhost->state_is_read_accessible());
366  require(!xname.empty());
367  require(xhost->contains_member(xname));
368 
369  // Body:
370 
371  attach_to_state(xhost, xname);
372 
373  // Postconditions:
374 
375  ensure(invariant());
376  //ensure(host() == xhost);
377  ensure(name() == xname);
378  ensure(is_attached());
379  ensure(!is_restricted());
380 
381 }
382 
383 
385 sec_e1_uniform(const namespace_poset* xnamespace,
386  const poset_path& xpath,
387  bool xauto_access)
388 {
389 
390  // Preconditions:
391 
392  require(precondition_of(attach_to_state(same args)));
393 
394  // Body:
395 
396  attach_to_state(xnamespace, xpath, xauto_access);
397 
398  // Postconditions:
399 
400  ensure(postcondition_of(attach_to_state(same args)));
401 
402  // Exit:
403 
404  return;
405 }
406 
407 
410 {
411 
412  // Preconditions:
413 
414  require(xother != 0);
415 
416  // Body:
417 
418  attach_to_state(xother);
419 
420  // Postconditions:
421 
422  ensure(invariant());
423  ensure(is_attached());
424  ensure(is_same_state(xother));
425  ensure(is_same_restriction(xother));
426 
427 }
428 
431 {
432 
433  // Preconditions:
434 
435  // Body:
436 
437  // Postconditions:
438 
439 }
440 
441 // =============================================================================
442 // EXISTING HANDLE, NEW STATE "CONSTRUCTORS"
443 // =============================================================================
444 
445 void
448  dof_type xmin_x,
449  dof_type xmax_x,
450  bool xauto_access)
451 {
452  // Preconditions:
453 
454  require(precondition_of(new_jim_state(xhost, 0, false, xauto_access)));
455  require(xmin_x <= xmax_x);
456 
457  // Body:
458 
459  new_jim_state(xhost, static_cast<poset_dof_map*>(0), false, xauto_access);
460  put_bounds(xmin_x, xmax_x, xauto_access);
461 
462  // Postconditions:
463 
464  ensure(min_x(xauto_access) == xmin_x);
465  ensure(max_x(xauto_access) == xmax_x);
466 
467  // Exit:
468 
469  return;
470 }
471 
472 // ===========================================================================
473 // OTHER
474 // ===========================================================================
475 
479 {
480  // Preconditions:
481 
482  require(is_ancestor_of(&xother));
483  require(precondition_of(attach_to_state(&xother)));
484 
485  // Body:
486 
487  attach_to_state(&xother);
488 
489  // Postconditions:
490 
491  ensure(postcondition_of(attach_to_state(&xother)));
492 
493  // Exit:
494 
495  return *this;
496 }
497 
500 operator=(const sec_e1_uniform& xother)
501 {
502  // Preconditions:
503 
504  require(precondition_of(attach_to_state(&xother)));
505 
506  // Body:
507 
508  attach_to_state(&xother);
509 
510  // Postconditions:
511 
512  ensure(postcondition_of(attach_to_state(&xother)));
513 
514  // Exit:
515 
516  return *this;
517 }
518 
521 operator=(const e1& xfiber)
522 {
523  // Preconditions:
524 
525  require(precondition_of(sec_vd::operator=(xfiber)));
526 
527  // Body:
528 
529  sec_vd::operator=(xfiber);
530 
531  // Postconditions:
532 
533  ensure(postcondition_of(sec_vd::operator=(xfiber)));
534 
535  // Exit:
536 
537  return *this;
538 }
539 
542 operator=(const e1_lite& xfiber)
543 {
544  // Preconditions:
545 
546  require(precondition_of(sec_vd::operator=(xfiber)));
547 
548  // Body:
549 
550  sec_vd::operator=(xfiber);
551 
552  // Postconditions:
553 
554  ensure(postcondition_of(sec_vd::operator=(xfiber)));
555 
556  // Exit:
557 
558  return *this;
559 }
560 
564 {
565  // Preconditions:
566 
567  // Body:
568 
569  static const fiber_type result;
570 
571  // Postconditions:
572 
573  // Exit:
574 
575  return result;
576 }
577 
578 void
580 put_bounds(const block<dof_type>& xmin, const block<dof_type>& xmax, bool xauto_access)
581 {
582  // Preconditions:
583 
584  require(xmin.ct() >= 1);
585  require(xmax.ct() >= 1);
586  require(xmin[0] <= xmax[0]);
587  require(xauto_access || state_is_read_write_accessible());
588 
589  // Body:
590 
591  put_bounds(xmin[0], xmax[0], xauto_access);
592 
593  // Postconditions:
594 
595  ensure(min_x(xauto_access) == xmin[0]);
596  ensure(max_x(xauto_access) == xmax[0]);
597 
598  // Exit:
599 
600  return;
601 }
602 
603 void
605 put_bounds(dof_type xmin_x, dof_type xmax_x, bool xauto_access)
606 {
607  // Preconditions:
608 
609  require(xmin_x <= xmax_x);
610  require(xauto_access || state_is_read_write_accessible());
611 
612  // Body:
613 
614  if(xauto_access)
615  {
616  get_read_write_access(true);
617  }
618 
619  // Structured_block_1d ctor sets client ids to match the order
620  // for a normal seqment.
621 
622  // xmin_x; client id 0.
623 
625 
626  lfiber = xmin_x;
627  put_fiber(0, lfiber);
628 
629  // xmax_x; client id 1:
630 
631  lfiber = xmax_x;
632  put_fiber(1, lfiber);
633 
634  if(xauto_access)
635  {
636  release_access();
637  }
638 
639  // Postconditions:
640 
641  ensure(min_x(xauto_access) == xmin_x);
642  ensure(max_x(xauto_access) == xmax_x);
643 
644  // Exit:
645 
646  return;
647 }
648 
649 void
651 get_bounds(block<dof_type>& xmin, block<dof_type>& xmax, bool xauto_access) const
652 {
653  // Preconditions:
654 
655  require(xauto_access || state_is_read_accessible());
656 
657  // Body:
658 
659  if(xauto_access)
660  {
661  get_read_access();
662  }
663 
664  xmin.reserve(1);
665  xmin.set_ct(1);
666 
667  xmax.reserve(1);
668  xmax.set_ct(1);
669 
670  // Structured_block_1d ctor sets client ids to match the order
671  // for a normal seqment.
672 
673  // xmin_x; client id 0.
674 
675  get_fiber(0, xmin.base(), xmin.ct()*sizeof(dof_type));
676 
677  // xmax_x; client id 1:
678 
679  get_fiber(1, xmax.base(), xmax.ct()*sizeof(dof_type));
680 
681  if(xauto_access)
682  {
683  release_access();
684  }
685 
686  // Postconditions:
687 
688  ensure(xmin.ct() == 1);
689  ensure(xmax.ct() == 1);
690  ensure_for_all(i, 0, 1, xmin[i] <= xmax[i]);
691 
692  // Exit:
693 
694  return;
695 }
696 
699 min_x(bool xauto_access) const
700 {
701  dof_type result;
702 
703  // Preconditions:
704 
705  require(xauto_access || state_is_read_accessible());
706 
707  // Body:
708 
709  if(xauto_access)
710  {
711  get_read_access();
712  }
713 
714  // min_x; client id 0.
715 
717  get_fiber(0, lfiber);
718 
719  result = lfiber[0];
720 
721  if(xauto_access)
722  {
723  release_access();
724  }
725 
726  // Postconditions:
727 
728 
729  // Exit:
730 
731  return result;
732 }
733 
736 max_x(bool xauto_access) const
737 {
738  dof_type result;
739 
740  // Preconditions:
741 
742  require(xauto_access || state_is_read_accessible());
743 
744  // Body:
745 
746  if(xauto_access)
747  {
748  get_read_access();
749  }
750 
751  // max_x; client id 1.
752 
754  get_fiber(1, lfiber);
755 
756  result = lfiber[0];
757 
758  if(xauto_access)
759  {
760  release_access();
761  }
762 
763  // Postconditions:
764 
765 
766  // Exit:
767 
768  return result;
769 }
770 
773 inc_x(bool xauto_access) const
774 {
775  dof_type result;
776 
777  // Preconditions:
778 
779  require(xauto_access || state_is_read_accessible());
780 
781  // Body:
782 
783  if(xauto_access)
784  {
785  get_read_access();
786  }
787 
788  // Get the number of zones in the x direction.
789 
790  base_space_poset& lbase_host = schema().host()->base_space();
791  pod_index_type lbase_id = schema().base_space_id();
793  lbase_host.member_dof_tuple(lbase_id, &ltuple, sizeof(ltuple), false);
794 
795  if(ltuple.i_size == 0)
796  {
797  result = 0;
798  }
799  else
800  {
801  result = (max_x(false) - min_x(false))/ltuple.i_size;
802  }
803 
804  if(xauto_access)
805  {
806  release_access();
807  }
808 
809  // Postconditions:
810 
811 
812  // Exit:
813 
814  return result;
815 }
816 
817 // PROTECTED MEMBER FUNCTIONS
818 
819 // PRIVATE MEMBER FUNCTIONS
820 
821 
822 //==============================================================================
823 // E1 FACET OF CLASS SEC_E1_UNIFORM
824 //==============================================================================
825 
826 // PUBLIC MEMBER FUNCTIONS
827 
828 // PROTECTED MEMBER FUNCTIONS
829 
830 // PRIVATE MEMBER FUNCTIONS
831 
832 
833 //==============================================================================
834 // ED FACET OF CLASS SEC_E1_UNIFORM
835 //==============================================================================
836 
837 // PUBLIC MEMBER FUNCTIONS
838 
839 // PROTECTED MEMBER FUNCTIONS
840 
841 // PRIVATE MEMBER FUNCTIONS
842 
843 
844 //==============================================================================
845 // AT1 FACET OF CLASS SEC_E1_UNIFORM
846 //==============================================================================
847 
848 // PUBLIC MEMBER FUNCTIONS
849 
850 // PROTECTED MEMBER FUNCTIONS
851 
852 // PRIVATE MEMBER FUNCTIONS
853 
854 
855 //==============================================================================
856 // ATP FACET OF CLASS SEC_E1_UNIFORM
857 //==============================================================================
858 
859 // PUBLIC MEMBER FUNCTIONS
860 
861 // PROTECTED MEMBER FUNCTIONS
862 
863 // PRIVATE MEMBER FUNCTIONS
864 
865 
866 //==============================================================================
867 // TP FACET OF CLASS SEC_E1_UNIFORM
868 //==============================================================================
869 
870 // PUBLIC MEMBER FUNCTIONS
871 
872 // PROTECTED MEMBER FUNCTIONS
873 
874 // PRIVATE MEMBER FUNCTIONS
875 
876 
877 //==============================================================================
878 // VD FACET OF CLASS SEC_E1_UNIFORM
879 //==============================================================================
880 
881 // PUBLIC MEMBER FUNCTIONS
882 
883 // PROTECTED MEMBER FUNCTIONS
884 
885 // PRIVATE MEMBER FUNCTIONS
886 
887 
888 //==============================================================================
889 // TUPLE FACET OF CLASS SEC_E1_UNIFORM
890 //==============================================================================
891 
892 // PUBLIC MEMBER FUNCTIONS
893 
894 const sheaf::poset_path&
897 {
898  // Preconditions:
899 
900  // Body:
901 
902  static const poset_path
903  result(sec_rep_descriptor::standard_host_path().poset_name(), "vertex_block_uniform");
904 
905  // Postconditions:
906 
907  ensure(result.full());
908 
909  // Exit:
910 
911  return result;
912 }
913 
914 // PROTECTED MEMBER FUNCTIONS
915 
916 // PRIVATE MEMBER FUNCTIONS
917 
918 
919 //==============================================================================
920 // ABSTRACT POSET MEMBER FACET OF CLASS SEC_E1_UNIFORM
921 //==============================================================================
922 
923 // PUBLIC MEMBER FUNCTIONS
924 
925 const std::string&
927 class_name() const
928 {
929  // Preconditions:
930 
931  // Body:
932 
933  const string& result = static_class_name();
934 
935  // Postconditions:
936 
937  ensure(!result.empty());
938 
939  // Exit:
940 
941  return result;
942 }
943 
944 const std::string&
947 {
948  // Preconditions:
949 
950  // Body:
951 
952  static const string result("sec_e1_uniform");
953 
954  // Postconditions:
955 
956  ensure(!result.empty());
957 
958  // Exit:
959 
960  return result;
961 }
962 
965 clone() const
966 {
967 
968  // Preconditions:
969 
970  // Body:
971 
972  // create new handle of the current class.
973 
974  sec_e1_uniform *result = new sec_e1_uniform();
975 
976  // Postconditions:
977 
978  ensure(result != 0);
979  ensure(result->invariant());
980 
981  // Exit:
982 
983  return result;
984 
985 }
986 
987 // PROTECTED MEMBER FUNCTIONS
988 
989 // PRIVATE MEMBER FUNCTIONS
990 
991 
992 //==============================================================================
993 // ANY FACET OF CLASS SEC_E1_UNIFORM
994 //==============================================================================
995 
996 // PUBLIC MEMBER FUNCTIONS
997 
998 bool
1000 is_ancestor_of(const any* xother) const
1001 {
1002  // Preconditions:
1003 
1004  require(xother != 0);
1005 
1006  // Body:
1007 
1008  // If other may be dynamically cast to the type of this then this is an
1009  // ancestor of other.
1010 
1011  bool result = dynamic_cast<const sec_e1_uniform*>(xother) != 0;
1012 
1013  // Postconditions:
1014 
1015  //ensure(invariant());
1016 
1017  // Exit:
1018 
1019  return result;
1020 
1021 }
1022 
1023 bool
1025 invariant() const
1026 {
1027  bool result = true;
1028 
1029  // Preconditions:
1030 
1031  // Body:
1032 
1033  // Must satisfy base class invariant
1034 
1035  invariance(sec_e1::invariant());
1036 
1037  if (invariant_check())
1038  {
1039  // Prevent recursive calls to invariant
1040 
1041  disable_invariant_check();
1042 
1043  // Finished, turn invariant checking back on.
1044 
1045  enable_invariant_check();
1046  }
1047 
1048  // Postconditions:
1049 
1050  ensure(is_derived_query);
1051 
1052  // Exit:
1053 
1054  return result;
1055 }
1056 
1057 // PROTECTED MEMBER FUNCTIONS
1058 
1059 // PRIVATE MEMBER FUNCTIONS
1060 
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
A section of a fiber bundle with a 1-dimensional Euclidean vector space fiber.
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
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
size_type ct() const
The number of items currently in use.
A Cartesian product section space.
The abstract map from section dof ids to section dof values of heterogeneous type.
A space of scalars viewed as an antisymmetric tensor section space of degree 1.
Definition: sec_at1_space.h:48
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...
static const std::string & static_class_name()
The name of this class.
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...
dof_type min_x(bool xauto_access) const
The minimum value of the x component.
void get_bounds(block< dof_type > &xmin, block< dof_type > &xmax, bool xauto_access) const
Gets the bounds.
A general antisymmetric tensor of degree 1 over an abstract vector space (volatile version)...
Definition: at1.h:44
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...
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.
void new_jim_state(sec_rep_space *xhost, dof_type xmin_x, dof_type xmax_x, bool xauto_access)
Attaches this to a new state in xhost with min_x() == xmin_x and max_x() == xmax_x.
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.
The poset for sec_rep_descriptors.
namespace_poset * host() const
The namespace this poset resides in. Obsolete; use name_space() instead.
virtual sec_e1_uniform * clone() const
Virtual constructor; makes a new instance of the same type as this.
Euclidean vector space of dimension 1 (persistent version).
Definition: e1.h:400
virtual sec_e1_uniform & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
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...
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)
static const poset_path & standard_rep_path()
The path to the standard rep for sections of this type.
size_type i_size
The upper bound on the x direction index for structured blocks.
void put_bounds(const block< dof_type > &xmin, const block< dof_type > &xmax, bool xauto_access)
Sets the dofs to match the bounds xmin and xmax.
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. ...
int dd() const
The dimension of the underlying ("domain") vector space.
bool empty() const
True if both poset name and member name are empty.
Definition: poset_path.cc:291
virtual const std::string & class_name() const
The name of this class.
virtual const fiber_type & fiber_prototype() const
Virtual constructor for the associated fiber type.
bool is_ancestor_of(const any *other) const
True if other conforms to current.
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
Definition: at1_space.h:42
bool invariant() const
Class invariant.
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
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
sec_e1_uniform()
Default constructor; creates an unattached handle.
Euclidean vector space of dimension 1 (volatile version).
Definition: e1.h:113
An abstract client handle for a member of a poset.
dof_type max_x(bool xauto_access) const
The maximum value of the x component.
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.
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...
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.
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
A handle for a poset whose members are numerical representations of sections of a fiber bundle...
Definition: sec_rep_space.h:61