example_cochains
normal_vector_field(manifold_name='icosa', dual=True)
Generates a unit vector-valued Cochain normal to a SimplicialManifold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manifold_name
|
str
|
The name of the manifold we want to compute the normal field on. Should either be 'hexa', 'sphere' or 'icosa'. Default is 'icosa'. |
'icosa'
|
dual
|
bool
|
If True, the normal vectors correspond to the normals to the top (primal) simplices. If False, the normal vectors correspond to normals to the top (dual) cells. Default is True. |
True
|
Returns:
| Type | Description |
|---|---|
Optional[Cochain]
|
The generated cochain. |
Notes
- The returned
Cochainis either a dual or a primal 0-Cochain, depending on the value of thedualargument. - In the case of the sphere, the computation is performed on the small one, i.e. the number of vectors will be 3420.
Source code in src/dxtr/cochains/example_cochains.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
random_cochain(complex_name='icosa', dim=1, dual=False, manifold=False, interval=(0, 1))
Generates a random scalar-valued k-Cochain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
complex_name
|
str
|
The name of the |
'icosa'
|
dim
|
int
|
The topological dimension of the desired Cochain. Should be in (0, 1, 2). Default is 1. |
1
|
dual
|
bool
|
If True, returns a dual cochain. Default is False. |
False
|
manifold
|
bool
|
If True, the supporting domain is a |
False
|
interval
|
tuple[float]
|
The interval within to draw the random values. Default is (0, 1). |
(0, 1)
|
Returns:
| Type | Description |
|---|---|
Cochain
|
The generated cochain. |
Notes
The random values are generated with the numpy.random.uniform function.
The random values can include interval[0] but exclude interval[-1].
Source code in src/dxtr/cochains/example_cochains.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
unit_cochain(complex_name='icosa', dim=1, dual=False, manifold=False)
Generates a 1-valued k-Cochain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
complex_name
|
str
|
The name of the |
'icosa'
|
dim
|
int
|
The topological dimension of the desired Cochain. Should be in (0, 1, 2). Default is 1. |
1
|
dual
|
bool
|
If True, returns a dual cochain. Default is False. |
False
|
manifold
|
bool
|
If True, the supporting domain is a |
False
|
Returns:
| Type | Description |
|---|---|
Cochain
|
The generated cochain. |
Source code in src/dxtr/cochains/example_cochains.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |