/usr/include/gmsh/FuncSpaceData.h is in libgmsh-dev 2.10.1+dfsg1-1ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 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 76 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 | // Gmsh - Copyright (C) 1997-2015 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@geuz.org>.
#ifndef FUNCSPACEDATA_H
#define FUNCSPACEDATA_H
#include "GmshDefines.h"
#include "GmshMessage.h"
#include "ElementType.h"
#include <cstddef>
class MElement;
class FuncSpaceData
{
// Store data that allow to easily know how to construct gradient, jacobian,
// bezier and metric bases.
private:
int _tag, _spaceOrder, _nij, _nk;
bool _pyramidalSpace, _serendipity;
// When '_parentType' == TYPE_PYR,
// if _pyramidalSpace == true, then the space is {X^i Y^j Z^k | i,j <= k+'_nij', k <= '_nk'},
// otherwise, the space is {X^i Y^j Z^k | i,j <= '_nij', k <= '_nk'},
// where X = xi/(1-zeta), Y = eta/(1-zeta) and Z = 1-zeta.
public:
FuncSpaceData() : _tag(-1), _spaceOrder(-1), _nij(-1), _nk(-1),
_pyramidalSpace(false), _serendipity(false) {}
// Constructors using MElement*
FuncSpaceData(const MElement *el, const bool *serendip = NULL);
FuncSpaceData(const MElement *el, int order, const bool *serendip = NULL);
FuncSpaceData(const MElement *el,
bool pyr, int nij, int nk,
const bool *serendip = NULL);
// Constructors using element tag
FuncSpaceData(int tag, const bool *serendip = NULL);
// constructors using element tag or element type
FuncSpaceData(bool isTag, int tagOrType, int order,
const bool *serendip = NULL, bool elemIsSerendip = false);
FuncSpaceData(bool isTag, int tagOrType, bool pyr, int nij, int nk,
const bool *serendip = NULL, bool elemIsSerendip = false);
// Print
void print() const {
Msg::Info("FuncSpaceData: tag%d, order%d, nij%d, nk%d, pyr%d, serendip%d",
_tag, _spaceOrder, _nij, _nk, _pyramidalSpace, _serendipity);
}
// Get methods
int elementTag() const {return _tag;}
int elementType() const {return ElementType::ParentTypeFromTag(_tag);}
int elementOrder() const {return ElementType::OrderFromTag(_tag);}
int dimension() const {return ElementType::DimensionFromTag(_tag);}
int spaceOrder() const {return _spaceOrder;}
int nij() const {return _nij;}
int nk() const {return _nk;}
bool elementIsOnlySerendipity() const {
return ElementType::SerendipityFromTag(_tag) > 1;
}
bool spaceIsSerendipity() const {return _serendipity;}
bool isPyramidalSpace() const {return _pyramidalSpace;}
void getOrderForBezier(int[3], int exponentZ = -1) const;
// Change space
FuncSpaceData getForPrimaryElement() const;
FuncSpaceData getForNonSerendipitySpace() const;
//
inline bool operator<(const FuncSpaceData &other) const {
if (_tag == other._tag) {
if (_spaceOrder == other._spaceOrder) {
if (_nij == other._nij) {
if (_nk == other._nk) {
return _pyramidalSpace == true ? false : other._pyramidalSpace;
}
else return _nk < other._nk;
}
else return _nij < other._nij;
}
else return _spaceOrder < other._spaceOrder;
}
else return _tag < other._tag;
}
inline bool operator==(const FuncSpaceData &other) const {
return _tag == other._tag && _spaceOrder == other._spaceOrder &&
_nij == other._nij && _nk == other._nk &&
_pyramidalSpace == other._pyramidalSpace;
}
};
#endif
|