IFEM 90A354
ASM2D.h
Go to the documentation of this file.
1// $Id$
2//==============================================================================
12//==============================================================================
13
14#ifndef _ASM_2D_H
15#define _ASM_2D_H
16
17#include "ASMenums.h"
18#include <vector>
19#include <cstddef>
20
21class ASMbase;
22class Vec3;
23
24
32class ASM2D
33{
34protected:
36 ASM2D() {}
37
38public:
40 virtual ~ASM2D() {}
41
42 typedef std::vector<unsigned char> CharVec;
43
49 static ASMbase* create(ASM::Discretization type, unsigned char nd,
50 const CharVec& nf, bool mixedFEM = false);
54 static ASMbase* create(ASM::Discretization type, unsigned char nf = 1);
55
64 ASMbase* clone(const CharVec& nf = CharVec()) const;
65
67 virtual bool checkRightHandSystem() { return false; }
68
72 virtual bool uniformRefine(int dir, int nInsert) = 0;
76 virtual bool raiseOrder(int ru, int rv) = 0;
81 virtual bool refine(int dir, const std::vector<double>& xi,
82 double scale = 1.0) = 0;
83
90 virtual void constrainEdge(int dir, bool open, int dof, int code = 0,
91 char basis = 1) = 0;
99 virtual size_t constrainEdgeLocal(int dir, bool open, int dof, int code = 0,
100 bool project = false) = 0;
101
112 virtual void constrainCorner(int I, int J, int dof, int code = 0,
113 char basis = 1) = 0;
125 virtual void constrainNode(double xi, double eta, int dof, int code = 0) = 0;
126
131 virtual bool getGridParameters(std::vector<double>& prm,
132 int dir, int nSegSpan) const = 0;
133
135 virtual int getCorner(int I, int J, int basis) const = 0;
136
144 virtual bool connectPatch(int edge, ASM2D& neighbor, int nedge, bool revers,
145 int = 0, bool coordCheck = true, int thick = 1) = 0;
146
147protected:
149 static double getElementSize(const std::vector<Vec3>& XC);
150};
151
152#endif
Various enums for assembly scope.
Abstract interface for 2D spline patches.
Definition ASM2D.h:33
virtual bool refine(int dir, const std::vector< double > &xi, double scale=1.0)=0
Refines the parametrization by inserting extra knots.
virtual void constrainNode(double xi, double eta, int dof, int code=0)=0
Constrains a node identified by two relative parameter values.
virtual int getCorner(int I, int J, int basis) const =0
Returns the node index for a given corner.
virtual ~ASM2D()
Empty destructor.
Definition ASM2D.h:40
static ASMbase * create(ASM::Discretization type, unsigned char nd, const CharVec &nf, bool mixedFEM=false)
Creates a two-parametric patch of specified discretization type.
Definition ASM2D.C:36
virtual bool getGridParameters(std::vector< double > &prm, int dir, int nSegSpan) const =0
Calculates parameter values for visualization nodal points.
ASM2D()
The constructor is protected to allow objects of sub-classes only.
Definition ASM2D.h:36
static double getElementSize(const std::vector< Vec3 > &XC)
Returns characteristic element size based on corner coordinates.
Definition ASM2D.C:115
virtual void constrainEdge(int dir, bool open, int dof, int code=0, char basis=1)=0
Constrains all DOFs on a given boundary edge.
virtual void constrainCorner(int I, int J, int dof, int code=0, char basis=1)=0
Constrains a corner node identified by the two parameter indices.
virtual bool checkRightHandSystem()
Checks that the patch is modelled in a right-hand-side system.
Definition ASM2D.h:67
virtual size_t constrainEdgeLocal(int dir, bool open, int dof, int code=0, bool project=false)=0
Constrains all DOFs in local directions on a given boundary edge.
std::vector< unsigned char > CharVec
Convenience type.
Definition ASM2D.h:42
ASMbase * clone(const CharVec &nf=CharVec()) const
Returns a copy of this patch with identical FE discretization.
Definition ASM2D.C:89
virtual bool connectPatch(int edge, ASM2D &neighbor, int nedge, bool revers, int=0, bool coordCheck=true, int thick=1)=0
Connects all matching nodes on two adjacent boundary edges.
virtual bool raiseOrder(int ru, int rv)=0
Raises the order of the spline object for this patch.
virtual bool uniformRefine(int dir, int nInsert)=0
Refines the parametrization by inserting extra knots uniformly.
Base class for spline-based finite element (FE) assembly drivers.
Definition ASMbase.h:72
Simple class for representing a point in 3D space.
Definition Vec3.h:27
Discretization
Enum defining the available discretization methods.
Definition ASMenums.h:22