3#ifndef DUNE_REFINED_SIMPLEX_LOCALBASIS_HH
4#define DUNE_REFINED_SIMPLEX_LOCALBASIS_HH
12#include <dune/localfunctions/common/localbasis.hh>
16 template<
class D,
int dim>
17 class RefinedSimplexLocalBasis
20 RefinedSimplexLocalBasis()
34 class RefinedSimplexLocalBasis<D,1>
55 else if (global[0] <= 1.0)
71 if (global[0] <= 0.5) {
73 local[0] = 2.0 * global[0];
78 local[0] = 2.0 * global[0] - 1.0;
95 class RefinedSimplexLocalBasis<D,2>
119 if (global[0] + global[1] <= 0.5)
121 else if (global[0] >= 0.5)
123 else if (global[1] >= 0.5)
139 if (global[0] + global[1] <= 0.5) {
141 local[0] = 2*global[0];
142 local[1] = 2*global[1];
144 }
else if (global[0] >= 0.5) {
146 local[0] = 2*global[0]-1;
147 local[1] = 2*global[1];
149 }
else if (global[1] >= 0.5) {
151 local[0] = 2*global[0];
152 local[1] = 2*global[1]-1;
157 local[0] = -2 * global[0] + 1;
158 local[1] = -2 * global[1] + 1;
176 class RefinedSimplexLocalBasis<D,3>
215 if (global[0] + global[1] + global[2] <= 0.5)
217 else if (global[0] >= 0.5)
219 else if (global[1] >= 0.5)
221 else if (global[2] >= 0.5)
223 else if ((global[0] + global[1] <= 0.5)and (global[1] + global[2] <= 0.5))
225 else if ((global[0] + global[1] >= 0.5)and (global[1] + global[2] <= 0.5))
227 else if ((global[0] + global[1] <= 0.5)and (global[1] + global[2] >= 0.5))
229 else if ((global[0] + global[1] >= 0.5)and (global[1] + global[2] >= 0.5))
245 if (global[0] + global[1] + global[2] <= 0.5) {
250 }
else if (global[0] >= 0.5) {
256 }
else if (global[1] >= 0.5) {
262 }
else if (global[2] >= 0.5) {
268 }
else if ((global[0] + global[1] <= 0.5)and (global[1] + global[2] <= 0.5)) {
270 local[0] = 2.0 * global[1];
271 local[1] = 2.0 * (0.5 - global[0] - global[1]);
272 local[2] = 2.0 * (-0.5 + global[0] + global[1] + global[2]);
284 }
else if ((global[0] + global[1] >= 0.5)and (global[1] + global[2] <= 0.5)) {
286 local[0] = 2.0 * (0.5 - global[0]);
287 local[1] = 2.0 * (0.5 - global[1] - global[2]);
288 local[2] = 2.0 * global[2];
298 }
else if ((global[0] + global[1] <= 0.5)and (global[1] + global[2] >= 0.5)) {
300 local[0] = 2.0 * (0.5 - global[0] - global[1]);
301 local[1] = 2.0 * global[0];
302 local[2] = 2.0 * (-0.5 + global[1] + global[2]);
313 }
else if ((global[0] + global[1] >= 0.5)and (global[1] + global[2] >= 0.5)) {
315 local[0] = 2.0 * (-0.5 + global[1] + global[2]);
316 local[1] = 2.0 * (0.5 - global[1]);
317 local[2] = 2.0 * (-0.5 + global[0] + global[1]);
vector space out of a tensor product of fields.
Definition: fvector.hh:95
Default exception if a function was called while the object is not in a valid state for that function...
Definition: exceptions.hh:279
Default exception for dummy implementations.
Definition: exceptions.hh:261
RefinedSimplexLocalBasis()
Protected default constructor so this class can only be instantiated as a base class.
Definition: refinedsimplexlocalbasis.hh:39
static void getSubElement(const FieldVector< D, 1 > &global, int &subElement, FieldVector< D, 1 > &local)
Get local coordinates in the subelement.
Definition: refinedsimplexlocalbasis.hh:67
static int getSubElement(const FieldVector< D, 1 > &global)
Get the number of the subelement containing a given point.
Definition: refinedsimplexlocalbasis.hh:51
RefinedSimplexLocalBasis()
Protected default constructor so this class can only be instantiated as a base class.
Definition: refinedsimplexlocalbasis.hh:100
static int getSubElement(const FieldVector< D, 2 > &global)
Get the number of the subtriangle containing a given point.
Definition: refinedsimplexlocalbasis.hh:117
static void getSubElement(const FieldVector< D, 2 > &global, int &subElement, FieldVector< D, 2 > &local)
Get local coordinates in the subtriangle.
Definition: refinedsimplexlocalbasis.hh:135
static void getSubElement(const FieldVector< D, 3 > &global, int &subElement, FieldVector< D, 3 > &local)
Get local coordinates in the subsimplex.
Definition: refinedsimplexlocalbasis.hh:241
RefinedSimplexLocalBasis()
Protected default constructor so this class can only be instantiated as a base class.
Definition: refinedsimplexlocalbasis.hh:181
static int getSubElement(const FieldVector< D, 3 > &global)
Get the number of the subsimplex containing a given point in the reference element.
Definition: refinedsimplexlocalbasis.hh:213
A few common exception classes.
Implements a vector constructed from a given type representing a field and a compile-time given size.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
Dune namespace.
Definition: alignedallocator.hh:11