SheafSystem  0.0.0.0
field_vd_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 VD FACET
22 //=============================================================================
23 
24 #ifndef FIELD_AT0_H
25 #include "SheafSystem/field_at0.h"
26 #endif
27 
28 
30 void
32 add(const field_vd& x0, const field_vd& x1, field_vd& xresult,
33  bool xauto_access)
34 {
35  // Preconditions:
36 
37  require(precondition_of(\
38  add(x0.property(), x1.property(), xresult.property(), xauto_access)));
39 
40  // Body:
41 
42  fiber_bundle::sec_vd_algebra::add(x0.property(), x1.property(), xresult.property(), xauto_access);
43 
44  // Postconditions:
45 
46  ensure(postcondition_of(\
47  add(x0.property(), x1.property(), xresult.property(), xauto_access)));
48 
49  // Exit:
50 
51  return;
52 }
53 
55 void
57 add_equal(field_vd& xresult, const field_vd& xother, bool xauto_access)
58 {
59  // Preconditions:
60 
61  require(precondition_of(add(xresult, xother, xresult, xauto_access)));
62 
63  // Body:
64 
65  add(xresult, xother, xresult, xauto_access);
66 
67  // Postconditions:
68 
69  ensure(postcondition_of(add(xresult, xother, xresult, xauto_access)));
70 
71  // Exit:
72 
73  return;
74 }
75 
77 void
79 subtract(const field_vd& x0, const field_vd& x1, field_vd& xresult,
80  bool xauto_access)
81 {
82  // Preconditions:
83 
84  require(precondition_of(\
85  subtract(x0.property(), x1.property(), xresult.property(), xauto_access)));
86 
87  // Body:
88 
89  fiber_bundle::sec_vd_algebra::subtract(x0.property(), x1.property(), xresult.property(), xauto_access);
90 
91  // Postconditions:
92 
93  ensure(postcondition_of(\
94  subtract(x0.property(), x1.property(), xresult.property(), xauto_access)));
95 
96  // Exit:
97 
98  return;
99 }
100 
102 void
104 subtract_equal(field_vd& xresult, const field_vd& xother, bool xauto_access)
105 {
106  // Preconditions:
107 
108  require(precondition_of(subtract(xresult, xother, xresult, xauto_access)));
109 
110  // Body:
111 
112  subtract(xresult, xother, xresult, xauto_access);
113 
114  // Postconditions:
115 
116  ensure(postcondition_of(subtract(xresult, xother, xresult, xauto_access)));
117 
118  // Exit:
119 
120  return;
121 }
122 
124 void
126 multiply(const field_vd& x0, const sec_at0& x1, field_vd& xresult,
127  bool xauto_access)
128 {
129  // Preconditions:
130 
131  require(precondition_of(\
132  multiply(x0.property(), x1, xresult.property(), xauto_access)));
133 
134  // Body:
135 
136  fiber_bundle::sec_vd_algebra::multiply(x0.property(), x1, xresult.property(), xauto_access);
137 
138  // Postconditions:
139 
140  ensure(postcondition_of(\
141  multiply(x0.property(), x1, xresult.property(), xauto_access)));
142 
143  // Exit:
144 
145  return;
146 }
147 
149 void
151 multiply_equal(field_vd& xresult, const sec_at0& xother, bool xauto_access)
152 {
153  // Preconditions:
154 
155  require(precondition_of(multiply(xresult, xother, xresult, xauto_access)));
156 
157  // Body:
158 
159  multiply(xresult, xother, xresult, xauto_access);
160 
161  // Postconditions:
162 
163  ensure(postcondition_of(multiply(xresult, xother, xresult, xauto_access)));
164 
165  // Exit:
166 
167  return;
168 }
169 
171 void
173 multiply(const field_vd& x0, const vd_value_type& x1, field_vd& xresult,
174  bool xauto_access)
175 {
176  // Preconditions:
177 
178  require(precondition_of(\
179  multiply(x0.property(), x1, xresult.property(), xauto_access)));
180 
181  // Body:
182 
183  fiber_bundle::sec_vd_algebra::multiply(x0.property(), x1, xresult.property(), xauto_access);
184 
185  // Postconditions:
186 
187  ensure(postcondition_of(\
188  multiply(x0.property(), x1, xresult.property(), xauto_access)));
189 
190  // Exit:
191 
192  return;
193 }
194 
196 void
198 multiply_equal(field_vd& xresult, const vd_value_type& xother,
199  bool xauto_access)
200 {
201  // Preconditions:
202 
203  require(precondition_of(multiply(xresult, xother, xresult, xauto_access)));
204 
205  // Body:
206 
207  multiply(xresult, xother, xresult, xauto_access);
208 
209  // Postconditions:
210 
211  ensure(postcondition_of(multiply(xresult, xother, xresult, xauto_access)));
212 
213  // Exit:
214 
215  return;
216 }
217 
218 void
220 divide(const field_vd& x0, const sec_at0& x1, field_vd& xresult,
221  bool xauto_access)
222 {
223  // Preconditions:
224 
225  require(precondition_of(\
226  divide(x0.property(), x1, xresult.property(), xauto_access)));
227 
228  // Body:
229 
230  fiber_bundle::sec_vd_algebra::divide(x0.property(), x1, xresult.property(), xauto_access);
231 
232  // Postconditions:
233 
234  ensure(postcondition_of(\
235  divide(x0.property(), x1, xresult.property(), xauto_access)));
236 
237  // Exit:
238 
239  return;
240 }
241 
243 void
245 divide_equal(field_vd& xresult, const sec_at0& xother, bool xauto_access)
246 {
247  // Preconditions:
248 
249  require(precondition_of(divide(xresult, xother, xresult, xauto_access)));
250 
251  // Body:
252 
253  divide(xresult, xother, xresult, xauto_access);
254 
255  // Postconditions:
256 
257  ensure(postcondition_of(divide(xresult, xother, xresult, xauto_access)));
258 
259  // Exit:
260 
261  return;
262 }
263 
265 void
267 divide(const field_vd& x0, const vd_value_type& x1, field_vd& xresult,
268  bool xauto_access)
269 {
270  // Preconditions:
271 
272  require(precondition_of(\
273  divide(x0.property(), x1, xresult.property(), xauto_access)));
274 
275  // Body:
276 
277  fiber_bundle::sec_vd_algebra::divide(x0.property(), x1, xresult.property(), xauto_access);
278 
279  // Postconditions:
280 
281  ensure(postcondition_of(\
282  divide(x0.property(), x1, xresult.property(), xauto_access)));
283 
284  // Exit:
285 
286  return;
287 }
288 
290 void
292 divide_equal(field_vd& xresult, const vd_value_type& xother, bool xauto_access)
293 {
294  // Preconditions:
295 
296  require(precondition_of(divide(xresult, xother, xresult, xauto_access)));
297 
298  // Body:
299 
300  divide(xresult, xother, xresult, xauto_access);
301 
302  // Postconditions:
303 
304  ensure(postcondition_of(divide(xresult, xother, xresult, xauto_access)));
305 
306  // Exit:
307 
308  return;
309 }
310 
312 void
314 contract(const field_vd& xvector, const field_vd& xcovector,
315  field_at0& xresult, bool xauto_access)
316 {
317  // Preconditions:
318 
319  require(precondition_of(\
320  contract(xvector.property(), xcovector.property(),\
321  xresult.property(), xauto_access)));
322 
323  // Body:
324 
326  xresult.property(), xauto_access);
327 
328  // Postconditions:
329 
330  ensure(postcondition_of(\
331  contract(xvector.property(), xcovector.property(),\
332  xresult.property(), xauto_access)));
333 
334  // Exit:
335 
336  return;
337 }
SHEAF_DLL_SPEC void add(const e3_lite &x0, const e3_lite &x1, vd_value_type xt, e3_lite &xresult)
Weighted sum x0*(1-xt) + x1*xt (pre-allocated version for volatile types).
Definition: e3.cc:2381
sec_at0 & property() const
The dependent variable of this field.
Definition: field_at0.cc:329
SHEAF_DLL_SPEC void divide_equal(field_vd &xresult, const sec_at0 &xother, bool xauto_access)
xresult divide_equal xother (pre-allocated version); synonym for divide(xresult, xother, xresult, xauto_access).
SHEAF_DLL_SPEC void subtract_equal(field_vd &xresult, const field_vd &xother, bool xauto_access)
x0 subtract_equal x1 (self-allocated version); synonym for subtract(xresult, xother, xresult, xauto_access).
SHEAF_DLL_SPEC void subtract(const vd &x0, const vd &x1, vd &xresult, bool xauto_access)
x0 subtract x1 (pre-allocated version for persistent types).
Definition: vd.cc:1789
SHEAF_DLL_SPEC void divide(const field_vd &x0, const sec_at0 &x1, field_vd &xresult, bool xauto_access)
x0 divided by x1 (pre-allocated version).
SHEAF_DLL_SPEC void subtract(const field_vd &x0, const field_vd &x1, field_vd &xresult, bool xauto_access)
x0 subtract x1 (pre-allocated version).
SHEAF_DLL_SPEC void subtract(const sec_vd &x0, const sec_vd &x1, sec_vd &xresult, bool xauto_access)
x0 subtract x1 (pre-allocated version).
Definition: sec_vd.cc:1568
SHEAF_DLL_SPEC void multiply_equal(field_vd &xresult, const sec_at0 &xother, bool xauto_access)
xresult multiply_equal xresult (pre-allocated version); synonym for multiply(xresult, xother, xresult, xauto_access).
A vd-valued property as a function of global coordinates.
Definition: field_vd.h:69
sec_vd & property() const
The dependent variable of this field.
Definition: field_vd.cc:357
SHEAF_DLL_SPEC void contract(const field_vd &xvector, const field_vd &xcovector, field_at0 &xresult, bool xauto_access)
Contraction of vector xvector on covector xcovector (pre-allocated version).
SHEAF_DLL_SPEC void divide(const vd &x0, const vd_value_type &x1, vd &xresult, bool xauto_access)
Vector x0 divided by scalar x1 (pre-allocated version for persistent types).
Definition: vd.cc:2024
SHEAF_DLL_SPEC void add(const sec_vd &x0, const sec_vd &x1, sec_vd &xresult, bool xauto_access)
x0 add x1 (pre-allocated version).
Definition: sec_vd.cc:1536
SHEAF_DLL_SPEC void add_equal(field_vd &xresult, const field_vd &xother, bool xauto_access)
x0 add_equal x1 (self-allocated version); synonym for add(xresult, xother, xresult, xauto_access).
A property of type sec_at0 as a function of global coordinates.
Definition: field_at0.h:50
SHEAF_DLL_SPEC void multiply(const sec_vd &x0, const sec_at0 &x1, sec_vd &xresult, bool xauto_access)
x0 multiplied by x1 (pre-allocated version).
Definition: sec_vd.cc:1600
SHEAF_DLL_SPEC void add(const field_vd &x0, const field_vd &x1, field_vd &xresult, bool xauto_access)
x0 add x1 (pre-allocated version).
SHEAF_DLL_SPEC void divide(const sec_vd &x0, const sec_at0 &x1, sec_vd &xresult, bool xauto_access)
x0 divided by x1 (pre-allocated version).
Definition: sec_vd.cc:1655
SHEAF_DLL_SPEC void multiply(const vd &x0, const vd_value_type &x1, vd &xresult, bool xauto_access)
Vector x0 multiplied by scalar x1 (pre-allocated version for persistent types).
Definition: vd.cc:1924
SHEAF_DLL_SPEC void contract(const sec_vd &xvector, const sec_vd &xcovector, sec_at0 &xresult, bool xauto_access)
Contraction of vector xvector on covector xcovector (pre-allocated version).
Definition: sec_vd.cc:1826
Antisymetric tensor of degree 0. As the degree is 0 there is nothing to be symmetric or antisymmetric...
Definition: sec_at0.h:51
SHEAF_DLL_SPEC void multiply(const field_vd &x0, const sec_at0 &x1, field_vd &xresult, bool xauto_access)
x0 multiplied by x1 (pre-allocated version).
double vd_value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: fiber_bundle.h:63
SHEAF_DLL_SPEC void contract(const t2_lite &x0, int xp, int xq, at0_lite &xresult)
Contraction on contravariant index xp and covariant index xq (pre-allocated version for volatime type...
Definition: t2.cc:1091