SheafSystem  0.0.0.0
structured_block_1d.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/structured_block_1d.h"
22 
23 #include "SheafSystem/assert_contract.h"
24 #include "SheafSystem/arg_list.h"
25 //#include "SheafSystem/base_space_member_prototype.h"
26 #include "SheafSystem/chart_point_3d.h"
27 #include "SheafSystem/fiber_bundles_namespace.h"
28 #include "SheafSystem/namespace_poset.h"
29 #include "SheafSystem/poset_path.h"
30 #include "SheafSystem/preorder_iterator.h"
31 #include "SheafSystem/tern.h"
32 #include "SheafSystem/wsv_block.h"
33 
34 using namespace fiber_bundle; // Workaround for MS C++ bug.
35 
36 // ===========================================================
37 // HOST FACTORY FACET
38 // ===========================================================
39 
40 // PUBLIC DATA MEMBERS
41 
42 const sheaf::poset_path&
45 {
46 
47  // Preconditions:
48 
49  // Body:
50 
51  static const poset_path
52  STATIC_PROTOTYPE_PATH(base_space_member::prototypes_poset_name(), "structured_block_1d");
53 
54  const poset_path& result = STATIC_PROTOTYPE_PATH;
55 
56  // Postconditions:
57 
59  ensure(result.member_name() == "structured_block_1d");
60 
61  // Exit
62 
63  return result;
64 }
65 
68 new_host(namespace_type& xns, const poset_path& xhost_path, const poset_path& xschema_path, bool xauto_access)
69 {
70  // cout << endl << "Entering structured_block_1d::new_host." << endl;
71 
72  // Preconditions:
73 
74  require(xns.state_is_auto_read_write_accessible(xauto_access));
75 
76  require(!xhost_path.empty());
77  require(!xns.contains_path(xhost_path, xauto_access));
78 
79  require(xschema_path.full());
80  require(xns.path_is_auto_read_accessible(xschema_path, xauto_access));
81  require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path(), xauto_access));
82 
83  // Body:
84 
85  host_type& result =
86  host_type::new_table(xns, xhost_path, xschema_path, 1, xauto_access);
87 
88  // Postconditions:
89 
90  ensure(xns.owns(result, xauto_access));
91  ensure(result.path(true) == xhost_path);
92  ensure(result.state_is_not_read_accessible());
93  ensure(result.schema(true).path(xauto_access) == xschema_path);
94 
95  ensure(result.max_db() == 1);
96 
97  // Exit:
98 
99  // cout << "Leaving structured_block_1d::new_host." << endl;
100  return result;
101 }
102 
105 standard_host(namespace_type& xns, const poset_path& xhost_path, bool xauto_access)
106 {
107  // cout << endl << "Entering structured_block_1d::standard_host." << endl;
108 
109  // Preconditions:
110 
111  require(xns.state_is_auto_read_write_accessible(xauto_access));
112 
113  require(poset_path::is_valid_name(xhost_path.poset_name()));
114  require(xns.path_is_auto_read_write_available<host_type>(xhost_path.poset_name(), xauto_access));
115 
116  require(xns.path_is_auto_read_accessible(standard_schema_path(), xauto_access));
117 
118  // Body:
119 
120  host_type* result_ptr;
121  if(xns.contains_path(xhost_path.poset_name(), xauto_access))
122  {
123  result_ptr = &xns.member_poset<host_type>(xhost_path, xauto_access);
124  }
125  else
126  {
127  result_ptr = &new_host(xns, xhost_path, standard_schema_path(), xauto_access);
128  }
129 
130  host_type& result = *result_ptr;
131 
132  // Postconditions:
133 
134  ensure(xns.owns(result, xauto_access));
135  ensure(result.path(true) == xhost_path);
136  ensure(result.state_is_not_read_accessible());
137  ensure(result.schema(true).path(xauto_access) == standard_schema_path());
138 
139  ensure(result.max_db() == 1);
140 
141  // Exit:
142 
143  // cout << "Leaving structured_block_1d::standard_host." << endl;
144  return result;
145 }
146 
147 // PROTECTED DATA MEMBERS
148 
149 // PRIVATE DATA MEMBERS
150 
151 
152 // ===========================================================
153 // STRUCTURED_BLOCK_1D FACET
154 // ===========================================================
155 
156 // PUBLIC DATA MEMBERS
157 
160 {
161  // Preconditions:
162 
163  // Body:
164 
165  _interval = 0;
166 
167  // Postconditions:
168 
169  ensure(invariant());
170  ensure(! is_attached() );
171 }
172 
173 
175 structured_block_1d(const abstract_poset_member& xother, bool xnew_jem)
176 {
177  // Preconditions:
178 
179  require(xnew_jem ? xother.is_attached() : true);
180 
181  // Body:
182 
183  if(xnew_jem)
184  {
185  new_jem_state(const_cast<abstract_poset_member*>(&xother), true, true);
186  }
187  else
188  {
189  attach_to_state(&xother);
190  }
191 
192  // postconditions:
193 
194  ensure(invariant());
195  ensure(is_attached() == xother.is_attached() );
196 }
197 
200 {
201  // Preconditions:
202 
203  // Body:
204 
205  // Exit
206 
207  return;
208 }
209 
210 // NEW HANDLE, NEW STATE CONSTRUCTORS:
211 
212 
214 structured_block_1d(poset* xhost, const size_type& xi_size, bool xauto_access)
215 {
216  // Preconditions:
217 
218  require(precondition_of(new_state(same args)));
219 
220  // Body:
221 
222  new_state(xhost, xi_size, xauto_access);
223 
224  // Postconditions:
225 
226  ensure(postcondition_of(new_state(same args)));
227 
228  // Exit:
229 
230  return;
231 }
232 
233 // NEW HANDLE, EXISTING STATE CONSTRUCTORS:
234 
237 {
238  // Preconditions:
239 
240  require(precondition_of(attach_to_state(xhost, xhub_id)));
241 
242  // Body:
243 
244  attach_to_state(xhost, xhub_id);
245 
246  // Postconditions:
247 
248  ensure(postcondition_of(attach_to_state(xhost, xhub_id)));
249 }
250 
252 structured_block_1d(const poset* xhost, const scoped_index& xid)
253 {
254  // Preconditions:
255 
256  require(precondition_of(attach_to_state(xhost, xid)));
257 
258  // Body:
259 
260  attach_to_state(xhost, xid.hub_pod());
261 
262  // Postconditions:
263 
264  ensure(postcondition_of(attach_to_state(xhost, xid)));
265 }
266 
267 
269 structured_block_1d(const poset* xhost, const std::string& xname)
270 {
271  // Preconditions:
272 
273  require(precondition_of(attach_to_state(same args)));
274 
275  // Body:
276 
277  attach_to_state(xhost, xname);
278 
279  // Postconditions:
280 
281  ensure(postcondition_of(attach_to_state(same args)));
282 }
283 
284 
287  const poset_path& xpath,
288  bool xauto_access)
289 {
290  // Preconditions:
291 
293 
294  require(precondition_of(attach_to_state(same args)));
295 
296  // Body:
297 
298  attach_to_state(xnamespace, xpath, xauto_access);
299 
300  // Postconditions:
301 
302  ensure(postcondition_of(attach_to_state(same args)));
303 
304  // Exit:
305 
306  return;
307 }
308 
311  pod_index_type xposet_id,
312  pod_index_type xmember_id)
313 {
314  // Preconditions:
315 
317 
318  require(precondition_of(attach_to_state(same args)));
319 
320  // Body:
321 
322  attach_to_state(xnamespace, xposet_id, xmember_id);
323 
324  // Postconditions:
325 
326  ensure(postcondition_of(attach_to_state(same args)));
327 
328  // Exit:
329 
330  return;
331 }
332 
335  const scoped_index& xposet_id,
336  const scoped_index& xmember_id)
337 {
338  // Preconditions:
339 
341 
342  require(precondition_of(attach_to_state(same args)));
343 
344  // Body:
345 
346  attach_to_state(xnamespace, xposet_id.hub_pod(), xmember_id.hub_pod());
347 
348  // Postconditions:
349 
350  ensure(postcondition_of(attach_to_state(same args)));
351 
352  // Exit:
353 
354  return;
355 }
356 
357 // EXISTING HANDLE, NEW STATE "CONSTRUCTORS":
358 
359 void
361 new_state(const size_type& xi_size, bool xauto_access)
362 {
363  // Preconditions:
364 
365  require(precondition_of(new_state(host(), xi_size, xauto_access)));
366 
367  // Body:
368 
369  new_state(host(), xi_size, xauto_access);
370 
371  // Postconditions:
372 
373  ensure(postcondition_of(new_state(host(), xi_size, xauto_access)));
374 
375  // Exit:
376 
377  return;
378 }
379 
380 void
382 new_state(poset* xhost, const size_type& xi_size, bool xauto_access)
383 {
384 
385  // Preconditions:
386 
387  require(xhost != 0);
388  require(xauto_access ? xhost->is_attached() : xhost->in_jim_edit_mode());
389  require(xauto_access || xhost->name_space()->state_is_read_accessible());
390  require(xhost->name_space()->contains_poset_member(static_prototype_path(), true));
391  require(xauto_access || xhost->name_space()->member_poset(prototypes_poset_name(), true).state_is_read_accessible());
392 
393  // Get access if auto access is requested. Need to do it here so the
394  // remaining preconditions can be executed.
395 
396  if(xauto_access)
397  {
398  xhost->begin_jim_edit_mode(true);
399  xhost->name_space()->get_read_access();
400  xhost->name_space()->member_poset(prototypes_poset_name(), false).get_read_access();
401  }
402 
403  require(namespace_is_ancestor_of(xhost->name_space()));
404  require(xhost->schema().row_conforms_to(standard_schema_path()));
405 
407 
408  require(dynamic_cast<base_space_poset*>(xhost) != 0);
409 
410  // Body:
411 
412  base_space_poset* lhost = dynamic_cast<base_space_poset*>(xhost);
413 
414  // Get the size for the interval.
415 
416  size_type lsize;
418 
419  // Get the dof tuple_ids.
420 
421  block<pod_index_type> ldof_tuple_ids;
422  structured_block_1d_crg_interval::get_dof_tuple_ids(*xhost, xi_size, ldof_tuple_ids);
423 
424  // Get the private data for the interval
425 
426  block<pod_index_type> ldata;
428 
429  // Create the implicit crg interval for the block.
430 
431  pod_index_type lindex =
432  lhost->new_member_interval("structured_block_1d_crg_interval", lsize, ldof_tuple_ids, ldata);
433 
434  // Attach this handle to it.
435 
436  attach_to_state(lhost, lindex);
437 
438  // Block is linked to bottom via implicit lower cover of vertices,
439  // but not linked to top; link it now.
440 
441  lhost->top().create_cover_link(this);
442 
443  // Postconditions:
444 
445  ensure(invariant());
446  ensure(host() == xhost);
447  ensure(is_attached());
448  ensure(db() == 1);
449  ensure(prototype_path() == static_prototype_path());
450  ensure(local_cell_type_name() == static_local_cell_prototype_path().member_name());
451  ensure(i_size() == xi_size);
452 
453  // Release access if auto access was requested.
454 
455  if(xauto_access)
456  {
457  xhost->name_space()->member_poset(prototypes_poset_name(), false).release_access();
458  xhost->name_space()->release_access();
459 
460  // End jim edit mode without ensure_lattice_invariant;
461  // the check is unnecessary and expensive.
462 
463  xhost->end_jim_edit_mode(false, true);
464  }
465 
466  // Exit:
467 
468  return;
469 }
470 
471 // FEATURES:
472 
475 i_size() const
476 {
477  // Preconditions:
478 
479  require(state_is_read_accessible());
480 
481  // Body:
482 
483  // const size_type& result = row_dof_tuple()->i_size;
484 
485  size_type result = interval().i_size();
486 
487  // Postconditions:
488 
489  // Exit
490 
491  return result;
492 }
493 
494 // PROTECTED DATA MEMBERS
495 
496 void
499 {
500  // Preconditions:
501 
502  require(state_is_read_accessible());
503  require(unexecutable(data members created));
504 
505  // Body:
506 
507  // Have just attached to a new or different member in the same host.
508  // Attach the handle data members for the different member.
509 
510  // Attach _interval first; need it to call i_size().
511 
512  _interval =
513  dynamic_cast<structured_block_1d_crg_interval*>(crg()->implicit_member(_index.pod()));
514 
515  // Postconditions:
516 
517  ensure(!is_restricted());
518 
519  // Exit
520 
521  return;
522 }
523 
526 new_row_dof_map(poset_state_handle& xhost, size_type xi_size, bool xauto_access)
527 {
528  // Preconditions:
529 
530  require(xhost.state_is_auto_read_write_accessible(xauto_access));
531  require(xauto_access || xhost.name_space()->poset_state_is_read_accessible(static_prototype_path()));
532  require(xhost.name_space()->contains_poset_member(static_prototype_path()));
533  require(xhost.name_space()->contains_poset_member(static_local_cell_prototype_path()));
534 
535  // Body:
536 
537  if(xauto_access)
538  {
539  xhost.get_read_write_access(true);
540  }
541 
542  define_old_variable(int old_xhost_row_dof_tuple_ct = xhost.row_dof_tuple_ct());
543 
544  // Create the dof map and set dofs to defaults.
545 
546  scoped_index result = xhost.new_row_dof_map();
547  row_dof_tuple_type* ltuple =
548  reinterpret_cast<row_dof_tuple_type*>(xhost.row_dof_map(result, true).dof_tuple());
549 
550  // Get the block prototype.
551 
552  base_space_member lproto(xhost.name_space(), static_prototype_path(), xauto_access);
553 
554  // Get the local cell prototype.
555 
556  base_space_member local_proto(xhost.name_space(), static_local_cell_prototype_path(), xauto_access);
557 
558  // Copy the dofs from the prototypes..
559 
560  ltuple->db = lproto.db();
561  ltuple->type_id = lproto.type_id();
562  ltuple->type_name = strdup(lproto.type_name());
563  ltuple->refinement_depth = lproto.refinement_depth();
564  ltuple->local_cell_type_id = local_proto.type_id();
565  ltuple->local_cell_type_name = strdup(local_proto.type_name());
566  ltuple->size = xi_size;
567  ltuple->i_size = xi_size;
568 
569  // Release the prototypes.
570 
571  local_proto.detach_from_state();
572  lproto.detach_from_state();
573 
574  if(xauto_access)
575  {
576  xhost.release_access();
577  }
578 
579  // Postconditions:
580 
581  ensure(xhost.row_dof_tuple_ct() == old_xhost_row_dof_tuple_ct + 1);
582 
583  // Exit:
584 
585  return result;
586 }
587 
588 // PRIVATE DATA MEMBERS
589 
590 
591 // ===========================================================
592 // STRUCTURED_BLOCK FACET
593 // ===========================================================
594 
595 // PUBLIC DATA MEMBERS
596 
597 // PROTECTED DATA MEMBERS
598 
599 // PRIVATE DATA MEMBERS
600 
601 
602 // ===========================================================
603 // LOCAL_BASE_SPACE_MEMBER FACET
604 // ===========================================================
605 
606 // PUBLIC DATA MEMBERS
607 
608 void
610 refine_point_pa(const chart_point& xpt, chart_point& result) const
611 {
612  // Preconditions:
613 
614  require(state_is_read_accessible());
615 
616  require(xpt.chart_id() == index().pod());
617 
618  // See comment at structured_block::refine_point_pa.
619 
620  require(xpt.db() >= db());
621  require(result.db() >= db());
622 
624  require(unexecutable("chart_pt is in standard domain"));
625 
626 
627  // Body:
628 
629 
630  // Transform to zone-local coordinates..
631 
632  chart_point_coord_type lu_coord = xpt.local_coords()[0];
633  pod_index_type lu_chart_id_pod;
634  refine_coordinate(lu_coord, lu_chart_id_pod, i_size());
635 
636  // Convert sequence id to poset id.
637 
638  pod_index_type lu_chart_id = _elements_id_space->hub_pod(lu_chart_id_pod);
639 
640  // Store result.
641 
642  result.put_chart_id(lu_chart_id);
643  result.put_local_coord(0, lu_coord);
644 
645  // Postconditions:
646 
647  // see $$ISSUE at structured_block::unrefine_pt_pa.
648  // ensure(covers(result.chart_id()));
649 
650  // Exit:
651 
652  return;
653 }
654 
655 void
658 {
659  // Preconditions:
660 
661  require(state_is_read_accessible());
662  require(xpt.chart_id() == index().pod());
663 
664  // See comment at structured_block::unrefine_point_pa.
665 
666  require(xpt.db() >= db());
667 
669  require(unexecutable("chart_pt is in standard domain"));
670 
671  // Body:
672 
673  // Transform to zone-local coordinates..
674 
675  chart_point_coord_type lu_coord = xpt.local_coords()[0];
676  pod_index_type lu_chart_id;
677  refine_coordinate(lu_coord, lu_chart_id, i_size());
678 
679  // Convert sequence id to poset id and store result.
680 
681  chart_point_3d lrefined_pt(_elements_id_space->hub_pod(lu_chart_id),
682  lu_coord, 0.0, 0.0);
683  result.push_back(lrefined_pt);
684 
685  if(is_close_enough(lu_coord, -1.0) && (lu_chart_id > 0))
686  {
687  // Point is on boundary between two zones.
688  // Have already returned greater zone,
689  // return the lesser zone as well.
690 
691  --lu_chart_id;
692 
693  // Convert sequence id to poset id and store result.
694 
695  lrefined_pt.put(_elements_id_space->hub_pod(lu_chart_id), 1.0, 0.0, 0.0);
696  result.push_back(lrefined_pt);
697  }
698 
699  // Postconditions:
700 
701  // see $$ISSUE at structured_block::unrefine_pt_pa.
702  // ensure(covers(result.chart_id()));
703 
704  // Exit:
705 
706  return;
707 }
708 
709 void
711 unrefine_point_pa(const chart_point& xpt, chart_point& result) const
712 {
713  // Preconditions:
714 
715  require(state_is_read_accessible());
716 
717  // see $$ISSUE at structured_block::unrefine_point_pa.
718  // require(covers(xpt.chart_id()));
719 
720  // See comment at structured_block::unrefine_point_pa.
721 
722  require(xpt.db() >= db());
723  require(result.db() >= db());
724  require(host()->contains_member(xpt.chart_id()));
725 
726  // Body:
727 
728  // Convert chart id to elements id space.
729 
730  pod_index_type lref_chart_id = _elements_id_space->pod(xpt.chart_id());
731 
732  // Assume refined local coordinates [-1, 1]; map to [0, 1] ...
733 
734  double lcoord = (xpt.local_coord(0) + 1.0)*0.5;
735 
736  // ... and then to unrefined coord [0, i_size] ...
737 
738  lcoord = lcoord + lref_chart_id;
739 
740  // ... and then to unrefined [-1, 1]
742 
743  lcoord = (lcoord/i_size())*2.0 - 1.0;
744 
745  // Store result.
746 
747  result.put_chart_id(index().pod());
748 
749  result.put_local_coord(0, lcoord);
750 
751  // Postconditions:
752 
753  ensure(result.chart_id() == index().pod());
754 
755  // Exit:
756 
757  return;
758 }
759 
760 void
763 {
764  // Preconditions:
765 
766  require(state_is_read_write_accessible());
767  require(is_jim());
768 
769  // Body:
770 
771  not_implemented();
772 
773  // Postconditions:
774 
775  ensure(!is_jim());
776 
777  // Exit:
778 
779  return;
780 }
781 
782 
783 void
786 {
787  // Preconditions:
788 
789  require(state_is_read_write_accessible());
790  require(!is_jim());
791 
792  // Body:
793 
794  not_implemented();
795 
796  // Postconditions:
797 
798  ensure(is_jim());
799 
800  // Exit:
801 
802  return;
803 }
804 
805 void
808 {
809  // Preconditions:
810 
811  require(state_is_read_write_accessible());
812  require(is_jim());
813 
814  // Body:
815 
816  not_implemented();
817 
818  // Postconditions:
819 
820  ensure(!is_jim());
821 
822  // Exit:
823 
824  return;
825 }
826 
827 
828 void
831 {
832  // Preconditions:
833 
834  require(state_is_read_write_accessible());
835  require(!is_jim());
836 
837  // Body:
838 
839  not_implemented();
840 
841  // Postconditions:
842 
843  ensure(is_jim());
844 
845  // Exit:
846 
847  return;
848 }
849 
850 // PROTECTED DATA MEMBERS
851 
852 // PRIVATE DATA MEMBERS
853 
854 
855 // ===========================================================
856 // HOMOGENEOUS_BLOCK FACET
857 // ===========================================================
858 
859 // PUBLIC DATA MEMBERS
860 
863 interval() const
864 {
865  return *reinterpret_cast<const structured_block_1d_crg_interval*>(_interval);
866 }
867 
868 const sheaf::poset_path&
871 {
872  // Preconditions:
873 
874  // Body:
875 
876  static const poset_path
877  STATIC_LOCAL_CELL_PROTOTYPE_PATH(base_space_member::prototypes_poset_name(),
878  "segment_complex");
879 
880  const poset_path& result = STATIC_LOCAL_CELL_PROTOTYPE_PATH;
881 
882  // Postconditions:
883 
885  ensure(result.member_name() == "segment_complex");
886 
887  // Exit
888 
889  return result;
890 }
891 
892 // PROTECTED DATA MEMBERS
893 
894 // PRIVATE DATA MEMBERS
895 
896 
897 // ===========================================================
898 // BASE_SPACE_MEMBER FACET
899 // ===========================================================
900 
901 // PUBLIC DATA MEMBERS
902 
903 // PROTECTED DATA MEMBERS
904 
905 // PRIVATE DATA MEMBERS
906 
907 
908 // ===========================================================
909 // TOTAL_POSET_MEMBER FACET
910 // ===========================================================
911 
912 // PUBLIC DATA MEMBERS
913 
914 // PROTECTED DATA MEMBERS
915 
916 // PRIVATE DATA MEMBERS
917 
918 
919 // ===========================================================
920 // ABSTRACT_POSET_MEMBER FACET
921 // ===========================================================
922 
923 // PUBLIC DATA MEMBERS
924 
927 clone() const
928 {
929 
930  // Preconditions:
931 
932  // Body:
933 
934  // create new handle of the current class.
935 
937 
938  // Postconditions:
939 
940  ensure(result != 0);
941  ensure(result->invariant());
942 
943  // Exit:
944 
945  return result;
946 
947 }
948 
949 // PROTECTED DATA MEMBERS
950 
951 // PRIVATE DATA MEMBERS
952 
953 
954 // ===========================================================
955 // ANY FACET
956 // ===========================================================
957 
958 // PUBLIC DATA MEMBERS
959 
960 bool
962 invariant() const
963 {
964  // Preconditions:
965 
966  // Body:
967 
968  // Must satisfy base class invariant
969 
970  invariance(total_poset_member::invariant());
971 
972  if(invariant_check())
973  {
974  // Prevent recursive calls to invariant
975 
976  disable_invariant_check();
977 
978  // Invariants for this class:
979 
980  invariance(state_is_read_accessible() ? is_jim(false) : true);
981  invariance(state_is_read_accessible() ? size() == i_size() : true);
982 
983  // Finished, turn invariant checking back on.
984 
985  enable_invariant_check();
986  }
987 
988  // Postconditions:
989 
990  // Exit
991 
992  return true;
993 }
994 
995 bool
997 is_ancestor_of(const any* xother) const
998 {
999  bool result;
1000 
1001  // Preconditions:
1002 
1003  // Body:
1004 
1005  result = dynamic_cast<const structured_block_1d*>(xother) != 0;
1006 
1007  // Postconditions:
1008 
1009  // Exit
1010 
1011  return result;
1012 }
1013 
1017 {
1018  // Preconditions:
1019 
1020  // Body:
1021 
1022  attach_to_state(&xother);
1023 
1024  // Postconditions:
1025 
1026  ensure(is_same_state(&xother));
1027 
1028  // Exit
1029 
1030  return *this;
1031 }
1032 
1036 {
1037 
1038  // Preconditions:
1039 
1040  require(is_ancestor_of(&xother));
1041 
1042  // Body
1043 
1044  not_implemented();
1045 
1046  // Postconditions
1047 
1048  ensure(invariant());
1049 
1050  // Exit
1051 
1052  return *this;
1053 
1054 }
1055 
1056 // PROTECTED DATA MEMBERS
1057 
1058 // PRIVATE DATA MEMBERS
1059 
1060 
virtual ~structured_block_1d()
Destructor; deletes a poset member and its attached state, if any.
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...
double chart_point_coord_type
The type of local coordinate in the base space; the scalar type for the local coordinate vector space...
Definition: fiber_bundle.h:57
virtual void unrefine()
Removes the standard refinement of this from its lower cover and changes this from a jrm to a jim...
virtual bool invariant() const
Class invariant.
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 ...
virtual void attach_handle_data_members()
Initializes handle data members when attaching to a different member of the same host.
bool path_is_auto_read_write_available(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath does not exist or exists and is auto read-write accessible...
virtual void create_cover_link(abstract_poset_member *xlesser)
Insert a link from this to lesser; make lesser <= this.
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
size_type i_size() const
The number of local cells (zones) in the i direction. The number of vertices in the i direction is i_...
abstract_poset_member & top()
The top member of the poset (mutable version)
static const poset_path & static_local_cell_prototype_path()
The path of the local cell prototype required by this class.
size_type size
The number of local cells.
virtual structured_block_1d * clone() const
Make a new handle, no state instance of current.
A point in a 3D chart space.
poset_path path(bool xauto_access=true) const
A path to this component.
bool conforms_to(const schema_poset_member &xother) const
True if the dofs defined by this agree in type and in order with the dofs defined by xother...
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...
virtual void simplify()
Inserts the standard simplex refinement of this into its lower cover and changes this from a jim to a...
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.
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
const char * local_cell_type_name
The local cell type name.
virtual int db() const =0
The dimension of this chart.
Definition: chart_point.cc:141
bool contains_poset_member(pod_index_type xposet_hub_id, pod_index_type xmember_hub_id, bool xauto_access=true) const
True if this contains a poset with hub id xposet_hub_id which contains a member with hub id xmember_h...
A client handle for a general, abstract partially order set.
virtual void * dof_tuple()=0
The dof tuple (mutable version).
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
virtual bool invariant() const
Class invariant.
void put_chart_id(pod_index_type xchart)
Sets chart_id() to xchart_id.
Definition: chart_point.cc:103
A point in chart space.
Definition: chart_point.h:52
pod_index_type chart_id() const
The id of the chart this point is in.
Definition: chart_point.cc:96
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.
virtual void unrefine_point_pa(const chart_point &xpt, chart_point &result) const
The point in this which is the same as xpt in the direct refinement of this; pre-allocated version...
static const std::string & prototypes_poset_name()
The name of the prototypes poset.
A homogeneous collection of connected segments arranged in an i_size() array.
A client handle for a member of a base space poset.
Abstract base class with useful features for all objects.
Definition: any.h:39
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
Struct representing the closed interval [_begin, _end].
Definition: interval_set.h:48
virtual coord_type * local_coords()=0
The array of local coordinates.
Definition: chart_point.cc:209
void push_back(const_reference_type item)
Insert item at the end of the items in the auto_block.
static void get_size(size_type xi_size, size_type &result)
The size for an instance created with parameter xi_size.
size_type i_size
The upper bound on the x direction index for structured blocks.
A client handle for a mutable partially ordered set.
Definition: poset.h:40
Emulator for a interval of implicit base space members representing a 1 dimensional structured block...
virtual const scoped_index & new_row_dof_map()
Creates a new row dof map.
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
virtual bool is_attached() const
True if this handle is attached to a non-void state.
virtual void get_read_access() const
Get read access to the state associated with this.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
std::string poset_name() const
The poset name part of the path.
Definition: poset_path.cc:473
static void get_private_data(size_type xi_size, block< pod_index_type > &result)
The private data for an instance with parameter xi_size.
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
size_type row_dof_tuple_ct() const
The number of row_dof_tuples of this poset.
virtual const structured_block_1d_crg_interval & interval() const
The implicit interval member for this block.
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
bool empty() const
True if both poset name and member name are empty.
Definition: poset_path.cc:291
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...
structured_block_1d()
Default constructor; creates a new, unattached structured_block_1d handle.
bool poset_state_is_read_accessible(const poset_path &xpath, bool xauto_access=true) const
True if the poset referred to by xpath is read accessible.
virtual poset_dof_map & row_dof_map(pod_index_type xtuple_hub_id, bool xrequire_write_access=false) const
The map from row dof client_ids to row dof values for dof tuple hub id xtuple_hub_id.
namespace_poset * name_space() const
The namespace this poset resides in.
virtual bool is_attached() const
True if this is attached to a state.
virtual structured_block_1d & operator=(const abstract_poset_member &xother)
Assignment operator; attaches this to the same state as xother.
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
void put(pod_index_type xchart_id, coord_type xu, coord_type xv, coord_type xw)
Sets chart_id() == xchart_id, u() == xu, v() == xv, w() == xw.
std::string member_name() const
The member name part of the path.
Definition: poset_path.cc:511
virtual pod_index_type new_member_interval(const std::string &xinterval_type, size_type xsize, const block< pod_index_type > &xdof_tuple_ids, const block< pod_index_type > &xdata)
Create a disconnected member interval of type xinterval_type with size xsize, dof tuple ids xdof_tupl...
virtual void put_local_coord(int xi, coord_type xvalue)=0
Sets the xi-th local coordinate of this point to xvalue.
Definition: chart_point.cc:187
static const poset_path & static_prototype_path()
The path of the prototype required by this class.
virtual void unsimplify()
Removes the standard simplex refinement of this from its lower cover and changes this from a jrm to a...
virtual void end_jim_edit_mode(bool xensure_lattice_invariant=true, bool xauto_access=true)
Prevent editing of jims and jim order relation.
Definition: poset.cc:253
static bool is_valid_name(const std::string &xname)
True if xname is not empty and contains only name legal characters.
Definition: poset_path.cc:331
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, bool xauto_access)
Creates a new host poset for members of this type. The poset is created in namespace xns with path xh...
virtual void get_read_access() const
Get read access to the state associated with this.
int max_db() const
The maximum dimension of the members of this base space.
An abstract client handle for a member of a poset.
static void get_dof_tuple_ids(poset_state_handle &xhost, size_type xi_size, block< pod_index_type > &result)
The dof tuple ids for an instance created with parameter xi_size.
bool row_conforms_to(const schema_poset_member &xother) const
True if the row dofs defined by this agree in type and in order with the dofs defined by xother...
The type of row dof tuple for base_space_member.
bool in_jim_edit_mode() const
True if editing jims and jim order relation is allowed.
static host_type & standard_host(namespace_type &xns, const poset_path &xhost_path, bool xauto_access)
The host with path xhost_path. Returns the host if it already exists, otherwise, creates it in namesp...
virtual void refine()
Inserts the standard refinement of this into its lower cover and changes this from a jim to a jrm...
Namespace for the fiber_bundles component of the sheaf system.
virtual coord_type local_coord(int xi) const =0
The xi-th local coordinate of this point.
Definition: chart_point.cc:163
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...
virtual void refine_point_pa(const chart_point &xpt, chart_point &result) const
The point in the direct refinement of this which is the same as xpt in this; pre-allocated version...
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...
void new_state(const size_type &xi_size, bool xauto_access=true)
Creates a new structured_block_1d state in host() with i_size() == xi_size and attaches this to it...
static scoped_index new_row_dof_map(poset_state_handle &xhost, size_type xi_size, bool xauto_access)
Creates a new row dof map and initializes it.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:710
virtual void begin_jim_edit_mode(bool xauto_access=true)
Allow editing of jims and jim order relation.
Definition: poset.cc:230