/usr/include/gmsh/thermicSolver.h is in libgmsh-dev 2.15.0+dfsg1-3.
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-2010 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@onelab.info>.
#ifndef _THERMIC_SOLVER_H_
#define _THERMIC_SOLVER_H_
#include <map>
#include <string>
#include "SVector3.h"
#include "dofManager.h"
#include "simpleFunction.h"
#include "functionSpace.h"
class GModel;
class PView;
class groupOfElements;
class gLevelset;
struct LagrangeMultiplierFieldT {
int _tag;
groupOfElements *g;
double _tau;
simpleFunction<double> *_f;
LagrangeMultiplierFieldT() : _tag(0), g(0){}
};
struct thermicField {
int _tag; // tag for the dofManager
groupOfElements *g; // support for this field
double _k; // diffusivity
thermicField () : _tag(0), g(0){}
};
struct BoundaryConditionT
{
int _tag; // tag for the dofManager
enum location{UNDEF, ON_VERTEX, ON_EDGE, ON_FACE, ON_VOLUME};
location onWhat; // on vertices or elements
groupOfElements *g; // support for this BC
BoundaryConditionT() : _tag(0), onWhat(UNDEF), g(0) {}
};
struct dirichletBCT : public BoundaryConditionT
{
simpleFunction<double> *_f;
dirichletBCT ():BoundaryConditionT(), _f(0){}
};
struct neumannBCT : public BoundaryConditionT
{
simpleFunction<double> *_f;
neumannBCT () : BoundaryConditionT(), _f(0){}
};
// a thermic solver ...
class thermicSolver
{
protected:
GModel *pModel;
int _dim, _tag;
dofManager<double> *pAssembler;
FunctionSpace<double> *LagSpace;
FunctionSpace<double> *LagrangeMultiplierSpace;
// young modulus and poisson coefficient per physical
std::vector<thermicField> thermicFields;
std::vector<LagrangeMultiplierFieldT> LagrangeMultiplierFields;
// neumann BC
std::vector<neumannBCT> allNeumann;
// dirichlet BC
std::vector<dirichletBCT> allDirichlet;
public:
thermicSolver(int tag) : _tag(tag), pAssembler(0), LagSpace(0), LagrangeMultiplierSpace(0) {}
virtual ~thermicSolver()
{
if (LagSpace) delete LagSpace;
if (LagrangeMultiplierSpace) delete LagrangeMultiplierSpace;
if (pAssembler) delete pAssembler;
}
void assemble (linearSystem<double> *lsys);
virtual void setMesh(const std::string &meshFileName);
void cutMesh(gLevelset *ls);
void setThermicDomain(int phys, double k);
void setLagrangeMultipliers(int phys, double tau, int tag, simpleFunction<double> *f);
void changeLMTau(int tag, double tau);
void setEdgeTemp(int edge, simpleFunction<double> *f);
void setFaceTemp(int face, simpleFunction<double> *f);
void solve();
virtual PView *buildTemperatureView(const std::string postFileName);
virtual PView *buildLagrangeMultiplierView(const std::string postFileName);
double computeL2Norm(simpleFunction<double> *f);
double computeLagNorm(int tag, simpleFunction<double> *f);
PView* buildErrorEstimateView(const std::string errorFileName,
simpleFunction<double> *sol);
// std::pair<PView *, PView*> buildErrorEstimateView
// (const std::string &errorFileName, const elasticityData &ref, double, int);
};
#endif
|