SheafSystem  0.0.0.0
field_factory.h
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 #ifndef FIELD_FACTORY_H
22 #define FIELD_FACTORY_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 // ===========================================================
29 // NON-MEMBER FUNCTIONS
30 // ===========================================================
31 
32 #ifndef FIELDS_H
33 #include "SheafSystem/fields.h"
34 #endif
35 
36 #ifndef POSET_PATH_H
37 #include "SheafSystem/poset_path.h"
38 #endif
39 
40 #ifndef STD_STRING_H
41 #include "SheafSystem/std_string.h"
42 #endif
43 
44 #ifndef FIBER_BUNDLES_NAMESPACE_H
45 #include "SheafSystem/fiber_bundles_namespace.h"
46 #endif
47 
48 namespace sheaf
49 {
50 class arg_list;
51 template <class T>
52 class block;
53 class namespace_poset;
54 }
55 
56 namespace fiber_bundle
57 {
58 class sec_at0;
59 class sec_e1;
60 class sec_e2;
61 class sec_e3;
62 class sec_ed;
63 class sec_vd;
64 
65 class base_space_member;
66 class structured_block_1d;
67 class structured_block_2d;
68 class structured_block_3d;
69 class unstructured_block;
70 }
71 
72 namespace fields
73 {
74 
75 using namespace sheaf;
76 using namespace fiber_bundle;
77 
78 class field_vd;
79 
84 class SHEAF_DLL_SPEC field_factory
85 {
86 
87  // =============================================================================
89  // =============================================================================
91 
92 public:
93 
101  static field_vd*
102  new_scalar_field_1d_points(fiber_bundles_namespace& xns,
103  const std::string& xname,
104  size_type xi_size,
105  block<sec_vd_value_type>& xlower,
106  block<sec_vd_value_type>& xupper,
108  const poset_path& xproperty_rep_path =
109  "sec_rep_descriptors/vertex_vertex_constant");
110 
117  static field_vd*
118  new_scalar_field_1d_unstructured(fiber_bundles_namespace& xns,
119  const std::string& xname,
120  size_type xi_size,
121  block<sec_vd_value_type>& xlower,
122  block<sec_vd_value_type>& xupper,
124  const poset_path& xproperty_rep_path =
125  "sec_rep_descriptors/vertex_element_dlinear");
126 
127 
134  static field_vd*
135  new_scalar_field_1d_uniform(fiber_bundles_namespace& xns,
136  const std::string& xname,
137  size_type xi_size,
138  block<sec_vd_value_type>& xlower,
139  block<sec_vd_value_type>& xupper,
141  const poset_path& xproperty_rep_path =
142  "sec_rep_descriptors/vertex_element_dlinear");
143 
151  static field_vd*
152  new_scalar_field_2d_points(fiber_bundles_namespace& xns,
153  const std::string& xname,
154  size_type xi_size,
155  size_type xj_size,
156  block<sec_vd_value_type>& xlower,
157  block<sec_vd_value_type>& xupper,
159  const poset_path& xproperty_rep_path =
160  "sec_rep_descriptors/vertex_vertex_constant");
161 
162 
170  static field_vd*
171  new_scalar_field_2d_unstructured(fiber_bundles_namespace& xns,
172  const std::string& xname,
173  size_type xi_size,
174  size_type xj_size,
175  bool xuse_quads,
176  block<sec_vd_value_type>& xlower,
177  block<sec_vd_value_type>& xupper,
179  const poset_path& xproperty_rep_path =
180  "sec_rep_descriptors/vertex_element_dlinear");
181 
182 
183 #ifdef HAVE_VTK
184 
192  static field_vd*
193  new_scalar_field_2d_unstructured(fiber_bundles_namespace& xns,
194  const std::string& xname,
195  size_type xpt_ct,
196  block<sec_vd_value_type>& xlower,
197  block<sec_vd_value_type>& xupper,
199  const poset_path& xproperty_rep_path =
200  "sec_rep_descriptors/vertex_element_dlinear");
201 
202 #endif
203 
210  static field_vd*
211  new_scalar_field_2d_uniform(fiber_bundles_namespace& xns,
212  const std::string& xname,
213  size_type xi_size,
214  size_type xj_size,
215  block<sec_vd_value_type>& xlower,
216  block<sec_vd_value_type>& xupper,
218  const poset_path& xproperty_rep_path =
219  "sec_rep_descriptors/vertex_element_dlinear");
220  //"sec_rep_descriptors/vertex_cells_dlinear");
221 
229  static field_vd*
230  new_scalar_field_3d_points(fiber_bundles_namespace& xns,
231  const std::string& xname,
232  size_type xi_size,
233  size_type xj_size,
234  size_type xk_size,
235  block<sec_vd_value_type>& xlower,
236  block<sec_vd_value_type>& xupper,
238  const poset_path& xproperty_rep_path =
239  "sec_rep_descriptors/vertex_vertex_constant");
240 
241 
249  static field_vd*
250  new_scalar_field_3d_unstructured(fiber_bundles_namespace& xns,
251  const std::string& xname,
252  size_type xi_size,
253  size_type xj_size,
254  size_type xk_size,
255  bool xuse_hexs,
256  block<sec_vd_value_type>& xlower,
257  block<sec_vd_value_type>& xupper,
259  const poset_path& xproperty_rep_path =
260  "sec_rep_descriptors/vertex_element_dlinear");
261 
262 
263 #ifdef HAVE_VTK
264 
272  static field_vd*
273  new_scalar_field_3d_unstructured(fiber_bundles_namespace& xns,
274  const std::string& xname,
275  size_type xpt_ct,
276  block<sec_vd_value_type>& xlower,
277  block<sec_vd_value_type>& xupper,
279  const poset_path& xproperty_rep_path =
280  "sec_rep_descriptors/vertex_element_dlinear");
281 
282 #endif
283 
290  static field_vd*
291  new_scalar_field_3d_uniform(fiber_bundles_namespace& xns,
292  const std::string& xname,
293  size_type xi_size,
294  size_type xj_size,
295  size_type xk_size,
296  block<sec_vd_value_type>& xlower,
297  block<sec_vd_value_type>& xupper,
299  const poset_path& xproperty_rep_path =
300  "sec_rep_descriptors/vertex_element_dlinear");
301  //"sec_rep_descriptors/vertex_cells_dlinear");
302 
304 
305 
306  // ===========================================================
308  // ===========================================================
310 
313  // uniform mesh of size xi_size with cooordinate bounds xlower and xupper and
317  static field_vd*
318  new_scalar_field_1d_uniform(fiber_bundles_namespace& xns,
319  const std::string& xname,
320  size_type xi_size,
321  block<sec_vd_value_type>& xlower,
322  block<sec_vd_value_type>& xupper,
323  const std::string& xfcn);
324 
331  static field_vd*
332  new_scalar_field_1d_unstructured(fiber_bundles_namespace& xns,
333  const std::string& xname,
334  size_type xi_size,
335  block<sec_vd_value_type>& xlower,
336  block<sec_vd_value_type>& xupper,
337  const std::string& xfcn);
338 
344  // function with name xfcn.
347  static field_vd*
348  new_scalar_field_2d_unstructured(fiber_bundles_namespace& xns,
349  const std::string& xname,
350  size_type xi_size,
351  size_type xj_size,
352  bool xuse_quads,
353  block<sec_vd_value_type>& xlower,
354  block<sec_vd_value_type>& xupper,
355  const std::string& xfcn);
356 
357 #ifdef HAVE_VTK
358 
366  static field_vd*
367  new_scalar_field_2d_unstructured(fiber_bundles_namespace& xns,
368  const std::string& xname,
369  size_type xpt_ct,
370  block<sec_vd_value_type>& xlower,
371  block<sec_vd_value_type>& xupper,
372  const std::string& xfcn);
373 
374 #endif
375 
382  static field_vd*
383  new_scalar_field_2d_uniform(fiber_bundles_namespace& xns,
384  const std::string& xname,
385  size_type xi_size,
386  size_type xj_size,
387  block<sec_vd_value_type>& xlower,
388  block<sec_vd_value_type>& xupper,
389  const std::string& xfcn);
390 
399  static field_vd*
400  new_scalar_field_3d_unstructured(fiber_bundles_namespace& xns,
401  const std::string& xname,
402  size_type xi_size,
403  size_type xj_size,
404  size_type xk_size,
405  bool xuse_hexs,
406  block<sec_vd_value_type>& xlower,
407  block<sec_vd_value_type>& xupper,
408  const std::string& xfcn);
409 
410 
411 #ifdef HAVE_VTK
412 
420  static field_vd*
421  new_scalar_field_3d_unstructured(fiber_bundles_namespace& xns,
422  const std::string& xname,
423  size_type xpt_ct,
424  block<sec_vd_value_type>& xlower,
425  block<sec_vd_value_type>& xupper,
426  const std::string& xfcn);
427 
428 #endif
429 
436  static field_vd*
437  new_scalar_field_3d_uniform(fiber_bundles_namespace& xns,
438  const std::string& xname,
439  size_type xi_size,
440  size_type xj_size,
441  size_type xk_size,
442  block<sec_vd_value_type>& xlower,
443  block<sec_vd_value_type>& xupper,
444  const std::string& xfcn);
445 
446 
447 
448 
454  static void linear_scalar_fcn(block<sec_vd_value_type>& xglobal_coords,
455  block<sec_vd_dof_type>& xproperty_dofs);
456 
463  static void step_fcn(block<sec_vd_value_type>& xglobal_coords,
464  block<sec_vd_dof_type>& xproperty_dofs);
465 
469  static void zero(block<sec_vd_value_type>& xglobal_coords,
470  block<sec_vd_dof_type>& xproperty_dofs);
471 
472 
477  static property_dof_function_type property_dof_function(const std::string& xname);
478 
485  static void delete_field_spaces(field_vd* xfield,
486  bool xdelete_coord_fiber,
487  bool xdelete_prop_fiber);
488 
489 
490 protected:
491 
497  static unstructured_block*
498  new_0d_point_base_space(namespace_poset& xns,
499  const std::string& xname,
500  size_type xi_size);
501 
507  static unstructured_block*
508  new_0d_point_base_space(namespace_poset& xns,
509  const std::string& xname,
510  size_type xi_size,
511  size_type xj_size);
512 
518  static unstructured_block*
519  new_0d_point_base_space(namespace_poset& xns,
520  const std::string& xname,
521  size_type xi_size,
522  size_type xj_size,
523  size_type xk_size);
524 
528  static unstructured_block*
529  new_1d_unstructured_base_space(namespace_poset& xns,
530  const std::string& xname,
531  size_type xi_size);
532 
536  static sec_e1*
537  new_1d_unstructured_coordinates(fiber_bundles_namespace& xns,
538  const std::string& xname,
539  size_type xi_size,
540  block<sec_vd_value_type>& xlower,
541  block<sec_vd_value_type>& xupper,
542  unstructured_block& xbase_space,
543  const poset_path& xrep_path =
544  "sec_rep_descriptors/vertex_element_dlinear");
545 
549  static structured_block_1d*
550  new_1d_structured_base_space(namespace_poset& xns,
551  const std::string& xname,
552  size_type xi_size);
553 
557  static sec_e1*
558  new_1d_uniform_coordinates(fiber_bundles_namespace& xns,
559  const std::string& xname,
560  size_type xi_size,
561  block<sec_vd_value_type>& xlower,
562  block<sec_vd_value_type>& xupper,
563  structured_block_1d& xbase_space);
564 
570  static unstructured_block*
571  new_2d_unstructured_base_space(namespace_poset& xns,
572  const std::string& xname,
573  size_type xi_size,
574  size_type xj_size,
575  bool xuse_quads);
576 
580  static sec_e2*
581  new_2d_unstructured_coordinates(fiber_bundles_namespace& xns,
582  const std::string& xname,
583  size_type xi_size,
584  size_type xj_size,
585  block<sec_vd_value_type>& xlower,
586  block<sec_vd_value_type>& xupper,
587  unstructured_block& xbase_space,
588  const poset_path& xrep_path =
589  "sec_rep_descriptors/vertex_element_dlinear");
590 
591 #ifdef HAVE_VTK
592  static unstructured_block*
597  new_2d_unstructured_base_space(namespace_poset& xns,
598  const std::string& xname,
599  size_type xpt_ct,
600  block<sec_vd_value_type>& xpt_coords);
601 
602 #endif
603 
609  static sec_e2*
610  new_2d_unstructured_coordinates(fiber_bundles_namespace& xns,
611  const std::string& xname,
612  size_type xpt_ct,
613  block<sec_vd_value_type>& xlower,
614  block<sec_vd_value_type>& xupper,
615  unstructured_block& xbase_space,
616  const block<sec_vd_value_type>& xpt_coords);
617 
621  static structured_block_2d*
622  new_2d_structured_base_space(namespace_poset& xns,
623  const std::string& xname,
624  size_type xi_size,
625  size_type xj_size);
626 
630  static sec_e2*
631  new_2d_uniform_coordinates(fiber_bundles_namespace& xns,
632  const std::string& xname,
633  size_type xi_size,
634  size_type xj_size,
635  block<sec_vd_value_type>& xlower,
636  block<sec_vd_value_type>& xupper,
637  structured_block_2d& xbase_space);
638 
644  static unstructured_block*
645  new_3d_unstructured_base_space(namespace_poset& xns,
646  const std::string& xname,
647  size_type xi_size,
648  size_type xj_size,
649  size_type xk_size,
650  bool xuse_hexs);
651 
652 
656  static sec_e3*
657  new_3d_unstructured_coordinates(fiber_bundles_namespace& xns,
658  const std::string& xname,
659  size_type xi_size,
660  size_type xj_size,
661  size_type xk_size,
662  block<sec_vd_value_type>& xlower,
663  block<sec_vd_value_type>& xupper,
664  unstructured_block& xbase_space,
665  const poset_path& xrep_path =
666  "sec_rep_descriptors/vertex_element_dlinear");
667 
668 #ifdef HAVE_VTK
669 
674  static unstructured_block*
675  new_3d_unstructured_base_space(namespace_poset& xns,
676  const std::string& xname,
677  size_type xpt_ct,
678  block<sec_vd_value_type>& xpt_coords);
679 
680 #endif
681 
687  static sec_e3*
688  new_3d_unstructured_coordinates(fiber_bundles_namespace& xns,
689  const std::string& xname,
690  size_type xpt_ct,
691  block<sec_vd_value_type>& xlower,
692  block<sec_vd_value_type>& xupper,
693  unstructured_block& xbase_space,
694  const block<sec_vd_value_type>& xpt_coords);
695 
699  static structured_block_3d*
700  new_3d_structured_base_space(namespace_poset& xns,
701  const std::string& xname,
702  size_type xi_size,
703  size_type xj_size,
704  size_type xk_size);
705 
709  static sec_e3*
710  new_3d_uniform_coordinates(fiber_bundles_namespace& xns,
711  const std::string& xname,
712  size_type xi_size,
713  size_type xj_size,
714  size_type xk_size,
715  block<sec_vd_value_type>& xlower,
716  block<sec_vd_value_type>& xupper,
717  structured_block_3d& xbase_space);
718 
723  static base_space_member*
724  new_structured_base_space(namespace_poset& xns,
725  const std::string& xbase_space_name,
726  const block<int>& xindex_ubs);
727 
728 
732  static sec_ed*
733  new_coord_section_handle(int xdc);
734 
739  static void
740  put_1d_uniform_coord_dofs(const block<sec_vd_dof_type>& xlower,
741  const block<sec_vd_dof_type>& xupper,
742  sec_ed* xcoords);
743 
748  static void
749  put_2d_uniform_coord_dofs(const block<sec_vd_dof_type>& xlower,
750  const block<sec_vd_dof_type>& xupper,
751  sec_ed* xcoords);
752 
757  static void
758  put_3d_uniform_coord_dofs(const block<sec_vd_dof_type>& xlower,
759  const block<sec_vd_dof_type>& xupper,
760  sec_ed* xcoords);
761 
762 
767  static void
768  put_uniform_coord_dofs(int xdc,
769  const block<sec_vd_dof_type>& xlower,
770  const block<sec_vd_dof_type>& xupper,
771  sec_ed* xcoords);
772 
777  static sec_at0*
778  new_property(fiber_bundles_namespace& xns,
779  const std::string& xname,
780  base_space_member& xbase_space,
781  const poset_path& xrep_path);
782 
784 
785 };
786 
787 } // namespace fields
788 
789 #endif // ifndef FIELD_FACTORY_H
A homogeneous collection of connected quads arranged in an i_size() x j_size() array.
Namespace for fields component of sheaf system.
The default name space; a poset which contains other posets as members.
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
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
OBSOLETE: use zone_nodes_block or point_block_*d. A client handle for a base space member which repre...
A homogeneous collection of connected segments arranged in an i_size() array.
A client handle for a member of a base space poset.
A section of a fiber bundle with a d-dimensional Euclidean vector space fiber.
Definition: sec_ed.h:47
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
A vd-valued property as a function of global coordinates.
Definition: field_vd.h:69
void(* property_dof_function_type)(block< sec_vd_value_type > &xglobal_coords, block< sec_vd_dof_type > &xproperty_dofs)
The type of the function for computing the property dofs at given global coordinates.
Definition: fields.h:64
A section of a fiber bundle with a 3-dimensional Euclidean vector space fiber.
Definition: sec_e3.h:47
A homogeneous collection of connected hexahedra arranged in an i_size() x j_size() x k_size() array...
Test case generator for fields cluster.
Definition: field_factory.h:84
A section of a fiber bundle with a 1-dimensional Euclidean vector space fiber.
Definition: sec_e1.h:47
Namespace for the sheaves component of the sheaf system.
Namespace for the fiber_bundles component of the sheaf system.
Antisymetric tensor of degree 0. As the degree is 0 there is nothing to be symmetric or antisymmetric...
Definition: sec_at0.h:51
A section of a fiber bundle with a 2-dimensional Euclidean vector space fiber.
Definition: sec_e2.h:48