SheafSystem  0.0.0.0
field_ed_funcs.impl.h
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 
19 
20 //=============================================================================
21 // NON-MEMBER FUNCTIONS OF ED FACET
22 //=============================================================================
23 
24 #ifndef FIELD_AT0_H
25 #include "SheafSystem/field_at0.h"
26 #endif
27 
28 
30 void
32 dot(const field_ed& x0, const field_ed& x1, field_at0& xresult,
33  bool xauto_access)
34 {
35  // Preconditions:
36 
37  require(precondition_of(\
38  dot(x0.property(), x1.property(), xresult.property(), xauto_access)));
39 
40  // Body:
41 
42  fiber_bundle::sec_ed_algebra::dot(x0.property(), x1.property(), xresult.property(), xauto_access);
43 
44  // Postconditions:
45 
46  ensure(postcondition_of(\
47  dot(x0.property(), x1.property(), xresult.property(), xauto_access)));
48 
49  // Exit:
50 
51  return;
52 }
53 
55 void
57 length(const field_ed& x0, field_at0& xresult, bool xauto_access)
58 {
59  // Preconditions:
60 
61  require(precondition_of(\
62  length(x0.property(), xresult.property(), xauto_access)));
63 
64  // Body:
65 
66  fiber_bundle::sec_ed_algebra::length(x0.property(), xresult.property(), xauto_access);
67 
68  // Postconditions:
69 
70  ensure(postcondition_of(\
71  length(x0.property(), xresult.property(), xauto_access)));
72 
73  // Exit:
74 
75  return;
76 }
77 
79 void
81 put_length(field_ed& x0, const vd_value_type& xlength, bool xauto_access)
82 {
83  // Preconditions:
84 
85  require(precondition_of(\
86  put_length(x0.property(), xlength, xauto_access)));
87 
88  // Body:
89 
90  fiber_bundle::sec_ed_algebra::put_length(x0.property(), xlength, xauto_access);
91 
92  // Postconditions:
93 
94  ensure(postcondition_of(\
95  put_length(x0.property(), xlength, xauto_access)));
96 
97  // Exit:
98 
99  return;
100 }
101 
103 void
105 normalize(const field_ed& x0, field_ed& xresult, bool xauto_access)
106 {
107  // Preconditions:
108 
109  require(precondition_of(\
110  normalize(x0.property(), xresult.property(), xauto_access)));
111 
112  // Body:
113 
114  fiber_bundle::sec_ed_algebra::normalize(x0.property(), xresult.property(), xauto_access);
115 
116  // Postconditions:
117 
118  ensure(postcondition_of(\
119  normalize(x0.property(), xresult.property(), xauto_access)));
120 
121  // Exit:
122 
123  return;
124 }
125 
127 void
129 normalize(field_ed& x0, bool xauto_access)
130 {
131  // Preconditions:
132 
133  require(precondition_of(\
134  normalize(x0.property(), xauto_access)));
135 
136  // Body:
137 
139 
140  // Postconditions:
141 
142  ensure(postcondition_of(\
143  normalize(x0.property(), xauto_access)));
144 
145  // Exit:
146 
147  return;
148 }
sec_ed & property() const
The dependent variable of this field.
Definition: field_ed.cc:329
void SHEAF_DLL_SPEC dot(const field_ed &x0, const field_ed &x1, field_at0 &xresult, bool xauto_access)
The Euclidean "dot" product of x0 with x2.
SHEAF_DLL_SPEC void length(const sec_ed &x0, sec_at0 &xresult, bool xauto_access)
The Euclidean length (magnitude) of x0.
Definition: sec_ed.cc:712
sec_at0 & property() const
The dependent variable of this field.
Definition: field_at0.cc:329
void SHEAF_DLL_SPEC length(const field_ed &x0, field_at0 &xresult, bool xauto_access)
The Euclidean length (magnitude) of x0.
SHEAF_DLL_SPEC void put_length(sec_ed &x0, const vd_value_type &xlength, bool xauto_access)
Set the Euclidean length (magnitude) of x0 to xlength.
Definition: sec_ed.cc:733
A property of type sec_ed as a function of global coordinates.
Definition: field_ed.h:50
SHEAF_DLL_SPEC vd_value_type dot(const ed &x0, const ed &x1, bool xauto_access)
The Euclidean "dot" product of x0 with x1 (version for persistent types).
Definition: ed.cc:863
SHEAF_DLL_SPEC vd_value_type length(const ed &x0, bool xauto_access)
The Euclidean length (magnitude) of x0 (version for persistent types).
Definition: ed.cc:906
void SHEAF_DLL_SPEC normalize(const field_ed &x0, field_ed &xresult, bool xauto_access)
Normalize x0 (convert to a unit vector).
SHEAF_DLL_SPEC void put_length(ed &x0, const vd_value_type &xlength, bool xauto_access)
Set the Euclidean length (magnitude) of x0 to xlength. (version for persistent types).
Definition: ed.cc:947
SHEAF_DLL_SPEC void normalize(const ed &x0, ed &xresult, bool xauto_access)
Normalize x0 (convert to a unit vector) (pre_allocated version for persistent types).
Definition: ed.cc:992
SHEAF_DLL_SPEC void normalize(const sec_ed &x0, sec_ed &xresult, bool xauto_access)
Normalize x0 (convert to a unit vector).
Definition: sec_ed.cc:778
A property of type sec_at0 as a function of global coordinates.
Definition: field_at0.h:50
void SHEAF_DLL_SPEC put_length(field_ed &x0, const vd_value_type &xlength, bool xauto_access)
Set the Euclidean length (magnitude) of x0 to xlength.
SHEAF_DLL_SPEC void dot(const sec_ed &x0, const sec_ed &x1, sec_at0 &xresult, bool xauto_access)
The Euclidean "dot" product of x0 with x2.
Definition: sec_ed.cc:688
double vd_value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: fiber_bundle.h:63