6#ifndef vectorialThings_hh
7#define vectorialThings_hh
24#define VectorialConstr_D 0
25#define VectorialPut_D 0
27#define TMatrixOffsetConstr_D 0
29#define TMatrixConstr_D 0
31#define ElementConstr_D 0
33#define BilinearFormConstr_D 0
35#define LinearFormConstr_D 0
37#define SpaceConstr_D 0
42 class ElementGraphics;
44 template<
typename F,
typename G>
45 class ElementFunction;
68 "vdim = " <<
vdim_ <<
", arraywidth = " << arrayWidth);
72 virtual void insert(F& vdata,
const int a = 0,
const int b = 0);
74 virtual const F*
get(
const int a,
const int b = 0)
const
95 vdata_[idx_++] = &vdata;
96 DEBUGL(VectorialConstr_D,
"idx = " << idx_);
114 offsetRow_(offsetRow), offsetColumn_(offsetColumn), T_(T) {
115 DEBUGL(TMatrixOffsetConstr_D,
116 "offsetRow = " << offsetRow_ <<
", " <<
117 "offsetColumn = " << offsetColumn_ <<
", T = " << T_);
123 virtual void operator ()
129 virtual uint
index(
unsigned int i)
const {
return T_.index(i); }
131 inline uint m()
const {
return T_.m(); }
133 inline uint n()
const {
return T_.n(); }
141 virtual std::ostream&
info(std::ostream& os)
const;
143 uint offsetRow_, offsetColumn_;
159 offsetRow_(0), offsetColumn_(0) {
160 DEBUGL(TMatrixConstr_D,
"done.");
166 virtual void operator()
177 virtual uint
index(
unsigned int i)
const;
193 virtual std::ostream&
info(std::ostream& os)
const;
195 uint offsetRow_, offsetColumn_;
223 template<
class ElementType>
227 typedef typename ElementType::type F;
229 ElementBase(uint
vdim, uint arrayWidth, std::string name =
"ElementBase") :
232 DEBUGL(ElementConstr_D,
"done.");
240 virtual void put(ElementType& em,
const int dim,
const int b = 0);
244 if (! graphics_.get())
246 return graphics_.get();
248 static Graphics<F>* vecGraphics() {
249 if (! graphics_.get())
250 graphics_.reset(
new Graphics<F>());
251 return graphics_.get();
254 virtual std::ostream& info(std::ostream& os)
const;
256 std::unique_ptr<vectorial::TMatrix<F> >
T_;
258 static std::unique_ptr<Graphics<F> > graphics_;
274 "vectorial::Element") {}
290 "vectorial::ElementWithCell"),
291 cell_(0), intCell_(0) {}
299 const int dim,
const int b = 0);
302 bool localCoord)
const;
316 template<class F, class G = typename concepts::Realtype<F>::type>
318 public Vectorial<concepts::BilinearForm<F,G> > {
329 DEBUGL(BilinearFormConstr_D,
"done.");
349 const int i,
const int j);
370 virtual std::ostream&
info(std::ostream& os)
const;
377 std::unique_ptr<concepts::Cloneable> sharedData_;
394 class Scan<
vectorial::ElementWithCell<F> > :
425 template<
class SpaceType>
433 std::string name =
"SpaceBase")
436 , dim_(0), nelm_(0), elm_(0), name_(name)
438 DEBUGL(SpaceConstr_D,
"done.");
442 , dim_(spcb.dim_) , nelm_(spcb.nelm_)
443 , elm_(spcb.elm_) , name_(spcb.name_)
449 virtual uint dim()
const {
return dim_; }
450 virtual uint nelm()
const {
return nelm_; }
457 virtual void put(SpaceType &spc,
const int i = 0,
const int j = 0);
462 virtual std::ostream& info(std::ostream& os)
const;
468 void buildElm_(
const SpaceType& spc, uint idx);
480 Space(
const uint
vdim,
const uint arrayWidth=0)
507 public Vectorial<concepts::ElementPair<F> > {
515 const int iV,
const int iU);
virtual T & operator++(int)=0
Returns the next element in the scanned set.
std::unique_ptr< vectorial::TMatrix< F > > T_
T matrix for the vector valued element.
virtual void put(ElementType &em, const int dim, const int b=0)
virtual const concepts::Element< F > & elm1() const
Returns reference to the first element.
virtual const concepts::Element< F > & elm2() const
Returns reference to the second element.
virtual bool quadraturePoint(uint i, intPoint &p, intFormType form, bool localCoord) const
virtual const concepts::Cell & cell() const
Returns the cell on which the element is built.
virtual void put(concepts::ElementWithCell< F > &em, const int dim, const int b=0)
void rebuild()
Rebuilds the vectorial space from the scalar spaces.
virtual void put(SpaceType &spc, const int i=0, const int j=0)
virtual void operator()(const concepts::ElementMatrix< F > &A, concepts::ElementMatrix< F > &B) const
virtual void extract(const concepts::Vector< F > &solution, concepts::Array< F > &coeff) const
virtual void usedIdx(concepts::TColumn< bool > &c) const
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual uint index(unsigned int i) const
Maps the local index i to the global index.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual void extract(const concepts::Vector< F > &solution, concepts::Array< F > &coeff) const
virtual uint index(unsigned int i) const
Maps the local index i to the global index.
virtual void operator()(const concepts::ElementMatrix< F > &A, concepts::ElementMatrix< F > &B) const
virtual void usedIdx(concepts::TColumn< bool > &c) const
void put(const concepts::TMatrixBase< F > &T, const int dim)
virtual const F * get(const int a, const int b=0) const
Get a component.
uint vdim() const
Returns number of components.
uint vdim_
Number of components.
virtual void insert(F &vdata, const int a=0, const int b=0)
Add a component.
uint idx_
Index of the last added component.
Vectorial(uint vdim, uint arrayWidth)
concepts::Array< F * > vdata_
Storage.
#define DEBUGL(doit, msg)
Set< F > makeSet(uint n, const F &first,...)