SheafSystem  0.0.0.0
discretization_context.cc
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 
18 // Implementation for class discretization_context
19 
20 #include "SheafSystem/discretization_context.h"
21 
22 #include "SheafSystem/assert_contract.h"
23 #include "SheafSystem/error_message.h"
24 
25 using namespace std;
26 
27 // =============================================================================
28 // NON-MEMBER FUNCTIONS
29 // =============================================================================
30 
31 std::ostream&
33 operator<<(std::ostream& xos, const fiber_bundle::discretization_context& xc)
34 {
35  // Preconditions:
36 
37  // Body:
38 
39  xos << "eval_id = " << xc.eval_id << endl;
40  xos << "local_id = " << xc.local_id << endl;
41  xos << "disc_id = " << xc.disc_id << endl;
42  xos << "values =";
43  for(int i=0; i<xc.values_ub; ++i)
44  {
45  xos << " " << xc.values[i];
46  }
47  xos << endl;
48 
49  // Postconditions:
50 
51  // Exit:
52 
53  return xos;
54 }
55 
56 size_t
57 fiber_bundle::
58 deep_size(const discretization_context& xc, bool xinclude_shallow)
59 {
60  size_t result;
61 
62  // Preconditions:
63 
64  // Body:
65 
68 
69  result = 0;
70 
71  // Postconditions:
72 
73  ensure(result == 0);
74  //ensure(result >= 0);
75 
76  // Exit
77 
78  return result;
79 }
scoped_index eval_id
The eval member the disc member is contained in.
A context for discretization members. Intended for implementing various iterators, especially concurrent iterations over multiple sections.
scoped_index disc_id
The global index of the disc member.
STL namespace.
int local_id
The local index of the disc member with respect to the eval member.
sec_vd_value_type values[values_ub]
The values of another section (typically the global coordinates) at this disc point.
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const binary_index &xbi)
Insert binary_index& xbi into ostream& os.
Definition: binary_index.cc:35