⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cogfunction.hxx

📁 有限元学习研究用源代码(老外的),供科研人员参考
💻 HXX
字号:
#ifndef cogfunction_hxx
#define cogfunction_hxx

#ifndef cog_hxx
#include "cog.hxx"
#endif
#include "cog1d.hxx"


class CogeometryWithRegions: public Cogeometry{
  const cogPointToSegment& f;
public:
  CogeometryWithRegions(const cogPointToSegment& func)
    :f(func){;}
  cogIndex     Point(cogPoint& p0) const;
};

class CogeometryOfRegions
  : public cogPointToSegment ,public CogeometryWithRegions
{
public:
  cogSegment (*f)(const cogPoint& p);
  CogeometryOfRegions(cogSegment (*func)(const cogPoint& p))
    :CogeometryWithRegions(*(cogPointToSegment*)this),f(func){;}
  cogSegment operator()(const cogPoint& p) const
  {return f(p);}
};


class CogeometryByFunction: public Cogeometry{
  const cogPointToFloat& f;
  cogeometry g;
public:
  CogeometryByFunction(const cogPointToFloat& func)
    :f(func),g(new Cogeometry1D()){;}
  CogeometryByFunction(const cogPointToFloat& func,cogeometry geom)
    :f(func),g(geom){;}
  virtual cogIndex	Point(cogPoint& p0) const;
  virtual wzIndex	BoundaryCondition(cogFlag1& f) const;
};

class CogeometryByMap: public Cogeometry{
  const cogPointToPoint& m;
  cogeometry g;
public:
  CogeometryByMap(const cogPointToPoint& map
		  ,cogeometry geom) // =new Cogeometry1D())
    :m(map),g(geom){;}
  cogIndex     Point(cogPoint& p0) const;
};

// pattern for special functions implementation - see also simple.hxx

class CogeometrySimpleRegions:
  public cogPointToSegment,
  public CogeometryWithRegions{
public:
  cogSegment (*f)(const cogPoint& p);
  CogeometrySimpleRegions(cogSegment (*func)(const cogPoint& p))
    :CogeometryWithRegions(*(cogPointToSegment*)this),f(func){;}
  cogSegment operator()(const cogPoint& p) const
  {return f(p);}
};

class CogeometrySimpleFunction:
  public cogPointToFloat,
  public CogeometryByFunction
{
public:
  cogFloat (*f)(const cogPoint& p);
  CogeometrySimpleFunction(cogFloat (*func)(const cogPoint& p)
			   ,cogeometry geom) // = new Cogeometry1D())
    :CogeometryByFunction(*(cogPointToFloat*)this,geom),f(func){;}
  cogFloat operator()(const cogPoint& p) const
  {return f(p);}
};


class CogeometrySimpleMap:
  public cogPointToPoint,
  public CogeometryByMap
{
public:
        void (*m)(cogPoint&, const cogPoint&);
	CogeometrySimpleMap(void (*map)(cogPoint&,const cogPoint&)
			    ,cogeometry geom) // = new Cogeometry1D())
		:CogeometryByMap(*(cogPointToPoint*)this,geom),m(map){;}
        void operator()(cogPoint& p, const cogPoint& pold) const
		{m(p,pold);}
};

#define CogeometrySimpleRegions CogeometryOfRegions
#define CogeometryByRegions CogeometryWithRegions

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -