SyFi  0.3
SyFi Namespace Reference

Classes

class  ArnoldFalkWintherWeakSymSigma
class  ArnoldFalkWintherWeakSymU
class  ArnoldFalkWintherWeakSymP
class  BrezziDouglasMarini
class  Bubble
class  CrouzeixRaviart
class  VectorCrouzeixRaviart
class  DiscontinuousLagrange
class  VectorDiscontinuousLagrange
class  Dof
class  FE
class  StandardFE
class  SymbolMapBuilderVisitor
class  SymbolCounterVisitor
class  ExStatsVisitor
class  ExStats
class  Hermite
class  Lagrange
class  VectorLagrange
class  TensorLagrange
class  MixedFE
class  Nedelec
class  Nedelec2Hdiv
class  OrderedPtvSet
struct  OrderedPtvSet_is_less
class  OrderedPtvSet_i
struct  OrderedPtvSet_i_is_less
class  P0
class  VectorP0
class  TensorP0
class  Polygon
class  Line
class  ReferenceLine
class  Triangle
class  ReferenceTriangle
class  Rectangle
class  ReferenceRectangle
class  Tetrahedron
class  ReferenceTetrahedron
class  Box
class  ReferenceBox
class  Simplex
class  RaviartThomas
class  Robust
class  SpaceTimeDomain
class  SpaceTimeElement
class  _object
class  SwigPyIterator
class  exvector
class  exmap
class  ex_int_map
class  symexpair
class  symexlist
class  exlist
class  exset

Typedefs

typedef std::pair
< GiNaC::symbol, GiNaC::ex > 
symexpair
typedef std::list< std::pair
< GiNaC::symbol, GiNaC::ex > > 
symexlist
typedef std::list< GiNaC::ex > exlist
typedef std::set< GiNaC::ex,
GiNaC::ex_is_less > 
exset
typedef std::map< GiNaC::ex,
int, GiNaC::ex_is_less > 
ex_int_map
typedef std::pair< unsigned
int, unsigned int > 
pair_ii
typedef std::vector< std::pair
< unsigned int, unsigned int > > 
vector_ii

Enumerations

enum  Repr_format { SUBS_PERFORMED = 1, SUBS_NOT_PERFORMED = 2 }

Functions

GiNaC::ex div (GiNaC::ex v)
GiNaC::ex div (GiNaC::ex v, GiNaC::ex G)
GiNaC::ex div (GiNaC::lst &v)
GiNaC::ex div (GiNaC::lst &v, GiNaC::ex G)
GiNaC::ex div (GiNaC::exvector &v)
GiNaC::ex grad (GiNaC::ex f)
GiNaC::ex grad (GiNaC::ex f, GiNaC::ex G)
void usage (FE &fe)
void usage (FE &v_fe, FE &p_fe)
void compute_Poisson_element_matrix (FE &fe, Dof &dof, std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > &A)
void compute_Stokes_element_matrix (FE &v_fe, FE &p_fe, Dof &dof, std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > &A)
void compute_mixed_Poisson_element_matrix (FE &v_fe, FE &p_fe, Dof &dof, std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > &A)
GiNaC::lst cross (GiNaC::lst &v1, GiNaC::lst &v2)
GiNaC::ex inner (GiNaC::ex a, GiNaC::ex b, bool transposed)
GiNaC::ex inner (GiNaC::lst v1, GiNaC::lst v2)
GiNaC::ex inner (GiNaC::exvector &v1, GiNaC::exvector &v2)
GiNaC::lst matvec (GiNaC::matrix &M, GiNaC::lst &x)
GiNaC::ex matvec (GiNaC::ex A, GiNaC::ex x)
GiNaC::lst ex2equations (GiNaC::ex rel)
GiNaC::lst collapse (GiNaC::lst l)
GiNaC::matrix equations2matrix (const GiNaC::ex &eqns, const GiNaC::ex &symbols)
void matrix_from_equations (const GiNaC::ex &eqns, const GiNaC::ex &symbols, GiNaC::matrix &A, GiNaC::matrix &b)
GiNaC::ex lst_to_matrix2 (const GiNaC::lst &l)
GiNaC::lst matrix_to_lst2 (const GiNaC::ex &m)
GiNaC::lst lst_equals (GiNaC::ex a, GiNaC::ex b)
int find (GiNaC::ex e, GiNaC::lst list)
void visitor_subst_pow (GiNaC::ex e, GiNaC::exmap &map, ex_int_map &intmap, string a)
void check_visitor (GiNaC::ex e, GiNaC::lst &exlist)
GiNaC::ex homogenous_pol (unsigned int order, unsigned int nsd, const string a)
GiNaC::lst homogenous_polv (unsigned int no_fields, unsigned int order, unsigned int nsd, const string a)
GiNaC::ex pol (unsigned int order, unsigned int nsd, const string a)
GiNaC::lst polv (unsigned int no_fields, unsigned int order, unsigned int nsd, const string a)
GiNaC::ex polb (unsigned int order, unsigned int nsd, const string a)
GiNaC::lst coeffs (GiNaC::lst pols)
GiNaC::lst coeffs (GiNaC::ex pol)
GiNaC::exvector coeff (GiNaC::ex pol)
GiNaC::exmap pol2basisandcoeff (GiNaC::ex e, GiNaC::ex s)
GiNaC::exmap pol2basisandcoeff (GiNaC::ex e)
GiNaC::ex legendre1D (const GiNaC::symbol x, unsigned int n)
GiNaC::ex legendre (unsigned int order, unsigned int nsd, const string s)
GiNaC::lst legendrev (unsigned int no_fields, unsigned int order, unsigned int nsd, const string a)
bool compare (const ex &e, const string &s)
void EQUAL_OR_DIE (const ex &e, const string &s)
exhashmap< int > count_symbols (const ex &e)
ex extract_symbols (const ex &e)
void collect_symbols (const GiNaC::ex &e, exset &v)
GiNaC::exvector collect_symbols (const GiNaC::ex &e)
bool compare_archives (const string &first, const string &second, std::ostream &os)
ExStats count_ops (const ex &e)
ex replace_powers (const ex &ein, const list< symbol > &symbols, list< symexpair > &sel, const string &tmpsymbolprefix)
bool compare (const GiNaC::ex &e, const std::string &s)
void EQUAL_OR_DIE (const GiNaC::ex &e, const std::string &s)
bool compare_archives (const std::string &first, const std::string &second, std::ostream &os=std::cout)
void visitor_subst_pow (GiNaC::ex e, GiNaC::exmap &map, ex_int_map &intmap, std::string a)
GiNaC::ex pol (unsigned int order, unsigned int nsd, const std::string a)
GiNaC::lst polv (unsigned int no_fields, unsigned int order, unsigned int nsd, const std::string a)
GiNaC::ex polb (unsigned int order, unsigned int nsd, const std::string a)
GiNaC::ex homogenous_pol (unsigned int order, unsigned int nsd, const std::string a)
GiNaC::lst homogenous_polv (unsigned int no_fields, unsigned int order, unsigned int nsd, const std::string a)
GiNaC::ex legendre (unsigned int order, unsigned int nsd, const std::string a)
GiNaC::lst legendrev (unsigned int no_fields, unsigned int order, unsigned int nsd, const std::string a)
GiNaC::exhashmap< int > count_symbols (const GiNaC::ex &e)
GiNaC::ex extract_symbols (const GiNaC::ex &e)
ExStats count_ops (const GiNaC::ex &e)
GiNaC::ex replace_powers (const GiNaC::ex &e, const std::list< GiNaC::symbol > &symbols, std::list< symexpair > &sel, const std::string &tmpsymbolprefix="p_")
GiNaC::ex lagrange (unsigned int order, Polygon &p, const std::string &a)
GiNaC::lst lagrangev (unsigned int no_fields, unsigned int order, Polygon &p, const std::string &a)
std::ostream & operator<< (std::ostream &os, const OrderedPtvSet &p)
std::ostream & operator<< (std::ostream &os, const OrderedPtvSet_i &p)
lst bezier_ordinates (Tetrahedron &tetrahedra, unsigned int d)
lst interior_coordinates (Tetrahedron &tetrahedra, unsigned int d)
lst bezier_ordinates (Triangle &triangle, unsigned int d)
lst interior_coordinates (Triangle &triangle, unsigned int d)
lst bezier_ordinates (Line &line, unsigned int d)
lst interior_coordinates (Line &line, unsigned int d)
ex barycenter_line (ex p0, ex p1)
ex barycenter_triangle (ex p0, ex p1, ex p2)
ex barycenter_tetrahedron (ex p0, ex p1, ex p2, ex p3)
ex barycenter (Simplex &simplex)
ex bernstein (unsigned int order, Polygon &p, const string &a)
lst bernsteinv (unsigned int no_fields, unsigned int order, Polygon &p, const string &a)
lst normal (Tetrahedron &tetrahedron, unsigned int i)
lst normal (Triangle &triangle, unsigned int i)
lst tangent (Triangle &triangle, unsigned int i)
GiNaC::ex barycenter_line (GiNaC::ex p0, GiNaC::ex p1)
GiNaC::ex barycenter_triangle (GiNaC::ex p0, GiNaC::ex p1, GiNaC::ex p2)
GiNaC::ex barycenter_tetrahedron (GiNaC::ex p0, GiNaC::ex p1, GiNaC::ex p2, GiNaC::ex p3)
GiNaC::ex bernstein (unsigned int order, Polygon &p, const std::string &a)
GiNaC::lst bernsteinv (unsigned int no_fields, unsigned int order, Polygon &p, const std::string &a)
void sort_vector (vector< Ptv > &a)
void set_tolerance (double tolerance)
double mul (const Ptv &a, const Ptv &b)
double norm (const Ptv &a)
void normalize (Ptv &a)
void add (const Ptv &a, const Ptv &b, Ptv &c)
void sub (const Ptv &a, const Ptv &b, Ptv &c)
void cross (const Ptv &a, const Ptv &b, Ptv &c)
bool is_equal (Ptv &a, Ptv &b)
bool line_contains (Ptv &e0, Ptv &e1, Ptv &p)
bool is_inside_triangle (Ptv &e0, Ptv &e1, Ptv &e2, Ptv &p)
bool contains2D (Ptv &e0, Ptv &e1, Ptv &p)
bool contains3D (Ptv &e0, Ptv &e1, Ptv &e2, Ptv &p)
def swig_import_helper
def _swig_setattr_nondynamic
def _swig_setattr
def _swig_getattr
def _swig_repr
def _swig_setattr_nondynamic_method
def setDigits
def dirac
def int2string
def istr
def lst2string
def div
def grad
def compare
def EQUAL_OR_DIE
def compare_archives
def inner
def cross
def matvec
def ex2equations
def collapse
def equations2matrix
def matrix_from_equations
def lst_to_matrix2
def matrix_to_lst2
def lst_equals
def find
def check_visitor
def visitor_subst_pow
def pol
def polv
def polb
def homogenous_pol
def homogenous_polv
def legendre
def legendrev
def coeff
def coeffs
def pol2basisandcoeff
def collect_symbols
def count_symbols
def extract_symbols
def count_ops
def replace_powers
def initSyFi
def symbol_exists
def get_symbol
def isymb
def get_symbolic_vector
def get_symbolic_matrix
def barycenter_line
def barycenter_triangle
def barycenter_tetrahedron
def barycenter
def bezier_ordinates
def interior_coordinates
def bernstein
def bernsteinv
def normal
def tangent
def lagrange
def lagrangev
def usage
def compute_Poisson_element_matrix
def compute_Stokes_element_matrix
def compute_mixed_Poisson_element_matrix
GiNaC::symbol x ("(x is not initialized since initSyFi has never been called)")
GiNaC::symbol y ("(y is not initialized since initSyFi has never been called)")
GiNaC::symbol z ("(z is not initialized since initSyFi has never been called)")
GiNaC::symbol t ("(t is not initialized since initSyFi has never been called)")
GiNaC::symbol infinity ("(infinity is not initialized since initSyFi has never been called)")
GiNaC::symbol DUMMY ("(DUMMY is not initialized since initSyFi has never been called)")
void initSyFi (unsigned int nsd_)
bool symbol_exists (const string &name)
const symbol & get_symbol (const string &name)
const symbol & isymb (const string &a, int b)
const symbol & isymb (const string &a, int b, int c)
GiNaC::ex get_symbolic_vector (int m, const std::string &basename)
GiNaC::ex get_symbolic_matrix (int m, int n, const std::string &basename)
bool symbol_exists (const std::string &name)
const GiNaC::symbol & get_symbol (const std::string &name)
const GiNaC::symbol & isymb (const std::string &a, int b)
const GiNaC::symbol & isymb (const std::string &a, int b, int c)
int dirac (unsigned int i, unsigned int j)
string int2string (int i)
string istr (const string &a, int b)
string istr (const string &a, int b, int c)
string lst2string (GiNaC::lst &l)
string exvector2string (GiNaC::exvector &v)
void print (GiNaC::lst &l)
void print (GiNaC::exvector &v)
void print (std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > &A)
void print (ex_int_map map)
void print (GiNaC::exmap map)
std::string istr (const std::string &a, int b)
std::string istr (const std::string &a, int b, int c)

Variables

tuple new_instancemethod = lambdafunc,inst,cls:_SyFi.SWIG_PyInstanceMethod_New(func)
tuple _SyFi = swig_import_helper()
int _newclass = 0
 GINACLIB_MAJOR_VERSION = _SyFi.GINACLIB_MAJOR_VERSION
 GINACLIB_MINOR_VERSION = _SyFi.GINACLIB_MINOR_VERSION
 GINACLIB_MICRO_VERSION = _SyFi.GINACLIB_MICRO_VERSION
 SwigPyIterator_swigregister = _SyFi.SwigPyIterator_swigregister
 exvector_swigregister = _SyFi.exvector_swigregister
 exmap_swigregister = _SyFi.exmap_swigregister
 ex_int_map_swigregister = _SyFi.ex_int_map_swigregister
 symexpair_swigregister = _SyFi.symexpair_swigregister
 symexlist_swigregister = _SyFi.symexlist_swigregister
 exlist_swigregister = _SyFi.exlist_swigregister
 exset_swigregister = _SyFi.exset_swigregister
 ExStats_swigregister = _SyFi.ExStats_swigregister
 cvar = _SyFi.cvar
 version_major = cvar.version_major
 version_minor = cvar.version_minor
 Polygon_swigregister = _SyFi.Polygon_swigregister
 Line_swigregister = _SyFi.Line_swigregister
 ReferenceLine_swigregister = _SyFi.ReferenceLine_swigregister
 Triangle_swigregister = _SyFi.Triangle_swigregister
 ReferenceTriangle_swigregister = _SyFi.ReferenceTriangle_swigregister
 Rectangle_swigregister = _SyFi.Rectangle_swigregister
 ReferenceRectangle_swigregister = _SyFi.ReferenceRectangle_swigregister
 Tetrahedron_swigregister = _SyFi.Tetrahedron_swigregister
 ReferenceTetrahedron_swigregister = _SyFi.ReferenceTetrahedron_swigregister
 Box_swigregister = _SyFi.Box_swigregister
 ReferenceBox_swigregister = _SyFi.ReferenceBox_swigregister
 Simplex_swigregister = _SyFi.Simplex_swigregister
 FE_swigregister = _SyFi.FE_swigregister
 StandardFE_swigregister = _SyFi.StandardFE_swigregister
 Lagrange_swigregister = _SyFi.Lagrange_swigregister
 VectorLagrange_swigregister = _SyFi.VectorLagrange_swigregister
 TensorLagrange_swigregister = _SyFi.TensorLagrange_swigregister
 Dof_swigregister = _SyFi.Dof_swigregister
 CrouzeixRaviart_swigregister = _SyFi.CrouzeixRaviart_swigregister
 VectorCrouzeixRaviart_swigregister = _SyFi.VectorCrouzeixRaviart_swigregister
 P0_swigregister = _SyFi.P0_swigregister
 VectorP0_swigregister = _SyFi.VectorP0_swigregister
 TensorP0_swigregister = _SyFi.TensorP0_swigregister
 RaviartThomas_swigregister = _SyFi.RaviartThomas_swigregister
 DiscontinuousLagrange_swigregister = _SyFi.DiscontinuousLagrange_swigregister
 VectorDiscontinuousLagrange_swigregister = _SyFi.VectorDiscontinuousLagrange_swigregister
 Hermite_swigregister = _SyFi.Hermite_swigregister
 Nedelec_swigregister = _SyFi.Nedelec_swigregister
 Nedelec2Hdiv_swigregister = _SyFi.Nedelec2Hdiv_swigregister
 Bubble_swigregister = _SyFi.Bubble_swigregister
 ArnoldFalkWintherWeakSymSigma_swigregister = _SyFi.ArnoldFalkWintherWeakSymSigma_swigregister
 ArnoldFalkWintherWeakSymU_swigregister = _SyFi.ArnoldFalkWintherWeakSymU_swigregister
 ArnoldFalkWintherWeakSymP_swigregister = _SyFi.ArnoldFalkWintherWeakSymP_swigregister
 Robust_swigregister = _SyFi.Robust_swigregister
 MixedFE_swigregister = _SyFi.MixedFE_swigregister
 SpaceTimeDomain_swigregister = _SyFi.SpaceTimeDomain_swigregister
 SpaceTimeElement_swigregister = _SyFi.SpaceTimeElement_swigregister
unsigned int nsd = 2
GiNaC::lst p
map< string, symbol > symbol_collection
GiNaC::symbol x
GiNaC::symbol y
GiNaC::symbol z
GiNaC::symbol t
GiNaC::symbol infinity
GiNaC::symbol DUMMY
const char * version_micro = SYFILIB_MICRO_VERSION

Typedef Documentation

typedef std::map<GiNaC::ex, int, GiNaC::ex_is_less> SyFi::ex_int_map

Definition at line 40 of file containers.h.

typedef std::list<GiNaC::ex> SyFi::exlist

Definition at line 37 of file containers.h.

typedef std::set<GiNaC::ex, GiNaC::ex_is_less> SyFi::exset

Definition at line 38 of file containers.h.

typedef std::pair<unsigned int, unsigned int> SyFi::pair_ii

Definition at line 32 of file Dof.h.

typedef std::list< std::pair<GiNaC::symbol, GiNaC::ex> > SyFi::symexlist

Definition at line 34 of file containers.h.

typedef std::pair<GiNaC::symbol, GiNaC::ex> SyFi::symexpair

Definition at line 33 of file containers.h.

typedef std::vector< std::pair<unsigned int, unsigned int> > SyFi::vector_ii

Definition at line 33 of file Dof.h.


Enumeration Type Documentation

Enumerator:
SUBS_PERFORMED 
SUBS_NOT_PERFORMED 

Definition at line 27 of file Polygon.h.


Function Documentation

def SyFi._swig_getattr (   self,
  class_type,
  name 
) [private]

Definition at line 55 of file SyFi.py.

00055 
00056 def _swig_getattr(self,class_type,name):
00057     if (name == "thisown"): return self.this.own()
00058     method = class_type.__swig_getmethods__.get(name,None)
00059     if method: return method(self)
00060     raise AttributeError(name)

def SyFi._swig_repr (   self) [private]

Definition at line 61 of file SyFi.py.

00061 
00062 def _swig_repr(self):
00063     try: strthis = "proxy of " + self.this.__repr__()
00064     except: strthis = ""
00065     return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
00066 
00067 try:
00068     _object = object
    _newclass = 1
def SyFi._swig_setattr (   self,
  class_type,
  name,
  value 
) [private]

Definition at line 52 of file SyFi.py.

References _swig_setattr_nondynamic().

00052 
00053 def _swig_setattr(self,class_type,name,value):
00054     return _swig_setattr_nondynamic(self,class_type,name,value,0)

def SyFi._swig_setattr_nondynamic (   self,
  class_type,
  name,
  value,
  static = 1 
) [private]

Definition at line 39 of file SyFi.py.

Referenced by _swig_setattr().

00039 
00040 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
00041     if (name == "thisown"): return self.this.own(value)
00042     if (name == "this"):
00043         if type(value).__name__ == 'SwigPyObject':
00044             self.__dict__[name] = value
00045             return
00046     method = class_type.__swig_setmethods__.get(name,None)
00047     if method: return method(self,value)
00048     if (not static):
00049         self.__dict__[name] = value
00050     else:
00051         raise AttributeError("You cannot add attributes to %s" % self)

def SyFi._swig_setattr_nondynamic_method (   set) [private]

Definition at line 74 of file SyFi.py.

00074 
00075 def _swig_setattr_nondynamic_method(set):
00076     def set_attr(self,name,value):
00077         if (name == "thisown"): return self.this.own(value)
00078         if hasattr(self,name) or (name == "this"):
00079             set(self,name,value)
00080         else:
00081             raise AttributeError("You cannot add attributes to %s" % self)
00082     return set_attr
00083 
00084 

void SyFi::add ( const Ptv a,
const Ptv b,
Ptv c 
)

Definition at line 76 of file Ptv_tools.cpp.

References Ptv::redim(), and Ptv::size().

Referenced by ex2type().

        {
                if ( a.size() != b.size() )
                {
                        throw(std::logic_error("Exception from add(const Ptv&, const Ptv&, Ptv&):  The dimentions of a and b must be the same."));
                }

                c.redim(a.size());
                for (unsigned int i=0; i< c.size(); i++)
                {
                        c[i] = a[i] + b[i];
                }
        }
GiNaC::ex SyFi::barycenter ( Simplex &  simplex)

Definition at line 1768 of file Polygon.cpp.

References get_symbolic_vector(), SyFi::Polygon::no_vertices(), nsd, and SyFi::Polygon::vertex().

Referenced by _wrap_barycenter(), barycenter(), and main().

        {
                if (nsd != simplex.no_vertices()-1)
                {
                        throw std::runtime_error("Could not compute the barycentric coordinates. Not implemented yet for simplices with no_vertices != nsd +1.");
                }

                // put symbols in lst
                ex b = get_symbolic_vector(simplex.no_vertices(), "b");
                lst symbols;
                for (unsigned int i=0; i<b.nops(); i++)
                {
                        symbols.append(b.op(i));
                }

                // put equations in lst
                lst eqs;
                for (unsigned int i=0; i<nsd; i++)
                {
                        ex sum = 0;
                        for (unsigned int k=0; k< simplex.no_vertices(); k++)
                        {
                                sum += b.op(k)*simplex.vertex(k).op(i);
                        }
                        ex eqi = p[i] == sum;
                        eqs.append(eqi);
                }

                // last eq, sum = 1
                ex sum = 0;
                for (unsigned int i=0; i<symbols.nops(); i++)
                {
                        sum += symbols.op(i);
                }
                ex last_eq = 1 == sum;
                eqs.append(last_eq);

                // solve equations
                ex sol = lsolve(eqs, symbols);
                return sol;
        }
def SyFi.barycenter (   args)
barycenter(Simplex simplex) -> GiNaC::ex

Definition at line 1988 of file SyFi.py.

References barycenter().

01988 
01989 def barycenter(*args):
01990   """barycenter(Simplex simplex) -> GiNaC::ex"""
01991   return _SyFi.barycenter(*args)

GiNaC::ex SyFi::barycenter_line ( GiNaC::ex  p0,
GiNaC::ex  p1 
)
ex SyFi::barycenter_line ( ex  p0,
ex  p1 
)

Definition at line 1623 of file Polygon.cpp.

References x.

Referenced by _wrap_barycenter_line(), barycenter_line(), and bernstein().

        {
                ex sol;

                // 1D
                if (!GiNaC::is_a<lst>(p0))
                {
                        GiNaC::symbol b0("b0"), b1("b1");
                        ex eq1 = x == b0*p0 + b1*p1;
                        ex eq2 = 1 == b0 + b1;
                        sol = lsolve(lst(eq1, eq2), lst(b0, b1));
                }
                else if (p0.nops() == 1 && p1.nops() == 1)
                {
                        GiNaC::symbol b0("b0"), b1("b1");
                        ex eq1 = x == b0*p0.op(0) + b1*p1.op(0);
                        ex eq2 = 1 == b0 + b1;
                        sol = lsolve(lst(eq1, eq2), lst(b0, b1));
                        if ( sol == 0 )
                        {
                                ex eq1 = y == b0*p0.op(1) + b1*p1.op(1);
                                sol = lsolve(lst(eq1, eq2), lst(b0, b1));
                        }
                        if ( sol == 0 )
                        {
                                ex eq1 = z == b0*p0.op(2) + b1*p1.op(2);
                                sol = lsolve(lst(eq1, eq2), lst(b0, b1));
                        }
                }
                //2D
                else if ( p0.nops() == 2 && p1.nops() == 2 )
                {
                        GiNaC::symbol b0("b0"), b1("b1");
                        ex eq1 = x == b0*p0.op(0) + b1*p1.op(0);
                        ex eq3 = 1 == b0 + b1;
                        sol = lsolve(lst(eq1, eq3), lst(b0, b1));
                        if (sol.nops() == 0)
                        {
                                ex eq2 = y == b0*p0.op(1) + b1*p1.op(1);
                                sol = lsolve(lst(eq2, eq3), lst(b0, b1));
                        }
                }
                //3D
                else if ( p0.nops() == 3 && p1.nops() == 3 )
                {
                        GiNaC::symbol b0("b0"), b1("b1");
                        ex eq1 = x == b0*p0.op(0) + b1*p1.op(0);
                        ex eq4 = 1 == b0 + b1;
                        sol = lsolve(lst(eq1, eq4), lst(b0, b1));
                        if (sol.nops() == 0)
                        {
                                ex eq2 = y == b0*p0.op(1) + b1*p1.op(1);
                                sol = lsolve(lst(eq2, eq4), lst(b0, b1));
                        }
                        if (sol.nops() == 0)
                        {
                                ex eq3 = z == b0*p0.op(2) + b1*p1.op(2);
                                sol = lsolve(lst(eq3, eq4), lst(b0, b1));
                        }
                }
                else
                {
                        throw std::runtime_error("Could not compute the barycentric coordinates. Check the coordinates.");
                }

                return sol;
        }
def SyFi.barycenter_line (   args)
barycenter_line(GiNaC::ex p0, GiNaC::ex p1) -> GiNaC::ex

Definition at line 1976 of file SyFi.py.

References barycenter_line().

01976 
01977 def barycenter_line(*args):
01978   """barycenter_line(GiNaC::ex p0, GiNaC::ex p1) -> GiNaC::ex"""
01979   return _SyFi.barycenter_line(*args)

GiNaC::ex SyFi::barycenter_tetrahedron ( GiNaC::ex  p0,
GiNaC::ex  p1,
GiNaC::ex  p2,
GiNaC::ex  p3 
)
ex SyFi::barycenter_tetrahedron ( ex  p0,
ex  p1,
ex  p2,
ex  p3 
)

Definition at line 1752 of file Polygon.cpp.

References x.

Referenced by _wrap_barycenter_tetrahedron(), barycenter_tetrahedron(), barycenter_triangle(), bernstein(), and SyFi::Bubble::compute_basis_functions().

        {
                GiNaC::symbol b0("b0"), b1("b1"), b2("b2"), b3("b3");

                // 3D
                ex eq1 = x == b0*p0.op(0) + b1*p1.op(0) + b2*p2.op(0) + b3*p3.op(0);
                ex eq2 = y == b0*p0.op(1) + b1*p1.op(1) + b2*p2.op(1) + b3*p3.op(1);
                ex eq3 = z == b0*p0.op(2) + b1*p1.op(2) + b2*p2.op(2) + b3*p3.op(2);
                ex eq4 = 1 == b0 + b1 + b2 +b3;

                ex sol = lsolve(lst(eq1, eq2, eq3, eq4), lst(b0, b1, b2, b3));

                return sol;

        }
barycenter_tetrahedron(GiNaC::ex p0, GiNaC::ex p1, GiNaC::ex p2, GiNaC::ex p3) -> GiNaC::ex

Definition at line 1984 of file SyFi.py.

References barycenter_tetrahedron().

01984 
01985 def barycenter_tetrahedron(*args):
01986   """barycenter_tetrahedron(GiNaC::ex p0, GiNaC::ex p1, GiNaC::ex p2, GiNaC::ex p3) -> GiNaC::ex"""
01987   return _SyFi.barycenter_tetrahedron(*args)

GiNaC::ex SyFi::barycenter_triangle ( GiNaC::ex  p0,
GiNaC::ex  p1,
GiNaC::ex  p2 
)
ex SyFi::barycenter_triangle ( ex  p0,
ex  p1,
ex  p2 
)

Definition at line 1691 of file Polygon.cpp.

References barycenter_tetrahedron(), cross(), and x.

Referenced by _wrap_barycenter_triangle(), barycenter_triangle(), bernstein(), and SyFi::Bubble::compute_basis_functions().

        {
                ex sol;

                // 2D
                if ( p0.nops() == 2 && p1.nops() == 2 && p2.nops() == 2)
                {
                        GiNaC::symbol b0("b0"), b1("b1"), b2("b2");
                        ex eq1 = x == b0*p0.op(0) + b1*p1.op(0) + b2*p2.op(0);
                        ex eq2 = y == b0*p0.op(1) + b1*p1.op(1) + b2*p2.op(1);
                        ex eq3 = 1 == b0 + b1 + b2;

                        sol = lsolve(lst(eq1, eq2, eq3), lst(b0, b1, b2));
                }
                // 3D
                else if ( p0.nops() == 3 && p1.nops() == 3 && p2.nops() == 3)
                {
                        lst n1(p1.op(0) - p0.op(0),  p1.op(1) - p0.op(1), p1.op(2) - p0.op(2));
                        lst n2 = lst(p2.op(0) - p0.op(0),  p2.op(1) - p0.op(1), p2.op(2) - p0.op(2));
                        lst n = cross(n1,n2);

                        lst midpoint = lst((p0.op(0) + p1.op(0) + p2.op(0))/3,
                                (p0.op(1) + p1.op(1) + p2.op(1))/3,
                                (p0.op(2) + p1.op(2) + p2.op(2))/3);

                        ex p3 = lst(midpoint.op(0) + n.op(0),
                                midpoint.op(1) + n.op(1),
                                midpoint.op(2) + n.op(2));

                        ex s = barycenter_tetrahedron(p0, p1, p2, p3);
                        lst solution;
                        for (unsigned int i=0; i<s.nops(); i++)
                        {
                                ex d = s.op(i).subs(x == p3.op(0)).subs(y == p3.op(1)).subs(z == p3.op(2));
                                d = d.rhs();
                                if ( GiNaC::is_a<GiNaC::numeric>(d))
                                {
                                                                 // FIXME: bad test, should use the toleranse variable set by CLN or something
                                        if ( GiNaC::abs(GiNaC::ex_to<GiNaC::numeric>(d)) < 10e-8)
                                        {
                                                solution.append(s.op(i));
                                        }
                                }
                                else
                                {
                                        if ( d.is_zero() )
                                        {
                                                solution.append(s.op(i));
                                        }
                                }
                        }
                        sol = solution;
                }
                else
                {
                        throw std::runtime_error("Could not compute the barycentric coordinates. Check the coordinates.");
                }

                return sol;
        }
def SyFi.barycenter_triangle (   args)
barycenter_triangle(GiNaC::ex p0, GiNaC::ex p1, GiNaC::ex p2) -> GiNaC::ex

Definition at line 1980 of file SyFi.py.

References barycenter_triangle().

01980 
01981 def barycenter_triangle(*args):
01982   """barycenter_triangle(GiNaC::ex p0, GiNaC::ex p1, GiNaC::ex p2) -> GiNaC::ex"""
01983   return _SyFi.barycenter_triangle(*args)

GiNaC::ex SyFi::bernstein ( unsigned int  order,
Polygon &  p,
const std::string &  a 
)
ex SyFi::bernstein ( unsigned int  order,
Polygon &  p,
const string &  a 
)

Definition at line 1810 of file Polygon.cpp.

References barycenter_line(), barycenter_tetrahedron(), barycenter_triangle(), get_symbolic_matrix(), matrix_to_lst2(), SyFi::Polygon::str(), and SyFi::Polygon::vertex().

Referenced by _wrap_bernstein(), bernstein(), bernsteinv(), SyFi::Lagrange::compute_basis_functions(), SyFi::CrouzeixRaviart::compute_basis_functions(), SyFi::Nedelec::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), and main().

        {

                if ( order < 0 )
                {
                        throw(std::logic_error("Can not create polynomials of order less than 0!"));
                }

                ex ret;                                  // ex to return
                int dof;                                 // degrees of freedom
                ex A;                                    // ex holding the coefficients a_0 .. a_dof
                lst basis;

                if ( p.str().find("Line") != string::npos )
                {
                        ex bary = barycenter_line(p.vertex(0), p.vertex(1));
                        ex b0= bary.op(0).rhs();
                        ex b1= bary.op(1).rhs();
                        dof = order+1;
                        A = get_symbolic_matrix(1,dof, a);
                        int o=0;
                        for (GiNaC::const_iterator i = A.begin(); i != A.end(); ++i)
                        {
                                ex scale = GiNaC::binomial(order,o);
                                ret += (*i)*scale*pow(b0,o)*pow(b1,order-o);
                                basis.append(scale*pow(b0,o)*pow(b1,order-o));
                                o++;
                        }
                }
                else if ( p.str().find("Triangle") != string::npos )
                {

                        dof = (order+1)*(order+2)/2;
                        A = get_symbolic_matrix(1, dof , a);

                        ex bary = barycenter_triangle(p.vertex(0), p.vertex(1), p.vertex(2));
                        ex b0= bary.op(0).rhs();
                        ex b1= bary.op(1).rhs();
                        ex b2= bary.op(2).rhs();

                        size_t i=0;
                        for (unsigned int o1 = 0; o1 <= order; o1++)
                        {
                                for (unsigned int o2 = 0; o2 <= order; o2++)
                                {
                                        for (unsigned int o3 = 0; o3 <= order; o3++)
                                        {
                                                if ( o1 + o2 + o3 == order )
                                                {
                                                        ex scale = (GiNaC::factorial(order)/(GiNaC::factorial(o1)*GiNaC::factorial(o2)*GiNaC::factorial(o3)));
                                                        ret += A.op(i)*scale*pow(b0,o1)*pow(b1,o2)*pow(b2,o3);

                                                        basis.append(scale*pow(b0,o1)*pow(b1,o2)*pow(b2,o3));
                                                        i++;
                                                }
                                        }
                                }
                        }
                }

                else if ( p.str().find("Tetrahedron") != string::npos )
                {

                        dof = 0;
                        for (unsigned int j=0; j<= order; j++)
                        {
                                dof += (j+1)*(j+2)/2;
                        }
                        A = get_symbolic_matrix(1, dof , a);

                        ex bary = barycenter_tetrahedron(p.vertex(0), p.vertex(1), p.vertex(2), p.vertex(3));
                        ex b0= bary.op(0).rhs();
                        ex b1= bary.op(1).rhs();
                        ex b2= bary.op(2).rhs();
                        ex b3= bary.op(3).rhs();

                        size_t i=0;
                        for (unsigned int o1 = 0; o1 <= order; o1++)
                        {
                                for (unsigned int o2 = 0; o2 <= order; o2++)
                                {
                                        for (unsigned int o3 = 0; o3 <= order; o3++)
                                        {
                                                for (unsigned int o4 = 0; o4 <= order; o4++)
                                                {
                                                        if ( o1 + o2 + o3 + o4 == order )
                                                        {
                                                                ex scale = (GiNaC::factorial(order)/(GiNaC::factorial(o1)*GiNaC::factorial(o2)*GiNaC::factorial(o3)*GiNaC::factorial(o4)));
                                                                ret += A.op(i)*scale*pow(b0,o1)*pow(b1,o2)*pow(b2,o3)*pow(b3,o4);
                                                                basis.append(scale*pow(b0,o1)*pow(b1,o2)*pow(b2,o3)*pow(b3,o4));
                                                                i++;
                                                        }
                                                }
                                        }
                                }
                        }
                }

                else if (p.str() == "Simplex" || p.str() == "ReferenceSimplex")
                {

                        throw std::runtime_error("Not implemented yet.");
                        //      ex bary = barycenter(p);
                }
                return lst(ret,matrix_to_lst2(A),basis);
        }
def SyFi.bernstein (   args)
bernstein(unsigned int order, Polygon p, std::string const & a) -> GiNaC::ex

Definition at line 2008 of file SyFi.py.

References bernstein().

02008 
02009 def bernstein(*args):
02010   """bernstein(unsigned int order, Polygon p, std::string const & a) -> GiNaC::ex"""
02011   return _SyFi.bernstein(*args)

GiNaC::lst SyFi::bernsteinv ( unsigned int  no_fields,
unsigned int  order,
Polygon &  p,
const std::string &  a 
)
lst SyFi::bernsteinv ( unsigned int  no_fields,
unsigned int  order,
Polygon &  p,
const string &  a 
)

Definition at line 1917 of file Polygon.cpp.

References bernstein(), pol(), and SyFi::Polygon::str().

Referenced by _wrap_bernsteinv(), bernsteinv(), SyFi::Nedelec::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), and SyFi::Robust::compute_basis_functions_old().

        {

                if ( order < 0 )
                {
                        throw(std::logic_error("Can not create polynomials of order less than 0!"));
                }

                lst ret1;                                // contains the polynom
                lst ret2;                                // contains the coefficients
                lst ret3;                                // constains the basis functions
                lst basis_tmp;
                for (unsigned int i=0; i< no_fields; i++)
                {
                        lst basis;
                        std::ostringstream s;
                        s <<a<<""<<i<<"_";
                        ex pol = bernstein(order, p, s.str());
                        ret1.append(pol.op(0));
                        ret2.append(pol.op(1));
                        basis_tmp = ex_to<lst>(pol.op(2));
                        for (lst::const_iterator basis_iterator = basis_tmp.begin();
                                basis_iterator != basis_tmp.end(); ++basis_iterator)
                        {
                                lst tmp_lst;
                                for (unsigned int d=1; d<=no_fields; d++) tmp_lst.append(0);
                                tmp_lst.let_op(i) = (*basis_iterator);
                                ret3.append(tmp_lst);
                        }
                }
                return lst(ret1,ret2,ret3);

        }
def SyFi.bernsteinv (   args)
bernsteinv(unsigned int no_fields, unsigned int order, Polygon p, std::string const & a) -> GiNaC::lst

Definition at line 2012 of file SyFi.py.

References bernsteinv().

02012 
02013 def bernsteinv(*args):
02014   """bernsteinv(unsigned int no_fields, unsigned int order, Polygon p, std::string const & a) -> GiNaC::lst"""
02015   return _SyFi.bernsteinv(*args)

GiNaC::lst SyFi::bezier_ordinates ( Tetrahedron &  tetrahedra,
unsigned int  d 
)

Definition at line 1392 of file Polygon.cpp.

References lst_to_matrix2(), matrix_to_lst2(), and SyFi::Polygon::vertex().

Referenced by _wrap_bezier_ordinates__SWIG_0(), _wrap_bezier_ordinates__SWIG_1(), _wrap_bezier_ordinates__SWIG_2(), bezier_ordinates(), SyFi::Lagrange::compute_basis_functions(), and main().

        {

                //FIXME: ugly conversion to matrix

                lst ret;
                ex V1 = tetrahedra.vertex(0);
                ex V2 = tetrahedra.vertex(1);
                ex V3 = tetrahedra.vertex(2);
                ex V4 = tetrahedra.vertex(3);

                lst V1l = ex_to<lst>(V1);
                lst V2l = ex_to<lst>(V2);
                lst V3l = ex_to<lst>(V3);
                lst V4l = ex_to<lst>(V4);

                ex V1m  = lst_to_matrix2(V1l);
                ex V2m  = lst_to_matrix2(V2l);
                ex V3m  = lst_to_matrix2(V3l);
                ex V4m  = lst_to_matrix2(V4l);

                int l;
                for (unsigned int i=0; i<= d; i++)
                {
                        for (unsigned int j=0; j<= d; j++)
                        {
                                for (unsigned int k=0; k<= d; k++)
                                {
                                        if ( d - i - j -k  >= 0 )
                                        {
                                                l= d - i - j -k;
                                                ex sum = (l*V1m + k*V2m + j*V3m + i*V4m)/d;
                                                ret.append(matrix_to_lst2(sum.evalm()));
                                        }
                                }
                        }
                }
                // FIXME how should these be sorted ?????
                //  ret = ret.sort();
                return ret;
        }
GiNaC::lst SyFi::bezier_ordinates ( Triangle &  triangle,
unsigned int  d 
)

Definition at line 1477 of file Polygon.cpp.

References lst_to_matrix2(), matrix_to_lst2(), and SyFi::Polygon::vertex().

        {

                //FIXME: ugly conversion to matrix

                lst ret;
                ex V1 = triangle.vertex(0);
                ex V2 = triangle.vertex(1);
                ex V3 = triangle.vertex(2);

                lst V1l = ex_to<lst>(V1);
                lst V2l = ex_to<lst>(V2);
                lst V3l = ex_to<lst>(V3);

                ex V1m  = lst_to_matrix2(V1l);
                ex V2m  = lst_to_matrix2(V2l);
                ex V3m  = lst_to_matrix2(V3l);

                int k;
                for (unsigned int i=0; i <= d; i++)
                {
                        for (unsigned int j=0; j <= d; j++)
                        {
                                if ( int(d) - int(i) - int(j) >= 0  )
                                {
                                        k = d - i - j;
                                        ex sum = (k*V1m + j*V2m + i*V3m)/d;
                                        ret.append(matrix_to_lst2(sum.evalm()));
                                }
                        }
                }
                // FIXME how should these be sorted ?????
                // ret = ret.sort();
                return ret;
        }
GiNaC::lst SyFi::bezier_ordinates ( Line &  line,
unsigned int  d 
)

Definition at line 1551 of file Polygon.cpp.

References lst_to_matrix2(), matrix_to_lst2(), and SyFi::Polygon::vertex().

        {

                lst ret;
                ex V1 = line.vertex(0);
                ex V2 = line.vertex(1);

                if (!GiNaC::is_a<lst>(V1))
                {
                        int k;
                        for (unsigned int i=0; i <= d; i++)
                        {
                                k = d - i;
                                ex sum = (k*V1 + i*V2)/d;
                                ret.append(sum);
                        }
                }
                else
                {

                        //FIXME: ugly conversion to matrix

                        lst V1l = ex_to<lst>(V1);
                        lst V2l = ex_to<lst>(V2);

                        ex V1m  = lst_to_matrix2(V1l);
                        ex V2m  = lst_to_matrix2(V2l);

                        int k;
                        for (unsigned int i=0; i <= d; i++)
                        {
                                k = d - i;
                                ex sum = (k*V1m + i*V2m)/d;
                                ret.append(matrix_to_lst2(sum.evalm()));
                        }
                        // FIXME how should these be sorted ?????
                        // ret = ret.sort();
                }
                return ret;
        }
def SyFi.bezier_ordinates (   args)
  bezier_ordinates(Line line, unsigned int d) -> GiNaC::lst
  bezier_ordinates(Triangle triangle, unsigned int d) -> GiNaC::lst
  bezier_ordinates(Tetrahedron tetrahedra, unsigned int d) -> GiNaC::lst
  

Definition at line 1992 of file SyFi.py.

References bezier_ordinates().

01992 
01993 def bezier_ordinates(*args):
01994   """
01995     bezier_ordinates(Line line, unsigned int d) -> GiNaC::lst
01996     bezier_ordinates(Triangle triangle, unsigned int d) -> GiNaC::lst
01997     bezier_ordinates(Tetrahedron tetrahedra, unsigned int d) -> GiNaC::lst
01998     """
01999   return _SyFi.bezier_ordinates(*args)

void SyFi::check_visitor ( GiNaC::ex  e,
GiNaC::lst &  exlist 
)

Definition at line 461 of file ginac_tools.cpp.

References find().

Referenced by _wrap_check_visitor(), and check_visitor().

{
        if (find(e, exlist) >= 0) return;

        //  cout <<"ex e "<<e<<endl;
        if (GiNaC::is_a<GiNaC::numeric>(e))
        {
        }
        else if (GiNaC::is_a<GiNaC::add>(e) )
        {
                //    cout <<"e "<<e <<endl;
                //    cout <<"e.nops() "<<e.nops() <<endl;
                if (e.nops() > 4 && e.nops() < 10 ) exlist.append(e);
                for (unsigned int i=0; i< e.nops(); i++)
                {
                        GiNaC::ex e2 = e.op(i);
                        //       cout <<"add e "<<e2<<endl;
                        //       exlist.append(e2);
                        check_visitor(e2,exlist);
                }
        }
        else if (GiNaC::is_a<GiNaC::mul>(e))
        {
                for (unsigned int i=0; i< e.nops(); i++)
                {
                        GiNaC::ex e2 = e.op(i);
                        //       cout <<"mul e "<<e2<<endl;
                        exlist.append(e2);
                        check_visitor(e2,exlist);
                }
        }
        else if (GiNaC::is_a<GiNaC::lst>(e))
        {
                for (unsigned int i=0; i< e.nops(); i++)
                {
                        GiNaC::ex e2 = e.op(i);
                        //       cout <<"GiNaC::lst e "<<e2<<endl;
                        //       exlist.append(e2);
                        check_visitor(e2,exlist);
                }
        }
        else if (GiNaC::is_exactly_a<GiNaC::power>(e))
        {
                exlist.append(e);
                for (unsigned int i=0; i< e.nops(); i++)
                {
                        GiNaC::ex e2 = e.op(i);
                        //       cout <<"power e "<<e2<<endl;
                        check_visitor(e2,exlist);
                }
        }
        else if (GiNaC::is_a<GiNaC::function>(e))
        {
                exlist.append(e);
                for (unsigned int i=0; i< e.nops(); i++)
                {
                        GiNaC::ex e2 = e.op(i);
                        //       cout <<"function e "<<e2<<endl;
                        check_visitor(e2,exlist);
                }
        }

        else
        {
                //       exlist.append(e);
                //    cout <<"atom e "<<e<<endl;
        }

        exlist.sort();
        exlist.unique();
}
def SyFi.check_visitor (   args)
check_visitor(GiNaC::ex e, GiNaC::lst & exlist)

Definition at line 1402 of file SyFi.py.

References check_visitor().

01402 
01403 def check_visitor(*args):
01404   """check_visitor(GiNaC::ex e, GiNaC::lst & exlist)"""
01405   return _SyFi.check_visitor(*args)

GiNaC::exvector SyFi::coeff ( GiNaC::ex  pol)

Definition at line 855 of file ginac_tools.cpp.

References test_syfi::debug::c, x, y, and z.

Referenced by _wrap_coeff(), coeff(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), and SyFi::Robust::compute_basis_functions_old().

{
        using SyFi::x;
        using SyFi::y;
        using SyFi::z;

        GiNaC::exvector cc;
        GiNaC::ex c, b;
        for (int i=pol.ldegree(x); i<=pol.degree(x); ++i)
        {
                for (int j=pol.ldegree(y); j<=pol.degree(y); ++j)
                {
                        for (int k=pol.ldegree(z); k<=pol.degree(z); ++k)
                        {
                                c = pol.coeff(x,i).coeff(y, j).coeff(z,k);
                                if ( c != 0 ) cc.insert(cc.begin(),c);
                        }
                }
        }
        return cc;
}
def SyFi.coeff (   args)
coeff(GiNaC::ex pol) -> GiNaC::exvector

Definition at line 1438 of file SyFi.py.

References coeff().

01438 
01439 def coeff(*args):
01440   """coeff(GiNaC::ex pol) -> GiNaC::exvector"""
01441   return _SyFi.coeff(*args)

GiNaC::lst SyFi::coeffs ( GiNaC::lst  pols)

Definition at line 819 of file ginac_tools.cpp.

References collapse().

Referenced by _wrap_coeffs__SWIG_0(), _wrap_coeffs__SWIG_1(), and coeffs().

{
        GiNaC::lst cc;
        GiNaC::lst tmp;
        for (unsigned int i=0; i<= pols.nops()-1; i++)
        {
                tmp = coeffs(pols.op(i));
                cc = collapse(GiNaC::lst(cc, tmp));
        }
        return cc;
}
GiNaC::lst SyFi::coeffs ( GiNaC::ex  pol)

Definition at line 832 of file ginac_tools.cpp.

References test_syfi::debug::c, x, y, and z.

{
        using SyFi::x;
        using SyFi::y;
        using SyFi::z;

        GiNaC::lst cc;
        GiNaC::ex c, b;
        for (int i=pol.ldegree(x); i<=pol.degree(x); ++i)
        {
                for (int j=pol.ldegree(y); j<=pol.degree(y); ++j)
                {
                        for (int k=pol.ldegree(z); k<=pol.degree(z); ++k)
                        {
                                c = pol.coeff(x,i).coeff(y, j).coeff(z,k);
                                if ( c != 0 ) cc.append(c);
                        }
                }
        }
        return cc;
}
def SyFi.coeffs (   args)
  coeffs(GiNaC::ex pol) -> GiNaC::lst
  coeffs(GiNaC::lst pols) -> GiNaC::lst
  

Definition at line 1442 of file SyFi.py.

References coeffs().

01442 
01443 def coeffs(*args):
01444   """
01445     coeffs(GiNaC::ex pol) -> GiNaC::lst
01446     coeffs(GiNaC::lst pols) -> GiNaC::lst
01447     """
01448   return _SyFi.coeffs(*args)

GiNaC::lst SyFi::collapse ( GiNaC::lst  l)

Definition at line 214 of file ginac_tools.cpp.

Referenced by _wrap_collapse(), coeffs(), collapse(), SyFi::Nedelec::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), and SyFi::Robust::compute_basis_functions_old().

        {
                GiNaC::lst lc;
                GiNaC::lst::const_iterator iter1, iter2;

                for (iter1 = l.begin(); iter1 != l.end(); ++iter1)
                {
                        if (GiNaC::is_a<GiNaC::lst>(*iter1))
                        {
                                for (iter2 = GiNaC::ex_to<GiNaC::lst>(*iter1).begin(); iter2 != GiNaC::ex_to<GiNaC::lst>(*iter1).end(); ++iter2)
                                {
                                        lc.append(*iter2);
                                }
                        }
                        else
                        {
                                lc.append(*iter1);
                        }
                }
                lc.sort();
                lc.unique();
                return lc;
        }
def SyFi.collapse (   args)
collapse(GiNaC::lst l) -> GiNaC::lst

Definition at line 1374 of file SyFi.py.

References collapse().

01374 
01375 def collapse(*args):
01376   """collapse(GiNaC::lst l) -> GiNaC::lst"""
01377   return _SyFi.collapse(*args)

void SyFi::collect_symbols ( const GiNaC::ex &  e,
exset &  v 
)

Definition at line 1234 of file ginac_tools.cpp.

References SyFi.exset::insert(), and test_syfi::debug::v.

Referenced by _wrap_collect_symbols__SWIG_0(), _wrap_collect_symbols__SWIG_1(), and collect_symbols().

{
        if (GiNaC::is_a<GiNaC::symbol>(e))
        {
                v.insert(e);
        }
        else
        {
                for (size_t i=0; i<e.nops(); i++)
                {
                        collect_symbols(e.op(i), v);
                }
        }
}
GiNaC::exvector SyFi::collect_symbols ( const GiNaC::ex &  e)

Definition at line 1250 of file ginac_tools.cpp.

References SyFi.exset::begin(), collect_symbols(), SyFi.exset::end(), SyFi.exset::size(), and test_syfi::debug::v.

{
        exset s;
        collect_symbols(e, s);
        GiNaC::exvector v(s.size());
        for(exset::iterator i=s.begin(); i!= s.end(); i++)
        {
                v.push_back(*i);
        }
        return v;
}
def SyFi.collect_symbols (   args)
  collect_symbols(GiNaC::ex const & e, exset v)
  collect_symbols(GiNaC::ex const & e) -> GiNaC::exvector
  

Definition at line 1456 of file SyFi.py.

References collect_symbols().

01456 
01457 def collect_symbols(*args):
01458   """
01459     collect_symbols(GiNaC::ex const & e, exset v)
01460     collect_symbols(GiNaC::ex const & e) -> GiNaC::exvector
01461     """
01462   return _SyFi.collect_symbols(*args)

bool SyFi::compare ( const GiNaC::ex &  e,
const std::string &  s 
)
bool SyFi::compare ( const ex &  e,
const string &  s 
)

Definition at line 1087 of file ginac_tools.cpp.

Referenced by _wrap_compare(), compare(), EQUAL_OR_DIE(), and SWIG_MangledTypeQueryModule().

{
        ostringstream ss;
        ss << e;
        return ss.str() == s;
}
def SyFi.compare (   args)
compare(GiNaC::ex const & e, std::string const & s) -> bool

Definition at line 1335 of file SyFi.py.

References compare().

01335 
01336 def compare(*args):
01337   """compare(GiNaC::ex const & e, std::string const & s) -> bool"""
01338   return _SyFi.compare(*args)

bool SyFi::compare_archives ( const std::string &  first,
const std::string &  second,
std::ostream &  os = std::cout 
)
bool SyFi::compare_archives ( const string &  first,
const string &  second,
std::ostream &  os 
)

Definition at line 1263 of file ginac_tools.cpp.

References extract_symbols().

Referenced by _wrap_compare_archives__SWIG_0(), _wrap_compare_archives__SWIG_1(), check_CrouzeixRaviart(), compare_archives(), and main().

{
        bool ret = true;

        // read both archives
        archive a1, a2;
        ifstream if1(first.c_str()), if2(second.c_str());
        if1 >> a1;
        if2 >> a2;

        // compare size
        int n = a1.num_expressions();
        int n2 = a2.num_expressions();
        if(n != n2)
        {
                os << "Archives " << first << " and " << second
                        << " has a different number of expressions, " << n << " and " << n2 << "." << endl;
                os << "Comparing common expressions." << endl;
                ret = false;
        }

        // iterate over all expressions in first archive
        ex e1,e2;
        for(int i=0; i<n; i++)
        {
                lst syms;
                string exname;

                e1 = a1.unarchive_ex(syms, exname, i);

                syms = ex_to<lst>(extract_symbols(e1));
                //        os << "Comparing " << exname << " with symbols " << syms << endl;

                // is this in the second archive?
                try
                {
                        e2 = a2.unarchive_ex(syms, exname.c_str());

                        // got it, now compare
                        bool isequal = is_zero(e1-e2);
                        if(!isequal)
                        {
                                if(ret)
                                {
                                        os << "Archives " << first << " and " << second
                                                << " are not equal, details follow:" << endl;
                                }
                                os << "Expression with name " << exname << " is not equal:" << endl;
                                os << "First:  " << endl << e1 << endl;
                                os << "Second: " << endl << e2 << endl;
                                ret = false;
                        }
                }
                catch(...)
                {
                        os << "Expression " << exname << " is missing from " << second << "." << endl;
                        ret = false;
                }
        }

        return ret;
}
def SyFi.compare_archives (   args)
  compare_archives(std::string const & first, std::string const & second, std::ostream & os=std::cout) -> bool
  compare_archives(std::string const & first, std::string const & second) -> bool
  

Definition at line 1343 of file SyFi.py.

References compare_archives().

01343 
01344 def compare_archives(*args):
01345   """
01346     compare_archives(std::string const & first, std::string const & second, std::ostream & os=std::cout) -> bool
01347     compare_archives(std::string const & first, std::string const & second) -> bool
01348     """
01349   return _SyFi.compare_archives(*args)

void SyFi::compute_mixed_Poisson_element_matrix ( FE &  v_fe,
FE &  p_fe,
Dof &  dof,
std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > &  A 
)

Definition at line 150 of file ElementComputations.cpp.

References div(), SyFi::FE::dof(), SyFi::FE::get_polygon(), SyFi::Dof::glob_dof(), inner(), SyFi::Dof::insert_dof(), SyFi::Polygon::integrate(), SyFi::FE::N(), and SyFi::FE::nbf().

Referenced by _wrap_compute_mixed_Poisson_element_matrix(), compute_mixed_Poisson_element_matrix(), and main().

        {
                std::pair<unsigned int,unsigned int> index;
                std::pair<unsigned int,unsigned int> index2;

                // FIXME: need to check that p_fe
                // contains the same domain
                Polygon& domain = v_fe.get_polygon();

                // Insert the local degrees of freedom into the global Dof
                for (unsigned int i=0; i< v_fe.nbf(); i++)
                {
                        dof.insert_dof(1,i,v_fe.dof(i));
                }
                for (unsigned int i=0; i< p_fe.nbf(); i++)
                {
                        dof.insert_dof(1,v_fe.nbf()+i+1,p_fe.dof(i));
                }

                // The term (u,v)
                for (unsigned int i=0; i< v_fe.nbf(); i++)
                {
                                                                 // fetch the global dof related to i and v
                        index.first = dof.glob_dof(v_fe.dof(i));
                        for (unsigned int j=0; j< v_fe.nbf(); j++)
                        {
                                                                 // fetch the global dof related to j and p
                                index.second = dof.glob_dof(v_fe.dof(j));
                                                                 // compute the integrand
                                GiNaC::ex mass = inner(v_fe.N(i),v_fe.N(j));
                                                                 // compute the integral
                                GiNaC::ex Aij = domain.integrate(mass);
                                A[index] += Aij; // add to global matrix
                        }
                }

                // The term -(div u, q)
                for (unsigned int i=0; i< p_fe.nbf(); i++)
                {
                                                                 // fetch the global dof for p_i
                        index.first = dof.glob_dof(p_fe.dof(i));
                        for (unsigned int j=0; j< v_fe.nbf(); j++)
                        {
                                                                 // fetch the global dof for v_j
                                index.second=dof.glob_dof(v_fe.dof(j));
                                                                 // compute the integrand
                                GiNaC::ex divV= -p_fe.N(i)*div(v_fe.N(j));
                                                                 // compute the integral
                                GiNaC::ex Aij = domain.integrate(divV);
                                A[index] += Aij; // add to global matrix

                                // Do not need to compute the term (grad(p),v), since the system is
                                // symmetric we simply set Aji = Aij
                                index2.first = index.second;
                                index2.second = index.first;
                                A[index2] += Aij;
                        }
                }
        }
compute_mixed_Poisson_element_matrix(FE v_fe, FE p_fe, Dof dof, std::map< std::pair< unsigned int,unsigned int >,GiNaC::ex,std::less< std::pair< unsigned int,unsigned int > >,std::allocator< std::pair< std::pair< unsigned int,unsigned int > const,GiNaC::ex > > > & A)

Definition at line 2441 of file SyFi.py.

References compute_mixed_Poisson_element_matrix().

02441 
02442 def compute_mixed_Poisson_element_matrix(*args):
02443   """compute_mixed_Poisson_element_matrix(FE v_fe, FE p_fe, Dof dof, std::map< std::pair< unsigned int,unsigned int >,GiNaC::ex,std::less< std::pair< unsigned int,unsigned int > >,std::allocator< std::pair< std::pair< unsigned int,unsigned int > const,GiNaC::ex > > > & A)"""
  return _SyFi.compute_mixed_Poisson_element_matrix(*args)
void SyFi::compute_Poisson_element_matrix ( FE &  fe,
Dof &  dof,
std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > &  A 
)

Definition at line 52 of file ElementComputations.cpp.

References SyFi::FE::dof(), SyFi::FE::get_polygon(), SyFi::Dof::glob_dof(), grad(), inner(), SyFi::Dof::insert_dof(), SyFi::Polygon::integrate(), SyFi::FE::N(), and SyFi::FE::nbf().

Referenced by compute_Poisson_element_matrix().

        {
                std::pair<unsigned int,unsigned int> index;

                // Insert the local degrees of freedom into the global Dof
                for (unsigned int i=0; i< fe.nbf(); i++)
                {
                        dof.insert_dof(1,i,fe.dof(i));
                }

                Polygon& domain = fe.get_polygon();

                // The term (grad u, grad v)
                for (unsigned int i=0; i< fe.nbf(); i++)
                {
                                                                 // fetch the global dof for Ni
                        index.first = dof.glob_dof(fe.dof(i));
                        for (unsigned int j=0; j< fe.nbf(); j++)
                        {
                                                                 // fetch the global dof for Nj
                                index.second = dof.glob_dof(fe.dof(j));
                                                                 // compute the integrand
                                GiNaC::ex nabla = inner(grad(fe.N(i)),
                                        grad(fe.N(j)));
                                                                 // compute the integral
                                GiNaC::ex Aij = domain.integrate(nabla);
                                A[index] += Aij; // add to global matrix
                        }
                }
        }
compute_Poisson_element_matrix(FE fe, Dof dof, std::map< std::pair< unsigned int,unsigned int >,GiNaC::ex,std::less< std::pair< unsigned int,unsigned int > >,std::allocator< std::pair< std::pair< unsigned int,unsigned int > const,GiNaC::ex > > > & A)

Definition at line 2433 of file SyFi.py.

References compute_Poisson_element_matrix().

02433 
02434 def compute_Poisson_element_matrix(*args):
02435   """compute_Poisson_element_matrix(FE fe, Dof dof, std::map< std::pair< unsigned int,unsigned int >,GiNaC::ex,std::less< std::pair< unsigned int,unsigned int > >,std::allocator< std::pair< std::pair< unsigned int,unsigned int > const,GiNaC::ex > > > & A)"""
02436   return _SyFi.compute_Poisson_element_matrix(*args)

void SyFi::compute_Stokes_element_matrix ( FE &  v_fe,
FE &  p_fe,
Dof &  dof,
std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > &  A 
)

Definition at line 86 of file ElementComputations.cpp.

References div(), SyFi::FE::dof(), SyFi::FE::get_polygon(), SyFi::Dof::glob_dof(), grad(), inner(), SyFi::Dof::insert_dof(), SyFi::Polygon::integrate(), SyFi::FE::N(), and SyFi::FE::nbf().

Referenced by _wrap_compute_Stokes_element_matrix(), compute_Stokes_element_matrix(), and main().

        {
                std::pair<unsigned int,unsigned int> index;
                std::pair<unsigned int,unsigned int> index2;

                // FIXME: need to check that p_fe
                // contains the same domain
                Polygon& domain = v_fe.get_polygon();

                // Insert the local degrees of freedom into the global Dof
                for (unsigned int i=0; i< v_fe.nbf(); i++)
                {
                        dof.insert_dof(1,i,v_fe.dof(i));
                }
                for (unsigned int i=0; i< p_fe.nbf(); i++)
                {
                        dof.insert_dof(1,v_fe.nbf()+i,p_fe.dof(i));
                }

                // The term (grad u, grad v)
                for (unsigned int i=0; i< v_fe.nbf(); i++)
                {
                                                                 // fetch the global dof for v_i
                        index.first = dof.glob_dof(v_fe.dof(i));
                        for (unsigned int j=0; j< v_fe.nbf(); j++)
                        {
                                                                 // fetch the global dof for v_j
                                index.second = dof.glob_dof(v_fe.dof(j));
                                GiNaC::ex nabla = inner(grad(v_fe.N(i)),
                                        grad(v_fe.N(j)));// compute the integrand
                                                                 // compute the integral
                                GiNaC::ex Aij = domain.integrate(nabla);
                                A[index] += Aij; // add to global matrix
                        }
                }

                // The term -(div u, q)
                for (unsigned int i=0; i< p_fe.nbf(); i++)
                {
                                                                 // fetch the global dof for p_i
                        index.first = dof.glob_dof(p_fe.dof(i));
                        for (unsigned int j=0; j< v_fe.nbf(); j++)
                        {
                                                                 // fetch the global dof for v_j
                                index.second=dof.glob_dof(v_fe.dof(j));
                                                                 // compute the integrand
                                GiNaC::ex divV= -p_fe.N(i)*div(v_fe.N(j));
                                                                 // compute the integral
                                GiNaC::ex Aij = domain.integrate(divV);
                                A[index] += Aij; // add to global matrix

                                // Do not need to compute the term (grad(p),v), since the system is
                                // symmetric. We simply set Aji = Aij
                                index2.first = index.second;
                                index2.second = index.first;
                                A[index2] += Aij;
                        }
                }
        }
compute_Stokes_element_matrix(FE v_fe, FE p_fe, Dof dof, std::map< std::pair< unsigned int,unsigned int >,GiNaC::ex,std::less< std::pair< unsigned int,unsigned int > >,std::allocator< std::pair< std::pair< unsigned int,unsigned int > const,GiNaC::ex > > > & A)

Definition at line 2437 of file SyFi.py.

References compute_Stokes_element_matrix().

02437 
02438 def compute_Stokes_element_matrix(*args):
02439   """compute_Stokes_element_matrix(FE v_fe, FE p_fe, Dof dof, std::map< std::pair< unsigned int,unsigned int >,GiNaC::ex,std::less< std::pair< unsigned int,unsigned int > >,std::allocator< std::pair< std::pair< unsigned int,unsigned int > const,GiNaC::ex > > > & A)"""
02440   return _SyFi.compute_Stokes_element_matrix(*args)

bool SyFi::contains2D ( Ptv e0,
Ptv e1,
Ptv p 
)

Definition at line 201 of file Ptv_tools.cpp.

References line_contains(), and Ptv::size().

        {

                if ( e0.size() != e1.size() || e0.size() != p.size()  )
                {
                        throw(std::logic_error("Exception from contains2D(Ptv&, Ptv&, Ptv&): The dimentions of a and b must be the same."));
                }

                bool b = line_contains(e0, e1, p);

                return b;
        }
bool SyFi::contains3D ( Ptv e0,
Ptv e1,
Ptv e2,
Ptv p 
)

Definition at line 214 of file Ptv_tools.cpp.

References is_equal(), is_inside_triangle(), and line_contains().

        {

                // check if p is either e0, e1, or e2
                if ( is_equal(e0, p) )  return true;
                else if ( is_equal(e1, p) )  return true;
                else if ( is_equal(e2, p) )  return true;

                // check if p is on the lines connecting e0, e1, and e2
                if ( line_contains(e0, e1, p) ) return true;
                else if ( line_contains(e1, e2, p) ) return true;
                else if ( line_contains(e2, e1, p) ) return true;

                // check if p is inside the triangle with verticies e0, e1, and e2
                if ( is_inside_triangle(e0, e1, e2, p) ) return true;

                return false;

        }
ExStats SyFi::count_ops ( const GiNaC::ex &  e)
ExStats SyFi::count_ops ( const ex &  e)

Definition at line 1378 of file ginac_tools.cpp.

References SyFi::ExStatsVisitor::es, and test_syfi::debug::v.

Referenced by _wrap_count_ops(), count_ops(), main(), and print().

{
        //cout << "count_ops " << e << endl;
        //cout << "is an add: " << GiNaC::is<GiNaC::add>(e) << endl;
        //cout << "is a  mul: " << GiNaC::is<GiNaC::mul>(e) << endl;
        ExStatsVisitor v;
        e.traverse(v);
        return v.es;
}
def SyFi.count_ops (   args)
count_ops(GiNaC::ex const & e) -> ExStats

Definition at line 1495 of file SyFi.py.

References count_ops().

01495 
01496 def count_ops(*args):
01497   """count_ops(GiNaC::ex const & e) -> ExStats"""
01498   return _SyFi.count_ops(*args)

GiNaC::exhashmap<int> SyFi::count_symbols ( const GiNaC::ex &  e)
exhashmap<int> SyFi::count_symbols ( const ex &  e)

Definition at line 1167 of file ginac_tools.cpp.

References SyFi::SymbolCounterVisitor::symbolcount, and test_syfi::debug::v.

Referenced by _wrap_count_symbols(), count_symbols(), and print().

{
        SymbolCounterVisitor v;
        e.traverse(v);
        return v.symbolcount;
}
def SyFi.count_symbols (   args)
count_symbols(GiNaC::ex const & e) -> GiNaC::exhashmap< int >

Definition at line 1463 of file SyFi.py.

References count_symbols().

01463 
01464 def count_symbols(*args):
01465   """count_symbols(GiNaC::ex const & e) -> GiNaC::exhashmap< int >"""
01466   return _SyFi.count_symbols(*args)

GiNaC::lst SyFi::cross ( GiNaC::lst &  v1,
GiNaC::lst &  v2 
)

Definition at line 34 of file ginac_tools.cpp.

Referenced by _wrap_cross(), barycenter_triangle(), SyFi::Nedelec::compute_basis_functions(), cross(), line_contains(), and normal().

        {
                GiNaC::lst ret;
                if ( v1.nops() != v2.nops() )
                {
                        cout <<"incompatible vectors "<<endl;
                        cout <<"v1.nops() "<<v1.nops();
                        cout <<"  v2.nops() "<<v2.nops()<<endl; ;
                        return GiNaC::lst();
                }
                ret.append(  v1.op(1)*v2.op(2) - v1.op(2)*v2.op(1));
                ret.append(- v1.op(0)*v2.op(2) + v1.op(2)*v2.op(0));
                ret.append(  v1.op(0)*v2.op(1) - v1.op(1)*v2.op(0));
                return ret;
        }
void SyFi::cross ( const Ptv a,
const Ptv b,
Ptv c 
)

Definition at line 104 of file Ptv_tools.cpp.

References Ptv::redim(), and Ptv::size().

        {
                if ( a.size() != b.size() )
                {
                        throw(std::logic_error("Exception from cross (const Ptv&, const Ptv&, Ptv&): The dimentions of a and b must be the same."));
                }

                if ( a.size() == 2 )
                {
                        c.redim(1);
                        c[0] = a[0]*b[1] - a[1]*b[0];
                }

                else if ( a.size() == 3 )
                {
                        c.redim(3);
                        c[0] =   a[1]*b[2] - b[1]*a[2];
                        c[1] = - a[0]*b[2] + b[0]*a[2];
                        c[2] =   a[0]*b[1] - b[0]*a[1];
                }

                else
                {
                        throw(std::logic_error("The cross product can only be computed in 2D and 3D."));
                }

        }
def SyFi.cross (   args)
cross(GiNaC::lst & v1, GiNaC::lst & v2) -> GiNaC::lst

Definition at line 1359 of file SyFi.py.

References cross().

01359 
01360 def cross(*args):
01361   """cross(GiNaC::lst & v1, GiNaC::lst & v2) -> GiNaC::lst"""
01362   return _SyFi.cross(*args)

int SyFi::dirac ( unsigned int  i,
unsigned int  j 
)

Definition at line 34 of file utilities.cpp.

        {
                if (i==j) return 1;
                else return 0;
        }
def SyFi.dirac (   args)
dirac(unsigned int i, unsigned int j) -> int

Definition at line 1300 of file SyFi.py.

Referenced by _wrap_dirac(), SyFi::CrouzeixRaviart.compute_basis_functions(), and main().

01300 
01301 def dirac(*args):
01302   """dirac(unsigned int i, unsigned int j) -> int"""
01303   return _SyFi.dirac(*args)

GiNaC::ex SyFi::div ( GiNaC::ex  v)

Definition at line 45 of file diff_tools.cpp.

References test_syfi::debug::c, nsd, test_syfi::debug::v, x, y, and z.

Referenced by _wrap_div__SWIG_0(), _wrap_div__SWIG_1(), _wrap_div__SWIG_2(), _wrap_div__SWIG_3(), SyFi::Robust::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), compute_mixed_Poisson_element_matrix(), compute_Stokes_element_matrix(), div(), and main().

        {
                using SyFi::nsd;
                using SyFi::x;
                using SyFi::y;
                using SyFi::z;

                GiNaC::ex ret;
                if (GiNaC::is_a<GiNaC::matrix>(v))
                {
                        GiNaC::matrix m = GiNaC::ex_to<GiNaC::matrix>(v);
                        if ( m.cols() == 1 && m.rows() == nsd )
                        {
                                if (nsd == 1)
                                {
                                        ret = diff(m,x);
                                }
                                else if (nsd == 2)
                                {
                                        ret = diff(m.op(0),x) + diff(m.op(1),y) ;
                                }
                                else if (nsd == 3)
                                {
                                        ret = diff(m.op(0),x) + diff(m.op(1),y) + diff(m.op(2),z) ;
                                }
                                else
                                {
                                        throw std::runtime_error("Invalid nsd");
                                }

                        }
                        else
                        {
                                GiNaC::matrix retm = GiNaC::matrix(m.cols(),1);
                                if ( nsd != m.rows() )
                                {
                                        throw(std::invalid_argument("The number of rows must equal nsd."));
                                }
                                GiNaC::symbol xr;
                                GiNaC::ex tmp;
                                for (unsigned int c=0; c<m.cols(); c++)
                                {
                                        for (unsigned int r=0; r<m.rows(); r++)
                                        {
                                                if (r+1 == 1) xr = x;
                                                if (r+1 == 2) xr = y;
                                                if (r+1 == 3) xr = z;
                                                retm(c,0) += diff(m(c,r), xr);
                                        }
                                }
                                ret = retm;
                        }
                        return ret;

                }
                else if (GiNaC::is_a<GiNaC::lst>(v))
                {
                        GiNaC::lst l = GiNaC::ex_to<GiNaC::lst>(v);
                        return div(l);
                }
                throw std::invalid_argument("v must be a matrix or lst.");
        }
GiNaC::ex SyFi::div ( GiNaC::ex  v,
GiNaC::ex  G 
)

Definition at line 108 of file diff_tools.cpp.

References div(), nsd, test_syfi::debug::v, x, y, and z.

        {
                using SyFi::nsd;
                using SyFi::x;
                using SyFi::y;
                using SyFi::z;

                GiNaC::ex ret;
                if (GiNaC::is_a<GiNaC::matrix>(v) && GiNaC::is_a<GiNaC::matrix>(G))
                {
                        GiNaC::matrix m = GiNaC::ex_to<GiNaC::matrix>(v);
                        GiNaC::matrix GG = GiNaC::ex_to<GiNaC::matrix>(G);
                        if ( m.cols() == 1 && m.rows() == nsd && GG.rows() == nsd && GG.cols() == nsd )
                        {
                                if ( nsd == 1 || nsd == 2 || nsd == 3)
                                {
                                        ret = GiNaC::numeric(0);
                                        GiNaC::symbol xj;
                                        for (unsigned int i=0; i< nsd; i++)
                                        {
                                                for (unsigned int j=0; j< nsd; j++)
                                                {
                                                        if (j == 0) xj = x;
                                                        if (j == 1) xj = y;
                                                        if (j == 2) xj = z;
                                                        ret += m.op(i).diff(xj)*GG(i,j);
                                                }
                                        }
                                }
                                else
                                {
                                        throw std::runtime_error("Invalid nsd");
                                }
                        }
                        else
                        {
                                throw std::invalid_argument("This functions needs v and G on the form: v.cols()=1, v.rows()=G.rows()=G.cols()=nsd.");
                        }
                }
                else if (GiNaC::is_a<GiNaC::lst>(v))
                {
                        GiNaC::lst l = GiNaC::ex_to<GiNaC::lst>(v);
                        return div(l,G);
                }
                else
                {
                        throw std::invalid_argument("v must be a matrix or lst.");
                }
                return ret;
        }
GiNaC::ex SyFi::div ( GiNaC::lst &  v)

Definition at line 159 of file diff_tools.cpp.

References nsd, x, y, and z.

        {
                using SyFi::x;
                using SyFi::y;
                using SyFi::z;

                using SyFi::nsd;
                nsd = v.nops();
                GiNaC::ex ret;
                if (nsd == 1)
                {
                        ret = v.op(0).diff(x);
                }
                else if (nsd == 2)
                {
                        ret = v.op(0).diff(x) + v.op(1).diff(y);
                }
                else if (nsd == 3)
                {
                        ret = v.op(0).diff(x) + v.op(1).diff(y) + v.op(2).diff(z);
                }
                return ret;
        }
GiNaC::ex SyFi::div ( GiNaC::lst &  v,
GiNaC::ex  G 
)

Definition at line 183 of file diff_tools.cpp.

References nsd, x, y, and z.

        {
                using SyFi::x;
                using SyFi::y;
                using SyFi::z;

                using SyFi::nsd;
                nsd = v.nops();
                GiNaC::ex ret;
                if (GiNaC::is_a<GiNaC::matrix>(G))
                {
                        GiNaC::matrix GG = GiNaC::ex_to<GiNaC::matrix>(G);
                        if ( nsd != GG.cols() || nsd != GG.rows())
                        {
                                throw(std::invalid_argument("The number of rows and cols in G must equal the size of v."));
                        }
                        if (nsd == 1 || nsd == 2 || nsd == 3 )
                        {
                                GiNaC::symbol xj;
                                ret = GiNaC::numeric(0);
                                for (unsigned int i=0; i< nsd; i++)
                                {
                                        for (unsigned int j=0; j< nsd; j++)
                                        {
                                                if (i == 0) xj = x;
                                                if (i == 1) xj = y;
                                                if (i == 2) xj = z;
                                                ret += v.op(i).diff(xj)*GG(i,j);
                                        }
                                }
                        }
                        else
                        {
                                throw std::runtime_error("Invalid nsd");
                        }
                }
                else
                {
                        throw std::invalid_argument("v must be a matrix.");
                }
                return ret;
        }
GiNaC::ex SyFi::div ( GiNaC::exvector &  v)

Definition at line 226 of file diff_tools.cpp.

References nsd, x, y, and z.

        {
                using SyFi::nsd;
                using SyFi::x;
                using SyFi::y;
                using SyFi::z;

                GiNaC::ex ret;
                if (nsd == 2)
                {
                        ret = v[0].diff(x) + v[1].diff(y);
                }
                else if (nsd == 3)
                {
                        ret = v[0].diff(x) + v[1].diff(y) + v[2].diff(z);
                }
                return ret;
        }
def SyFi.div (   args)
  div(GiNaC::lst & v) -> GiNaC::ex
  div(GiNaC::lst & v, GiNaC::ex G) -> GiNaC::ex
  div(GiNaC::ex v) -> GiNaC::ex
  div(GiNaC::ex v, GiNaC::ex G) -> GiNaC::ex
  

Definition at line 1319 of file SyFi.py.

References div().

01319 
01320 def div(*args):
01321   """
01322     div(GiNaC::lst & v) -> GiNaC::ex
01323     div(GiNaC::lst & v, GiNaC::ex G) -> GiNaC::ex
01324     div(GiNaC::ex v) -> GiNaC::ex
01325     div(GiNaC::ex v, GiNaC::ex G) -> GiNaC::ex
01326     """
01327   return _SyFi.div(*args)

GiNaC::symbol SyFi::DUMMY ( "(DUMMY is not initialized since initSyFi has never been called)"  )
void SyFi::EQUAL_OR_DIE ( const GiNaC::ex &  e,
const std::string &  s 
)
void SyFi::EQUAL_OR_DIE ( const ex &  e,
const string &  s 
)

Definition at line 1095 of file ginac_tools.cpp.

References compare().

Referenced by _wrap_EQUAL_OR_DIE(), EQUAL_OR_DIE(), and main().

{
        if (!compare(e, s))
        {
                ostringstream os;
                os << "ERROR: expression e: " <<e<<" is not equal to "<<s<<endl;
                throw runtime_error(os.str());
        }
}
def SyFi.EQUAL_OR_DIE (   args)
EQUAL_OR_DIE(GiNaC::ex const & e, std::string const & s)

Definition at line 1339 of file SyFi.py.

References EQUAL_OR_DIE().

01339 
01340 def EQUAL_OR_DIE(*args):
01341   """EQUAL_OR_DIE(GiNaC::ex const & e, std::string const & s)"""
01342   return _SyFi.EQUAL_OR_DIE(*args)

GiNaC::matrix SyFi::equations2matrix ( const GiNaC::ex &  eqns,
const GiNaC::ex &  symbols 
)

Definition at line 238 of file ginac_tools.cpp.

References test_syfi::debug::c.

Referenced by _wrap_equations2matrix(), and equations2matrix().

        {

                GiNaC::matrix sys(eqns.nops(),symbols.nops());
                GiNaC::matrix rhs(eqns.nops(),1);
                GiNaC::matrix vars(symbols.nops(),1);

                for (size_t r=0; r<eqns.nops(); r++)
                {
                                                                 // lhs-rhs==0
                        const GiNaC::ex eq = eqns.op(r).op(0)-eqns.op(r).op(1);
                        GiNaC::ex linpart = eq;
                        for (size_t c=0; c<symbols.nops(); c++)
                        {
                                const GiNaC::ex co = eq.coeff(GiNaC::ex_to<GiNaC::symbol>(symbols.op(c)),1);
                                linpart -= co*symbols.op(c);
                                sys(r,c) = co;
                        }
                        linpart = linpart.expand();
                        rhs(r,0) = -linpart;
                }
                return sys;
        }
def SyFi.equations2matrix (   args)
equations2matrix(GiNaC::ex const & eqns, GiNaC::ex const & symbols) -> GiNaC::matrix

Definition at line 1378 of file SyFi.py.

References equations2matrix().

01378 
01379 def equations2matrix(*args):
01380   """equations2matrix(GiNaC::ex const & eqns, GiNaC::ex const & symbols) -> GiNaC::matrix"""
01381   return _SyFi.equations2matrix(*args)

GiNaC::lst SyFi::ex2equations ( GiNaC::ex  rel)

Definition at line 187 of file ginac_tools.cpp.

References x, y, and z.

Referenced by _wrap_ex2equations(), and ex2equations().

        {
                GiNaC::ex lhs = rel.lhs();
                GiNaC::ex rhs = rel.rhs();

                GiNaC::ex l;
                GiNaC::ex r;

                GiNaC::lst eqs;

                for (int i=lhs.ldegree(x); i<=lhs.degree(x); ++i)
                {
                        for (int j=lhs.ldegree(y); j<=lhs.degree(y); ++j)
                        {
                                for (int k=lhs.ldegree(z); k<=lhs.degree(z); ++k)
                                {
                                        l = lhs.coeff(x,i).coeff(y, j).coeff(z,k);
                                        r = rhs.coeff(x,i).coeff(y, j).coeff(z,k);
                                        //      if (! (l == 0 && r == 0 ) )  eqs.append(l == r); OLD VERSION
                                        if ( (l != 0 && (r == 0 || r == 1) ) )  eqs.append(l == r);
                                }
                        }
                }
                eqs.sort();
                return eqs;
        }
def SyFi.ex2equations (   args)
ex2equations(GiNaC::ex rel) -> GiNaC::lst

Definition at line 1370 of file SyFi.py.

References ex2equations().

01370 
01371 def ex2equations(*args):
01372   """ex2equations(GiNaC::ex rel) -> GiNaC::lst"""
01373   return _SyFi.ex2equations(*args)

GiNaC::ex SyFi::extract_symbols ( const GiNaC::ex &  e)
ex SyFi::extract_symbols ( const ex &  e)

Definition at line 1215 of file ginac_tools.cpp.

References SyFi::SymbolCounterVisitor::symbolcount, and test_syfi::debug::v.

Referenced by _wrap_extract_symbols(), compare_archives(), and extract_symbols().

{
        // Implemented directly to avoid copying map:
        SymbolCounterVisitor v;
        e.traverse(v);
        exhashmap<int> & sc = v.symbolcount;

        lst l;
        for(exhashmap<int>::iterator it=sc.begin(); it!=sc.end(); it++)
        {
                l.append(it->first);
                std::cout << (it->first) << std::endl;
        }
        ex ret = l;
        return ret;
}
def SyFi.extract_symbols (   args)
extract_symbols(GiNaC::ex const & e) -> GiNaC::ex

Definition at line 1467 of file SyFi.py.

References extract_symbols().

01467 
01468 def extract_symbols(*args):
01469   """extract_symbols(GiNaC::ex const & e) -> GiNaC::ex"""
  return _SyFi.extract_symbols(*args)
string SyFi::exvector2string ( GiNaC::exvector &  v)

Definition at line 77 of file utilities.cpp.

        {
                ostringstream s;
                s <<"[";
                for (unsigned int i=0; i< v.size()-1; i++)
                {
                        s <<v[i]<<",";
                }
                s<<v[v.size()-1]<< "]";
                return s.str();
        }
int SyFi::find ( GiNaC::ex  e,
GiNaC::lst  list 
)

Definition at line 390 of file ginac_tools.cpp.

Referenced by _wrap_ex_int_map_find(), _wrap_exmap_find(), _wrap_exset_find(), _wrap_find(), check_visitor(), and find().

{
        for (unsigned int i=0; i< list.nops(); i++)
        {
                if ( e == list.op(i) ) return i;
        }
        return -1;
}
def SyFi.find (   args)
find(GiNaC::ex e, GiNaC::lst list) -> int

Definition at line 1398 of file SyFi.py.

References find().

01398 
01399 def find(*args):
01400   """find(GiNaC::ex e, GiNaC::lst list) -> int"""
01401   return _SyFi.find(*args)

const GiNaC::symbol& SyFi::get_symbol ( const std::string &  name)
const symbol& SyFi::get_symbol ( const string &  name)

Definition at line 123 of file syfi/symbol_factory.cpp.

References symbol_collection.

        {
                map<string, symbol>::iterator i = symbol_collection.find(name);
                if( i != symbol_collection.end() )
                {
                        return i->second;
                }
                return symbol_collection.insert(make_pair(name, symbol(name))).first->second;
        }
def SyFi.get_symbol (   args)
get_symbol(std::string const & name) -> GiNaC::symbol const &

Definition at line 1516 of file SyFi.py.

Referenced by _wrap_get_symbol(), initSyFi(), isymb(), main(), pickExpression(), and replace_powers().

01516 
01517 def get_symbol(*args):
01518   """get_symbol(std::string const & name) -> GiNaC::symbol const &"""
01519   return _SyFi.get_symbol(*args)

GiNaC::ex SyFi::get_symbolic_matrix ( int  m,
int  n,
const std::string &  basename 
)

Definition at line 154 of file syfi/symbol_factory.cpp.

References isymb().

        {
                GiNaC::matrix A(m,n);
                for(int i=0; i<m; i++)
                {
                        for(int j=0; j<n; j++)
                        {
                                A.set(i, j, isymb(basename, i,j));
                        }
                }
                GiNaC::ex e = A;
                return e;
        }
def SyFi.get_symbolic_matrix (   args)
get_symbolic_matrix(int m, int n, std::string const & basename) -> GiNaC::ex

Definition at line 1531 of file SyFi.py.

Referenced by _wrap_get_symbolic_matrix(), bernstein(), homogenous_pol(), lagrange(), lagrangev(), legendre(), main(), pol(), and polb().

01531 
01532 def get_symbolic_matrix(*args):
01533   """get_symbolic_matrix(int m, int n, std::string const & basename) -> GiNaC::ex"""
  return _SyFi.get_symbolic_matrix(*args)
GiNaC::ex SyFi::get_symbolic_vector ( int  m,
const std::string &  basename 
)

Definition at line 143 of file syfi/symbol_factory.cpp.

References isymb().

        {
                GiNaC::matrix A(m,1);
                for(int i=0; i<m; i++)
                {
                        A.set(i, 0, isymb(basename, i));
                }
                GiNaC::ex e = A;
                return e;
        }
def SyFi.get_symbolic_vector (   args)
get_symbolic_vector(int m, std::string const & basename) -> GiNaC::ex

Definition at line 1527 of file SyFi.py.

Referenced by _wrap_get_symbolic_vector(), barycenter(), initSyFi(), main(), and SyFi::Simplex.repr().

01527 
01528 def get_symbolic_vector(*args):
01529   """get_symbolic_vector(int m, std::string const & basename) -> GiNaC::ex"""
01530   return _SyFi.get_symbolic_vector(*args)

GiNaC::ex SyFi::grad ( GiNaC::ex  f)

Definition at line 245 of file diff_tools.cpp.

References run_tests::f, nsd, x, y, and z.

Referenced by _wrap_grad__SWIG_0(), _wrap_grad__SWIG_1(), compute_nlconvdiff_element_matrix(), compute_Poisson_element_matrix(), compute_poisson_element_matrix(), compute_Poisson_element_matrix(), compute_Stokes_element_matrix(), example_of_use(), grad(), main(), and usage().

        {
                using SyFi::nsd;
                using SyFi::x;
                using SyFi::y;
                using SyFi::z;

                if (GiNaC::is_a<GiNaC::matrix>(f))
                {
                        GiNaC::matrix m = GiNaC::ex_to<GiNaC::matrix>(f);
                        GiNaC::matrix ret_m(nsd,m.rows());
                        for (unsigned int r=0; r< m.rows(); r++)
                        {
                                if (nsd == 1)
                                {
                                        //         ret_m(0,r) = diff(m.op(r),x);
                                        return diff(f, x);
                                }
                                else if ( nsd == 2)
                                {
                                        ret_m(0,r) = diff(m.op(r),x);
                                        ret_m(1,r) = diff(m.op(r),y);
                                }
                                else if ( nsd == 3)
                                {
                                        ret_m(0,r) = diff(m.op(r),x);
                                        ret_m(1,r) = diff(m.op(r),y);
                                        ret_m(2,r) = diff(m.op(r),z);
                                }
                        }
                        return ret_m;
                }
                else
                {

                        if (nsd == 1)
                        {
                                //      return GiNaC::matrix(nsd,1,GiNaC::lst(diff(f,x)));
                                return diff(f,x);
                        }
                        else if ( nsd == 2)
                        {
                                return GiNaC::matrix(nsd,1,GiNaC::lst(diff(f,x), diff(f,y)));
                        }
                        else if ( nsd == 3)
                        {
                                return GiNaC::matrix(nsd,1,GiNaC::lst(diff(f,x), diff(f,y), diff(f,z)));
                        }
                        else
                        {
                                throw(std::invalid_argument("nsd must be either 1, 2, or 3."));
                                return GiNaC::matrix();
                        }
                }
        }
GiNaC::ex SyFi::grad ( GiNaC::ex  f,
GiNaC::ex  G 
)

Definition at line 301 of file diff_tools.cpp.

References test_syfi::debug::c, run_tests::f, nsd, x, y, and z.

        {
                using SyFi::nsd;
                using SyFi::x;
                using SyFi::y;
                using SyFi::z;

                GiNaC::symbol xr;
                if ( GiNaC::is_a<GiNaC::matrix>(G))
                {
                        GiNaC::matrix GG = GiNaC::ex_to<GiNaC::matrix>(G);

                        if (! (GG.rows() == nsd && GG.cols() == nsd ))
                        {
                                throw(std::invalid_argument("The number of cols/rows in G must equal nsd."));
                        }

                        if (GiNaC::is_a<GiNaC::matrix>(f) )
                        {
                                GiNaC::matrix m = GiNaC::ex_to<GiNaC::matrix>(f);
                                GiNaC::matrix ret_m(nsd,m.rows());
                                for (unsigned int k=0; k< m.rows(); k++)
                                {
                                        for (unsigned int c=0; c<nsd; c++)
                                        {
                                                for (unsigned int r=0; r<nsd; r++)
                                                {
                                                        if (r == 0) xr = x;
                                                        if (r == 1) xr = y;
                                                        if (r == 2) xr = z;
                                                        ret_m(c,k) += diff(f,xr)*GG(r,c);
                                                }
                                        }
                                }

                                return ret_m;
                        }
                        else
                        {
                                GiNaC::matrix ret_m(nsd,1);
                                for (unsigned int c=0; c<nsd; c++)
                                {
                                        for (unsigned int r=0; r<nsd; r++)
                                        {
                                                if (r == 0) xr = x;
                                                if (r == 1) xr = y;
                                                if (r == 2) xr = z;
                                                ret_m(c,0) += diff(f,xr)*GG(r,c);
                                        }
                                }
                                return ret_m;
                        }
                }
                else
                {
                        throw(std::invalid_argument("G must be a matrix."));
                }
        }
def SyFi.grad (   args)
  grad(GiNaC::ex f) -> GiNaC::ex
  grad(GiNaC::ex f, GiNaC::ex G) -> GiNaC::ex
  

Definition at line 1328 of file SyFi.py.

References grad().

01328 
01329 def grad(*args):
01330   """
01331     grad(GiNaC::ex f) -> GiNaC::ex
01332     grad(GiNaC::ex f, GiNaC::ex G) -> GiNaC::ex
01333     """
01334   return _SyFi.grad(*args)

GiNaC::ex SyFi::homogenous_pol ( unsigned int  order,
unsigned int  nsd,
const std::string  a 
)
GiNaC::ex SyFi::homogenous_pol ( unsigned int  order,
unsigned int  nsd,
const string  a 
)

Definition at line 534 of file ginac_tools.cpp.

References get_symbolic_matrix(), istr(), matrix_to_lst2(), x, y, and z.

Referenced by _wrap_homogenous_pol(), homogenous_pol(), homogenous_polv(), and main().

{
        using SyFi::x;
        using SyFi::y;
        using SyFi::z;

        if ( nsd == 1)
        {
                GiNaC::symbol a0(istr(a,0));
                return GiNaC::lst(a0*pow(x,order), a0, pow(x,order));
        }
        else if ( nsd == 2 )
        {
                GiNaC::ex variables = get_symbolic_matrix(1,order+1, a);
                GiNaC::lst basis;
                GiNaC::ex ret;
                for (unsigned int i=0; i<= order; i++)
                {
                        basis.append(pow(x,i)*pow(y,order-i));
                        ret += variables.op(i)*basis.op(i);
                }
                return GiNaC::lst(ret, matrix_to_lst2(variables), basis);
        }
        else if ( nsd == 3 )
        {
                GiNaC::lst basis;
                for (unsigned int i=0; i<= order; i++)
                {
                        for (unsigned int j=0; j<= order; j++)
                        {
                                for (unsigned int k=0; k<= order; k++)
                                {
                                        if ( i + j + k == order )
                                        {
                                                basis.append(pow(x,i)*pow(y,j)*pow(z,k));
                                        }
                                }
                        }
                }
                GiNaC::ex variables = get_symbolic_matrix(1,basis.nops(), a);
                GiNaC::ex ret;
                for (unsigned int i=0; i<basis.nops(); i++)
                {
                        ret += variables.op(i)*basis.op(i);
                }
                return GiNaC::lst(ret, matrix_to_lst2(variables), basis);
        }
        throw std::runtime_error("Homogenous polynomials only implemented in 1D, 2D and 3D");
}
def SyFi.homogenous_pol (   args)
homogenous_pol(unsigned int order, unsigned int nsd, std::string const a) -> GiNaC::ex

Definition at line 1422 of file SyFi.py.

References homogenous_pol().

01422 
01423 def homogenous_pol(*args):
01424   """homogenous_pol(unsigned int order, unsigned int nsd, std::string const a) -> GiNaC::ex"""
01425   return _SyFi.homogenous_pol(*args)

GiNaC::lst SyFi::homogenous_polv ( unsigned int  no_fields,
unsigned int  order,
unsigned int  nsd,
const std::string  a 
)
GiNaC::lst SyFi::homogenous_polv ( unsigned int  no_fields,
unsigned int  order,
unsigned int  nsd,
const string  a 
)

Definition at line 585 of file ginac_tools.cpp.

References homogenous_pol().

Referenced by _wrap_homogenous_polv(), SyFi::Nedelec::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), and homogenous_polv().

{
        GiNaC::lst ret1;                         // contains the polynom
        GiNaC::lst ret2;                         // contains the coefficients
        GiNaC::lst ret3;                         // constains the basis functions
        GiNaC::lst basis_tmp;
        for (unsigned int i=0; i< no_fields; i++)
        {
                GiNaC::lst basis;
                std::ostringstream s;
                s <<a<<""<<i<<"_";
                GiNaC::ex polspace = homogenous_pol(order, nsd, s.str());
                ret1.append(polspace.op(0));
                ret2.append(polspace.op(1));
                basis_tmp = GiNaC::ex_to<GiNaC::lst>(polspace.op(2));
                for (GiNaC::lst::const_iterator basis_iterator = basis_tmp.begin();
                        basis_iterator != basis_tmp.end(); ++basis_iterator)
                {
                        GiNaC::lst tmp_lst;
                        for (unsigned int d=1; d<=no_fields; d++) tmp_lst.append(0);
                        tmp_lst.let_op(i) = (*basis_iterator);
                        ret3.append(tmp_lst);
                }
        }
        return GiNaC::lst(ret1,ret2,ret3);
}
def SyFi.homogenous_polv (   args)
homogenous_polv(unsigned int no_fields, unsigned int order, unsigned int nsd, std::string const a) -> GiNaC::lst

Definition at line 1426 of file SyFi.py.

References homogenous_polv().

01426 
01427 def homogenous_polv(*args):
01428   """homogenous_polv(unsigned int no_fields, unsigned int order, unsigned int nsd, std::string const a) -> GiNaC::lst"""
01429   return _SyFi.homogenous_polv(*args)

GiNaC::symbol SyFi::infinity ( "(infinity is not initialized since initSyFi has never been called)"  )
void SyFi::initSyFi ( unsigned int  nsd_)

Definition at line 46 of file syfi/symbol_factory.cpp.

References DUMMY, get_symbol(), get_symbolic_vector(), infinity, nsd, p, t, x, y, and z.

        {
                // initSyFi uses the global coordinates x      for nsd == 1
                // initSyFi uses the global coordinates x,y    for nsd == 2
                // initSyFi uses the global coordinates x,y,z  for nsd == 3
                // when nsd > 3 the coordinates can be found in the p, which is of type lst

                // FIXME: this whole thing is just a mess, but it's a nontrivial job to fix it all over syfi...

                SyFi::nsd      = nsd_;
                SyFi::t        = get_symbol("t");

                SyFi::infinity = get_symbol("infinity");
                SyFi::DUMMY    = get_symbol("DUMMY");

                SyFi::x        = get_symbol("(SyFi::x is not initialized)");
                SyFi::y        = get_symbol("(SyFi::y is not initialized)");
                SyFi::z        = get_symbol("(SyFi::z is not initialized)");

                /*
                std::cout << "SyFi::p before remove_all:" << std::endl;
                std::cout << SyFi::p << std::endl;
                */

                SyFi::p.remove_all();

                /*
                std::cout << "SyFi::p after remove_all:" << std::endl;
                std::cout << SyFi::p << std::endl;
                */

                if ( nsd  > 3 )
                {
                        SyFi::x = get_symbol("(SyFi::x is an invalid symbol when nsd>3)");
                        SyFi::y = get_symbol("(SyFi::y is an invalid symbol when nsd>3)");
                        SyFi::z = get_symbol("(SyFi::z is an invalid symbol when nsd>3)");

                        ex tmp = get_symbolic_vector(nsd, "x");
                        for (unsigned int i=0; i<tmp.nops(); i++)
                        {
                                p.append(tmp.op(i));
                        }
                }
                else
                {
                        if ( nsd  > 0 )
                        {
                                SyFi::x = get_symbol("x");
                                SyFi::p.append(SyFi::x);
                        }
                        if ( nsd  > 1 )
                        {
                                SyFi::y = get_symbol("y");
                                SyFi::p.append(SyFi::y);
                        }
                        if ( nsd  > 2 )
                        {
                                SyFi::z = get_symbol("z");
                                SyFi::p.append(SyFi::z);
                        }
                }

                /*
                std::cout << "SyFi::p at end of initSyFi:" << std::endl;
                std::cout << SyFi::p << std::endl;
                */
        }
def SyFi.initSyFi (   args)
initSyFi(unsigned int nsd)

Definition at line 1508 of file SyFi.py.

Referenced by _wrap_initSyFi(), check_CrouzeixRaviart(), check_RaviartThomas(), and main().

01508 
01509 def initSyFi(*args):
01510   """initSyFi(unsigned int nsd)"""
01511   return _SyFi.initSyFi(*args)

GiNaC::ex SyFi::inner ( GiNaC::ex  a,
GiNaC::ex  b,
bool  transposed 
)

Definition at line 50 of file ginac_tools.cpp.

Referenced by _wrap_inner__SWIG_0(), _wrap_inner__SWIG_1(), _wrap_inner__SWIG_2(), _wrap_inner__SWIG_3(), SyFi::Nedelec::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), compute_mixed_Poisson_element_matrix(), compute_nlconvdiff_element_matrix(), compute_poisson_element_matrix(), compute_Poisson_element_matrix(), compute_Poisson_element_matrix(), compute_Stokes_element_matrix(), inner(), main(), test_sfc.test_ufl2swiginac.Ufl2SwiginacTest::testProduct4(), and test_sfc.test_jit_functionals.TestJitFunctionals::xtest_tensor_algebra().

        {
                if (GiNaC::is_a<GiNaC::matrix>(a) && GiNaC::is_a<GiNaC::matrix>(b))
                {
                        GiNaC::matrix ma = GiNaC::ex_to<GiNaC::matrix>(a);
                        GiNaC::matrix mb = GiNaC::ex_to<GiNaC::matrix>(b);
                        if ( !transposed )
                        {
                                if (ma.cols() != mb.cols() || ma.rows() != mb.rows() )
                                {
                                        cout <<"Incompatible matrices "<<endl;
                                        cout <<"a.cols() "<<ma.cols()<<endl;
                                        cout <<"a.rows() "<<ma.rows()<<endl;
                                        cout <<"b.cols() "<<mb.cols()<<endl;
                                        cout <<"b.rows() "<<mb.rows()<<endl;
                                        cout <<"a="<<a<<endl;
                                        cout <<"b="<<b<<endl;
                                        throw std::runtime_error("Incompatible matrices.");
                                }

                                GiNaC::ex ret;
                                for (unsigned int i=0; i<ma.rows(); i++)
                                {
                                        for (unsigned int j=0; j<ma.cols(); j++)
                                        {
                                                ret += ma(i,j)*mb(i,j);
                                        }
                                }
                                return ret;
                        }
                        else
                        {
                                if (ma.cols() != mb.rows() || ma.rows() != mb.cols() )
                                {
                                        cout <<"Incompatible matrices "<<endl;
                                        cout <<"a.cols() "<<ma.cols()<<endl;
                                        cout <<"a.rows() "<<ma.rows()<<endl;
                                        cout <<"b.cols() "<<mb.cols()<<endl;
                                        cout <<"b.rows() "<<mb.rows()<<endl;
                                        cout <<"a="<<a<<endl;
                                        cout <<"b="<<b<<endl;
                                        throw std::runtime_error("Incompatible matrices.");
                                }

                                GiNaC::ex ret;
                                for (unsigned int i=0; i<ma.rows(); i++)
                                {
                                        for (unsigned int j=0; j<ma.cols(); j++)
                                        {
                                                ret += ma(i,j)*mb(j,i);
                                        }
                                }
                                return ret;
                        }
                }
                else if (GiNaC::is_a<GiNaC::lst>(a)
                        && GiNaC::is_a<GiNaC::lst>(b))
                {
                        return inner(GiNaC::ex_to<GiNaC::lst>(a), GiNaC::ex_to<GiNaC::lst>(b));
                }
                else
                {
                        return a*b;
                }
        }
GiNaC::ex SyFi::inner ( GiNaC::lst  v1,
GiNaC::lst  v2 
)

Definition at line 116 of file ginac_tools.cpp.

References inner().

        {
                GiNaC::ex ret;

                if ( v1.nops() != v2.nops() )
                {
                        cout <<"incompatible vectors "<<endl;
                        cout <<"v1.nops() "<<v1.nops();
                        cout <<"  v2.nops() "<<v2.nops()<<endl; ;
                        return 0;
                }
                for (unsigned i = 0; i <= v1.nops()-1 ; ++i)
                {
                        if ( GiNaC::is_a<GiNaC::lst>(v1.op(i)) &&
                                GiNaC::is_a<GiNaC::lst>(v2.op(i)) )
                        {
                                ret += inner(GiNaC::ex_to<GiNaC::lst>(v1.op(i)),
                                        GiNaC::ex_to<GiNaC::lst>(v2.op(i)));
                        }
                        else
                        {
                                ret += v1.op(i)*v2.op(i);
                        }
                }
                return ret;
        }
GiNaC::ex SyFi::inner ( GiNaC::exvector &  v1,
GiNaC::exvector &  v2 
)

Definition at line 143 of file ginac_tools.cpp.

        {
                GiNaC::ex ret;
                for (unsigned int i=0; i< v1.size(); i++)
                {
                        ret += v1[i]*v2[i];
                }
                return ret;
        }
def SyFi.inner (   args)
  inner(GiNaC::ex a, GiNaC::ex b, bool transposed=False) -> GiNaC::ex
  inner(GiNaC::ex a, GiNaC::ex b) -> GiNaC::ex
  inner(GiNaC::exvector & v1, GiNaC::exvector & v2) -> GiNaC::ex
  inner(GiNaC::lst v1, GiNaC::lst v2) -> GiNaC::ex
  

Definition at line 1350 of file SyFi.py.

References inner().

01350 
01351 def inner(*args):
01352   """
01353     inner(GiNaC::ex a, GiNaC::ex b, bool transposed=False) -> GiNaC::ex
01354     inner(GiNaC::ex a, GiNaC::ex b) -> GiNaC::ex
01355     inner(GiNaC::exvector & v1, GiNaC::exvector & v2) -> GiNaC::ex
01356     inner(GiNaC::lst v1, GiNaC::lst v2) -> GiNaC::ex
01357     """
01358   return _SyFi.inner(*args)

std::string SyFi::int2string ( int  i)

Definition at line 40 of file utilities.cpp.

        {
                ostringstream os;
                os << i;
                return os.str();
        }
def SyFi.int2string (   args)
int2string(int i) -> std::string

Definition at line 1304 of file SyFi.py.

Referenced by _wrap_int2string(), and replace_powers().

01304 
01305 def int2string(*args):
01306   """int2string(int i) -> std::string"""
01307   return _SyFi.int2string(*args)

GiNaC::lst SyFi::interior_coordinates ( Tetrahedron &  tetrahedra,
unsigned int  d 
)

Definition at line 1434 of file Polygon.cpp.

References lst_to_matrix2(), matrix_to_lst2(), and SyFi::Polygon::vertex().

Referenced by _wrap_interior_coordinates__SWIG_0(), _wrap_interior_coordinates__SWIG_1(), _wrap_interior_coordinates__SWIG_2(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), and interior_coordinates().

        {

                //FIXME: ugly conversion to matrix
                d = d+4;

                lst ret;
                ex V1 = tetrahedra.vertex(0);
                ex V2 = tetrahedra.vertex(1);
                ex V3 = tetrahedra.vertex(2);
                ex V4 = tetrahedra.vertex(3);

                lst V1l = ex_to<lst>(V1);
                lst V2l = ex_to<lst>(V2);
                lst V3l = ex_to<lst>(V3);
                lst V4l = ex_to<lst>(V4);

                ex V1m  = lst_to_matrix2(V1l);
                ex V2m  = lst_to_matrix2(V2l);
                ex V3m  = lst_to_matrix2(V3l);
                ex V4m  = lst_to_matrix2(V4l);

                int l;
                for (unsigned int i=1; i< d; i++)
                {
                        for (unsigned int j=1; j< d; j++)
                        {
                                for (unsigned int k=1; k< d; k++)
                                {
                                        if ( int(d) - int(i) - int(j) - int(k)  >= 1 )
                                        {
                                                l= int(d) - int(i) - int(j) - int(k);
                                                ex sum = (l*V1m + k*V2m + j*V3m + i*V4m)/d;
                                                ret.append(matrix_to_lst2(sum.evalm()));
                                        }
                                }
                        }
                }
                // FIXME how should these be sorted ?????
                //  ret = ret.sort();
                return ret;
        }
GiNaC::lst SyFi::interior_coordinates ( Triangle &  triangle,
unsigned int  d 
)

Definition at line 1513 of file Polygon.cpp.

References lst_to_matrix2(), matrix_to_lst2(), and SyFi::Polygon::vertex().

        {

                //FIXME: ugly conversion to matrix
                //
                d=d+3;

                lst ret;
                ex V1 = triangle.vertex(0);
                ex V2 = triangle.vertex(1);
                ex V3 = triangle.vertex(2);

                lst V1l = ex_to<lst>(V1);
                lst V2l = ex_to<lst>(V2);
                lst V3l = ex_to<lst>(V3);

                ex V1m  = lst_to_matrix2(V1l);
                ex V2m  = lst_to_matrix2(V2l);
                ex V3m  = lst_to_matrix2(V3l);

                int k;
                for (unsigned int i=1; i < d; i++)
                {
                        for (unsigned int j=1; j < d; j++)
                        {
                                if ( int(d) - int(i) - int(j) >= 1  )
                                {
                                        k = d - i - j;
                                        ex sum = (k*V1m + j*V2m + i*V3m)/d;
                                        ret.append(matrix_to_lst2(sum.evalm()));
                                }
                        }
                }
                // FIXME how should these be sorted ?????
                // ret = ret.sort();
                return ret;
        }
GiNaC::lst SyFi::interior_coordinates ( Line &  line,
unsigned int  d 
)

Definition at line 1592 of file Polygon.cpp.

References lst_to_matrix2(), matrix_to_lst2(), and SyFi::Polygon::vertex().

        {

                //FIXME: ugly conversion to matrix
                d = d+2;

                lst ret;
                ex V1 = line.vertex(0);
                ex V2 = line.vertex(1);

                lst V1l = ex_to<lst>(V1);
                lst V2l = ex_to<lst>(V2);

                ex V1m  = lst_to_matrix2(V1l);
                ex V2m  = lst_to_matrix2(V2l);

                int k;
                for (unsigned int i=1; i < d; i++)
                {
                        k = d - i;
                        ex sum = (k*V1m + i*V2m)/d;
                        ret.append(matrix_to_lst2(sum.evalm()));
                }
                // FIXME how should these be sorted ?????
                // ret = ret.sort();
                return ret;
        }
def SyFi.interior_coordinates (   args)
  interior_coordinates(Line line, unsigned int d) -> GiNaC::lst
  interior_coordinates(Triangle triangle, unsigned int d) -> GiNaC::lst
  interior_coordinates(Tetrahedron tetrahedra, unsigned int d) -> GiNaC::lst
  

Definition at line 2000 of file SyFi.py.

References interior_coordinates().

02000 
02001 def interior_coordinates(*args):
02002   """
02003     interior_coordinates(Line line, unsigned int d) -> GiNaC::lst
02004     interior_coordinates(Triangle triangle, unsigned int d) -> GiNaC::lst
02005     interior_coordinates(Tetrahedron tetrahedra, unsigned int d) -> GiNaC::lst
02006     """
02007   return _SyFi.interior_coordinates(*args)

bool SyFi::is_equal ( Ptv a,
Ptv b 
)

Definition at line 132 of file Ptv_tools.cpp.

References Ptv::size(), and Ptv::tol.

Referenced by contains3D(), and line_contains().

        {
                if (a.size() != b.size()) return false;

                for (unsigned int i=0; i < a.size(); i++ )
                {
                        if ( fabs( a[i] - b[i]) > Ptv::tol )
                        {
                                return false;
                        }
                }

                return true;
        }
bool SyFi::is_inside_triangle ( Ptv e0,
Ptv e1,
Ptv e2,
Ptv p 
)

Definition at line 174 of file Ptv_tools.cpp.

References mul(), normalize(), sub(), and Ptv::tol.

Referenced by contains3D().

        {

                Ptv n0;
                sub(e0, p, n0);
                normalize(n0);

                Ptv n1;
                sub(e1, p, n1);
                normalize(n1);

                Ptv n2;
                sub(e2, p, n2);
                normalize(n2);

                double c0 = acos(mul(n0,n1));
                double c1 = acos(mul(n1,n2));
                double c2 = acos(mul(n2,n1));

                if ( fabs(c0 + c1 + c2 - 2*3.1415926535897931) < Ptv::tol) return true;

                return false;
        }
std::string SyFi::istr ( const std::string &  a,
int  b 
)
std::string SyFi::istr ( const std::string &  a,
int  b,
int  c 
)
string SyFi::istr ( const string &  a,
int  b 
)

Definition at line 47 of file utilities.cpp.

        {
                ostringstream s;
                s << a << b;
                return s.str();
        }
string SyFi::istr ( const string &  a,
int  b,
int  c 
)

Definition at line 54 of file utilities.cpp.

References test_syfi::debug::c.

        {
                ostringstream s;
                s << a << b << "_" <<c;
                return s.str();
        }
const GiNaC::symbol& SyFi::isymb ( const std::string &  a,
int  b 
)
const GiNaC::symbol& SyFi::isymb ( const std::string &  a,
int  b,
int  c 
)
const symbol& SyFi::isymb ( const string &  a,
int  b 
)

Definition at line 133 of file syfi/symbol_factory.cpp.

References get_symbol(), and istr().

        {
                return get_symbol(istr(a,b));
        }
const symbol& SyFi::isymb ( const string &  a,
int  b,
int  c 
)

Definition at line 138 of file syfi/symbol_factory.cpp.

References get_symbol(), and istr().

        {
                return get_symbol(istr(a,b,c));
        }
def SyFi.isymb (   args)
  isymb(std::string const & a, int b) -> GiNaC::symbol const
  isymb(std::string const & a, int b, int c) -> GiNaC::symbol const &
  

Definition at line 1520 of file SyFi.py.

Referenced by _wrap_isymb__SWIG_0(), _wrap_isymb__SWIG_1(), get_symbolic_matrix(), get_symbolic_vector(), and main().

01520 
01521 def isymb(*args):
01522   """
01523     isymb(std::string const & a, int b) -> GiNaC::symbol const
01524     isymb(std::string const & a, int b, int c) -> GiNaC::symbol const &
01525     """
01526   return _SyFi.isymb(*args)

GiNaC::ex SyFi::lagrange ( unsigned int  order,
Polygon &  p,
const std::string &  a 
)

Definition at line 528 of file Lagrange.cpp.

References get_symbolic_matrix(), matrix_to_lst2(), SyFi::StandardFE::N(), and SyFi::StandardFE::nbf().

Referenced by _wrap_lagrange(), and lagrange().

        {
                if ( order < 1 )
                {
                        throw(std::logic_error("Can not create polynomials of order less than 1!"));
                }

                GiNaC::ex A;
                GiNaC::ex ret;
                GiNaC::lst basis;

                Lagrange fe(p,order);
                A = get_symbolic_matrix(1, fe.nbf(), a);

                for (unsigned int i=0; i<fe.nbf(); i++)
                {
                        ret += A.op(i)*fe.N(i);
                        basis.append(fe.N(i));
                }
                return GiNaC::lst(ret,matrix_to_lst2(A),basis);
        }
def SyFi.lagrange (   args)
lagrange(unsigned int order, Polygon p, std::string const & a) -> GiNaC::ex

Definition at line 2152 of file SyFi.py.

References lagrange().

02152 
02153 def lagrange(*args):
02154   """lagrange(unsigned int order, Polygon p, std::string const & a) -> GiNaC::ex"""
02155   return _SyFi.lagrange(*args)

GiNaC::lst SyFi::lagrangev ( unsigned int  no_fields,
unsigned int  order,
Polygon &  p,
const std::string &  a 
)

Definition at line 550 of file Lagrange.cpp.

References get_symbolic_matrix(), matrix_to_lst2(), SyFi::StandardFE::N(), and SyFi::StandardFE::nbf().

Referenced by _wrap_lagrangev(), and lagrangev().

        {
                if ( order < 1 )
                {
                        throw(std::logic_error("Can not create polynomials of order less than 1!"));
                }

                GiNaC::ex A;
                GiNaC::ex ret;
                GiNaC::lst basis;

                VectorLagrange fe(p,order);
                A = get_symbolic_matrix(1, fe.nbf(), a);

                for (unsigned int i=0; i<fe.nbf(); i++)
                {
                        ret += A.op(i)*fe.N(i);
                        basis.append(fe.N(i));
                }
                return GiNaC::lst(ret,matrix_to_lst2(A),basis);
        }
def SyFi.lagrangev (   args)
lagrangev(unsigned int no_fields, unsigned int order, Polygon p, std::string const & a) -> GiNaC::lst

Definition at line 2156 of file SyFi.py.

References lagrangev().

02156 
02157 def lagrangev(*args):
02158   """lagrangev(unsigned int no_fields, unsigned int order, Polygon p, std::string const & a) -> GiNaC::lst"""
  return _SyFi.lagrangev(*args)
GiNaC::ex SyFi::legendre ( unsigned int  order,
unsigned int  nsd,
const std::string  a 
)
GiNaC::ex SyFi::legendre ( unsigned int  order,
unsigned int  nsd,
const string  s 
)

Definition at line 942 of file ginac_tools.cpp.

References run_tests::f, get_symbolic_matrix(), legendre1D(), matrix_to_lst2(), x, y, and z.

Referenced by _wrap_legendre(), SyFi::Hermite::compute_basis_functions(), legendre(), legendrev(), and main().

{
        using SyFi::x;
        using SyFi::y;
        using SyFi::z;

        // The Legendre polynomials to be used in FiniteElement
        GiNaC::ex leg;
        GiNaC::ex A;
        GiNaC::lst basis;
        int dof;

        GiNaC::ex b;

        // 1D
        if(nsd == 1)
        {
                dof = order+1;
                A = get_symbolic_matrix(1,dof,s);
                int o=0;
                for(GiNaC::const_iterator i = A.begin(); i!=A.end(); ++i)
                {
                        b= legendre1D(x,o);
                        leg+= (*i)*b;
                        basis.append(b);
                        o++;
                }
        }
        // 2D
        /*
        else if(nsd == 2){  // NB: Only for tensor products on TRIANGLES (not boxes)
                / * 2D: structure of coefficients (a_i)
                 * [ a_0           a_1 P_1(x)           a_3 P_2(x)        a_6 P_3(x)
                 * [ a_2 P_1(y)    a_4 P_1(x)*P_1(y)    a_7 P_2(x)*P_1(y)
                 * [ a_5 P_2(y)    a_8 P_1(x)*P_2(y)
        * [ a_9 P_3(y)
        * /
        dof = (order+1)*(order+2)/2;
        A = get_symbolic_matrix(1,dof,s);
        size_t i=0;
        for (int o = 0; o <= order; o++) {
        for (int d = 0; d <= o; d++) {
        b = legendre1D(y,d)*legendre1D(x,o-d);
        leg += A.op(i)*b;
        basis.append(b);
        i++;

        }
        }
        }
        */
        else if(nsd == 2)                        // NB: Only for tensor products on rectangles
        {
                dof = (order+1)*(order+1);
                A = get_symbolic_matrix(1,dof,s);
                size_t i=0;
                for (unsigned int o = 0; o <= order; o++)
                {
                        for (unsigned int d = 0; d <= order; d++)
                        {
                                b = legendre1D(y,d)*legendre1D(x,o);
                                leg += A.op(i)*b;
                                basis.append(b);
                                i++;

                        }
                }
        }

        /* tetrahedron
        else if(nsd==3){
                dof = 0;
                for (int j=0; j<= order; j++) {
                        dof += (j+1)*(j+2)/2;
                }
        A = get_symbolic_matrix(1, dof , s);

        size_t i=0;
        for (int o = 0; o <= order; o++) {
        for (int d = 0; d <= o; d++) {
        for (int f = 0; f <= o; f++) {
        if ( o-d-f >= 0) {
        b = legendre1D(y,f)*legendre1D(z,d)*legendre1D(x,o-d-f);
        leg += A.op(i)*b;
        basis.append(b);
        i++;
        }
        }
        }
        }
        }
        */

        else if(nsd==3)
        {
                dof = (order+1)*(order+1)*(order+1);
                A = get_symbolic_matrix(1, dof , s);

                size_t i=0;
                for (unsigned int o = 0; o <= order; o++)
                {
                        for (unsigned int d = 0; d <= order; d++)
                        {
                                for (unsigned int f = 0; f <= order; f++)
                                {
                                        b = legendre1D(y,f)*legendre1D(z,d)*legendre1D(x,o);
                                        leg += A.op(i)*b;
                                        basis.append(b);
                                        i++;
                                }
                        }
                }
        }
        return GiNaC::lst(leg,matrix_to_lst2(A), basis);
}
def SyFi.legendre (   args)
legendre(unsigned int order, unsigned int nsd, std::string const a) -> GiNaC::ex

Definition at line 1430 of file SyFi.py.

References legendre().

01430 
01431 def legendre(*args):
01432   """legendre(unsigned int order, unsigned int nsd, std::string const a) -> GiNaC::ex"""
01433   return _SyFi.legendre(*args)

GiNaC::ex SyFi::legendre1D ( const GiNaC::symbol  x,
unsigned int  n 
)

Definition at line 928 of file ginac_tools.cpp.

References x.

Referenced by legendre().

{
        GiNaC::ex P;
        // Rodrigue's formula for Legendre polynomial of 1D
        // The interval [-1, 1]
        P=1/(pow(2,n)*GiNaC::factorial(n))*GiNaC::diff(GiNaC::pow((x*x-1),n),x,n);
        // -----------------
        // The interval [0,1]
        //  GiNaC::ex xx = 2*x - 1;
        // P=1/(pow(2,2*n)*GiNaC::factorial(n))*GiNaC::diff(GiNaC::pow((xx*xx-1),n),x,n);
        return P;
}
GiNaC::lst SyFi::legendrev ( unsigned int  no_fields,
unsigned int  order,
unsigned int  nsd,
const std::string  a 
)
GiNaC::lst SyFi::legendrev ( unsigned int  no_fields,
unsigned int  order,
unsigned int  nsd,
const string  a 
)

Definition at line 1059 of file ginac_tools.cpp.

References legendre().

Referenced by _wrap_legendrev(), and legendrev().

{
        GiNaC::lst ret1;                         // contains the polynom
        GiNaC::lst ret2;                         // contains the coefficients
        GiNaC::lst ret3;                         // constains the basis functions
        GiNaC::lst basis_tmp;
        for (unsigned int i=1; i<= no_fields; i++)
        {
                GiNaC::lst basis;
                std::ostringstream s;
                s <<a<<""<<i<<"_";
                GiNaC::ex polspace = legendre(order, nsd, s.str());
                ret1.append(polspace.op(0));
                ret2.append(polspace.op(1));
                basis_tmp = GiNaC::ex_to<GiNaC::lst>(polspace.op(2));
                for (GiNaC::lst::const_iterator basis_iterator = basis_tmp.begin();
                        basis_iterator != basis_tmp.end(); ++basis_iterator)
                {
                        GiNaC::lst tmp_lst;
                        for (unsigned int d=1; d<=no_fields; d++) tmp_lst.append(0);
                        tmp_lst.let_op(i-1) = (*basis_iterator);
                        ret3.append(tmp_lst);
                }
        }
        return GiNaC::lst(ret1,ret2,ret3);
}
def SyFi.legendrev (   args)
legendrev(unsigned int no_fields, unsigned int order, unsigned int nsd, std::string const a) -> GiNaC::lst

Definition at line 1434 of file SyFi.py.

References legendrev().

01434 
01435 def legendrev(*args):
01436   """legendrev(unsigned int no_fields, unsigned int order, unsigned int nsd, std::string const a) -> GiNaC::lst"""
01437   return _SyFi.legendrev(*args)

bool SyFi::line_contains ( Ptv e0,
Ptv e1,
Ptv p 
)

Definition at line 147 of file Ptv_tools.cpp.

References test_syfi::debug::c, cross(), is_equal(), Ptv::less(), norm(), sub(), and Ptv::tol.

Referenced by contains2D(), and contains3D().

        {

                if ( is_equal(e0, p) || is_equal(e1, p) ) return true;

                // vec0 = e1-e0
                Ptv vec0;
                sub(e1,e0, vec0);
                // vec1 = e1-p
                Ptv vec1;
                sub(e1, p, vec1);

                // check if the vec0 and vec1 are parallel
                Ptv c;
                cross(vec0, vec1, c);
                if (norm(c) > Ptv::tol)
                {
                        return false;
                }

                // check whether the edge (e0,e1) contains p .
                if ( e0.less(p) && e1.less(p) ) return false;
                if ( p.less(e0) && p.less(e1) ) return false;

                return true;
        }
std::string SyFi::lst2string ( GiNaC::lst &  l)

Definition at line 61 of file utilities.cpp.

        {

                ostringstream s;
                GiNaC::lst::const_iterator i = l.begin();
                s <<"("<<*i;
                ++i;

                for (; i != l.end() ; ++i)
                {
                        s<< ","<< *i;
                }
                s <<");"<<endl;
                return s.str();
        }
def SyFi.lst2string (   args)
lst2string(GiNaC::lst & l) -> std::string

Definition at line 1315 of file SyFi.py.

Referenced by _wrap_lst2string(), and main().

01315 
01316 def lst2string(*args):
01317   """lst2string(GiNaC::lst & l) -> std::string"""
01318   return _SyFi.lst2string(*args)

GiNaC::lst SyFi::lst_equals ( GiNaC::ex  a,
GiNaC::ex  b 
)

Definition at line 365 of file ginac_tools.cpp.

Referenced by _wrap_lst_equals(), and lst_equals().

        {
                GiNaC::lst ret;
                if ( (GiNaC::is_a<GiNaC::lst>(a)) && (GiNaC::is_a<GiNaC::lst>(b)) /*&& (a.nops() == b.nops())*/ ) {
                for (unsigned int i=0; i<= a.nops()-1; i++)
                {
                        ret.append(b.op(i) == a.op(i));
                }
        }
        else if ( !(GiNaC::is_a<GiNaC::lst>(a)) && !(GiNaC::is_a<GiNaC::lst>(b)))
        {
                ret.append(b == a);
        }
        else if ( !(GiNaC::is_a<GiNaC::lst>(a)) && (GiNaC::is_a<GiNaC::lst>(b)))
        {
                ret.append(b.op(0) == a);
        }
        else
        {
                throw(std::invalid_argument("Make sure that the lists a and b are comparable."));
        }
        return ret;
}
def SyFi.lst_equals (   args)
lst_equals(GiNaC::ex a, GiNaC::ex b) -> GiNaC::lst

Definition at line 1394 of file SyFi.py.

References lst_equals().

01394 
01395 def lst_equals(*args):
01396   """lst_equals(GiNaC::ex a, GiNaC::ex b) -> GiNaC::lst"""
01397   return _SyFi.lst_equals(*args)

GiNaC::ex SyFi::lst_to_matrix2 ( const GiNaC::lst &  l)

Definition at line 287 of file ginac_tools.cpp.

Referenced by _wrap_lst_to_matrix2(), bezier_ordinates(), interior_coordinates(), and lst_to_matrix2().

        {
                GiNaC::lst::const_iterator itr, itc;

                // Find number of rows and columns
                size_t rows = l.nops(), cols = 0;
                for (itr = l.begin(); itr != l.end(); ++itr)
                {
                        if (!GiNaC::is_a<GiNaC::lst>(*itr))
                                //              throw (std::invalid_argument("lst_to_matrix: argument must be a list of lists"));
                                cols = 1;
                        if (itr->nops() > cols)
                                cols = itr->nops();
                }
                // Allocate and fill matrix
                GiNaC::matrix &M = *new GiNaC::matrix(rows, cols);
                M.setflag(GiNaC::status_flags::dynallocated);

                unsigned i;
                for (itr = l.begin(), i = 0; itr != l.end(); ++itr, ++i)
                {
                        unsigned j;
                        if (cols == 1)
                        {
                                M(i, 0) = *itr;
                        }
                        else
                        {
                                for (itc = GiNaC::ex_to<GiNaC::lst>(*itr).begin(), j = 0; itc != GiNaC::ex_to<GiNaC::lst>(*itr).end(); ++itc, ++j)
                                        M(i, j) = *itc;
                        }
                }
                return M;
        }
def SyFi.lst_to_matrix2 (   args)
lst_to_matrix2(GiNaC::lst const & l) -> GiNaC::ex

Definition at line 1386 of file SyFi.py.

References lst_to_matrix2().

01386 
01387 def lst_to_matrix2(*args):
01388   """lst_to_matrix2(GiNaC::lst const & l) -> GiNaC::ex"""
01389   return _SyFi.lst_to_matrix2(*args)

void SyFi::matrix_from_equations ( const GiNaC::ex &  eqns,
const GiNaC::ex &  symbols,
GiNaC::matrix &  A,
GiNaC::matrix &  b 
)

Definition at line 262 of file ginac_tools.cpp.

References test_syfi::debug::c.

Referenced by _wrap_matrix_from_equations(), SyFi::Hermite::compute_basis_functions(), SyFi::Nedelec::compute_basis_functions(), SyFi::Lagrange::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), and matrix_from_equations().

        {
                // build matrix from equation system
                GiNaC::matrix sys(eqns.nops(),symbols.nops());
                GiNaC::matrix rhs(eqns.nops(),1);
                GiNaC::matrix vars(symbols.nops(),1);

                for (size_t r=0; r<eqns.nops(); r++)
                {
                                                                 // lhs-rhs==0
                        const GiNaC::ex eq = eqns.op(r).op(0)-eqns.op(r).op(1);
                        GiNaC::ex linpart = eq;
                        for (size_t c=0; c<symbols.nops(); c++)
                        {
                                const GiNaC::ex co = eq.coeff(GiNaC::ex_to<GiNaC::symbol>(symbols.op(c)),1);
                                linpart -= co*symbols.op(c);
                                sys(r,c) = co;
                        }
                        linpart = linpart.expand();
                        rhs(r,0) = -linpart;
                }
                A = sys;
                b = rhs;
        }
matrix_from_equations(GiNaC::ex const & eqns, GiNaC::ex const & symbols, GiNaC::matrix & A, GiNaC::matrix & b)

Definition at line 1382 of file SyFi.py.

References matrix_from_equations().

01382 
01383 def matrix_from_equations(*args):
01384   """matrix_from_equations(GiNaC::ex const & eqns, GiNaC::ex const & symbols, GiNaC::matrix & A, GiNaC::matrix & b)"""
01385   return _SyFi.matrix_from_equations(*args)

GiNaC::lst SyFi::matrix_to_lst2 ( const GiNaC::ex &  m)

Definition at line 322 of file ginac_tools.cpp.

Referenced by _wrap_matrix_to_lst2(), bernstein(), bezier_ordinates(), homogenous_pol(), interior_coordinates(), lagrange(), lagrangev(), legendre(), matrix_to_lst2(), pol(), and polb().

        {
                if (GiNaC::is_a<GiNaC::matrix>(m))
                {
                        GiNaC::matrix A = GiNaC::ex_to<GiNaC::matrix>(m);
                        int cols = A.cols();
                        int rows = A.rows();

                        GiNaC::lst ret;
                        if ( cols == 1 )
                        {
                                for (unsigned int i=0; i<=A.rows()-1; i++)
                                {
                                        ret.append(A(i,0));
                                }
                        }
                        else if ( rows == 1 )
                        {
                                for (unsigned int i=0; i<=A.cols()-1; i++)
                                {
                                        ret.append(A(0,i));
                                }
                        }
                        else
                        {
                                for (unsigned int i=0; i<=A.rows()-1; i++)
                                {
                                        GiNaC::lst rl;
                                        for (unsigned int j=0; j<=A.cols()-1; j++)
                                        {
                                                rl.append(A(i,j));
                                        }
                                        ret.append(rl);
                                }
                        }
                        return ret;
                }
                else
                {
                        return GiNaC::lst();
                }
        }
def SyFi.matrix_to_lst2 (   args)
matrix_to_lst2(GiNaC::ex const & m) -> GiNaC::lst

Definition at line 1390 of file SyFi.py.

References matrix_to_lst2().

01390 
01391 def matrix_to_lst2(*args):
01392   """matrix_to_lst2(GiNaC::ex const & m) -> GiNaC::lst"""
01393   return _SyFi.matrix_to_lst2(*args)

GiNaC::lst SyFi::matvec ( GiNaC::matrix &  M,
GiNaC::lst &  x 
)

Definition at line 153 of file ginac_tools.cpp.

Referenced by _wrap_matvec__SWIG_0(), _wrap_matvec__SWIG_1(), and matvec().

        {
                GiNaC::lst ret;
                int nr = M.rows();
                int nc = M.cols();
                for (int i = 0; i < nr; i++)
                {
                        GiNaC::ex tmp;
                        for (int j = 0; j < nc; j++)
                        {
                                tmp = tmp +  M(i,j)*(x.op(j));
                        }
                        ret.append(tmp);
                }
                return ret;
        }
GiNaC::ex SyFi::matvec ( GiNaC::ex  A,
GiNaC::ex  x 
)

Definition at line 170 of file ginac_tools.cpp.

References x.

        {
                ex sol;

                if (GiNaC::is_a<GiNaC::matrix>(A) && GiNaC::is_a<GiNaC::matrix>(x))
                {
                        GiNaC::matrix AA = GiNaC::ex_to<GiNaC::matrix>(A);
                        GiNaC::matrix xx = GiNaC::ex_to<GiNaC::matrix>(x);
                        sol = AA.mul(xx);
                }
                else
                {
                        throw std::runtime_error("Invalid argument types, need matrices");
                }
                return sol;
        }
def SyFi.matvec (   args)
  matvec(GiNaC::matrix & M, GiNaC::lst & x) -> GiNaC::lst
  matvec(GiNaC::ex A, GiNaC::ex x) -> GiNaC::ex
  

Definition at line 1363 of file SyFi.py.

References matvec().

01363 
01364 def matvec(*args):
01365   """
01366     matvec(GiNaC::matrix & M, GiNaC::lst & x) -> GiNaC::lst
01367     matvec(GiNaC::ex A, GiNaC::ex x) -> GiNaC::ex
01368     """
01369   return _SyFi.matvec(*args)

double SyFi::mul ( const Ptv a,
const Ptv b 
)

Definition at line 40 of file Ptv_tools.cpp.

References Ptv::size().

Referenced by ex2type(), and is_inside_triangle().

        {
                if ( a.size() != b.size() )
                {
                        throw(std::logic_error("Exception from mul(const Ptv&, const Ptv&):  The dimentions of a and b must be the same."));
                }

                double sum = 0;
                for (unsigned int i=0; i< a.size(); i++)
                {
                        sum += (a[i])*(b[i]);
                }
                return sum;
        }
double SyFi::norm ( const Ptv a)

Definition at line 55 of file Ptv_tools.cpp.

References Ptv::size().

Referenced by line_contains(), normal(), normalize(), and tangent().

        {
                double sum = 0.0;
                for (unsigned int i=0; i < a.size(); i++)
                {
                        sum += a[i]*a[i];
                }

                sum = sqrt(sum);
                return sum;
        }
GiNaC::lst SyFi::normal ( Tetrahedron &  tetrahedron,
unsigned int  i 
)

Definition at line 1951 of file Polygon.cpp.

References cross(), norm(), SyFi::Tetrahedron::triangle(), and SyFi::Polygon::vertex().

Referenced by _wrap_normal__SWIG_0(), _wrap_normal__SWIG_1(), SyFi::Nedelec::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), main(), normal(), and variants().

        {
                // Normal as defined by Maries note
                Triangle triangle = tetrahedron.triangle(i);
                lst      vertex_i   = ex_to<lst>(tetrahedron.vertex(i));
                lst      vertex_0   = ex_to<lst>(triangle.vertex(0));
                lst      vertex_1   = ex_to<lst>(triangle.vertex(1));
                lst      vertex_2   = ex_to<lst>(triangle.vertex(2));

                lst n1(vertex_1.op(0) - vertex_0.op(0),
                        vertex_1.op(1) - vertex_0.op(1),
                        vertex_1.op(2) - vertex_0.op(2));

                lst n2(vertex_2.op(0) - vertex_0.op(0),
                        vertex_2.op(1) - vertex_0.op(1),
                        vertex_2.op(2) - vertex_0.op(2));

                /*
                lst n3(vertex_0.op(0) - vertex_i.op(0),
                           vertex_0.op(1) - vertex_i.op(1),
                           vertex_0.op(2) - vertex_i.op(2));
                */

                lst n4 = cross(n1,n2);
                /*
                ex nn = inner(n3, n4);
                int sign = 1;
                if ( is_a<numeric>(nn)) {
                  if ( nn > 0 ) {
                        sign = 1;
                } else if ( nn < 0) {
                sign = -1;
                } else {
                sign = 0;
                }
                }
                */

                ex norm = sqrt(pow(n4.op(0),2)
                        + pow(n4.op(1),2)
                        + pow(n4.op(2),2));

                n4.let_op(0) = n4.op(0)/norm;
                n4.let_op(1) = n4.op(1)/norm;
                n4.let_op(2) = n4.op(2)/norm;

                return n4;

        }
GiNaC::lst SyFi::normal ( Triangle &  triangle,
unsigned int  i 
)

Definition at line 2001 of file Polygon.cpp.

References SyFi::Triangle::line(), norm(), and SyFi::Polygon::vertex().

        {
                Line line = triangle.line(i);
                lst      vertex_i   = ex_to<lst>(triangle.vertex(i));
                lst      vertex_0   = ex_to<lst>(line.vertex(0));
                lst      vertex_1   = ex_to<lst>(line.vertex(1));

                /*
                lst n1 = lst (- (vertex_1.op(1) - vertex_0.op(1)),  vertex_1.op(0) - vertex_0.op(0) );
                lst n2 = lst (vertex_0.op(0) - vertex_i.op(0),   vertex_0.op(1) - vertex_i.op(1));

                ex nn = inner(n1, n2);
                int sign = 1;
                / *
                        if ( is_a<numeric>(nn)) {
                          if ( nn > 0 ) {
                                sign = 1;
                          } else if ( nn < 0) {
                                sign = -1;
                } else {
                sign = 0;
                }
                }

                ex norm = sqrt(pow(n1.op(0),2) + pow(n1.op(1),2));
                n1.let_op(0) = sign*n1.op(0)/norm;
                n1.let_op(1) = sign*n1.op(1)/norm;
                */

                // normal vector as Marie has defined them
                lst n1 = lst (  (vertex_1.op(1) - vertex_0.op(1)),
                        -(vertex_1.op(0) - vertex_0.op(0)) );

                ex norm = sqrt(pow(n1.op(0),2) + pow(n1.op(1),2));
                n1.let_op(0) = n1.op(0)/norm;
                n1.let_op(1) = n1.op(1)/norm;

                return n1;
        }
def SyFi.normal (   args)
  normal(Triangle arg1, unsigned int i) -> GiNaC::lst
  normal(Tetrahedron arg1, unsigned int i) -> GiNaC::lst
  

Definition at line 2016 of file SyFi.py.

References normal().

02016 
02017 def normal(*args):
02018   """
02019     normal(Triangle arg1, unsigned int i) -> GiNaC::lst
02020     normal(Tetrahedron arg1, unsigned int i) -> GiNaC::lst
02021     """
02022   return _SyFi.normal(*args)

void SyFi::normalize ( Ptv a)

Definition at line 67 of file Ptv_tools.cpp.

References norm(), and Ptv::size().

Referenced by is_inside_triangle().

        {
                double invn = 1.0/norm(a);
                for (unsigned int i=0; i< a.size(); i++)
                {
                        a[i] *= invn;
                }
        }
std::ostream & SyFi::operator<< ( std::ostream &  os,
const OrderedPtvSet &  p 
)

Definition at line 118 of file OrderedPtvSet.cpp.

References SyFi::OrderedPtvSet::size().

        {
                if (p.size() >= 1)
                {
                        os <<"[";
                        for (unsigned int i=0; i< p.size()-1; i++)
                        {
                                os <<p[i]<<",";
                        }
                        os <<p[p.size()-1]<<"]";
                }
                else
                {
                        os <<"OrderedPtvSet not created properly"<<std::endl;
                }
                return os;
        }
std::ostream & SyFi::operator<< ( std::ostream &  os,
const OrderedPtvSet_i &  p 
)

Definition at line 198 of file OrderedPtvSet.cpp.

References SyFi::OrderedPtvSet_i::get_i(), SyFi::OrderedPtvSet_i::get_OrderedPtvSet(), and SyFi::OrderedPtvSet_i::size().

        {
                cout <<p.get_OrderedPtvSet();
                if (p.size() >= 1)
                {
                        os <<",[";
                        for (unsigned int i=0; i< p.size()-1; i++)
                        {
                                os <<p.get_i(i)<<",";
                        }
                        os <<p.get_i(p.size()-1)<<"]";
                }
                else
                {
                        os <<"OrderedPtvSet_i not created properly"<<std::endl;
                }
                return os;
        }
GiNaC::ex SyFi::pol ( unsigned int  order,
unsigned int  nsd,
const std::string  a 
)
GiNaC::ex SyFi::pol ( unsigned int  order,
unsigned int  nsd,
const string  a 
)

Definition at line 613 of file ginac_tools.cpp.

References run_tests::f, get_symbolic_matrix(), matrix_to_lst2(), x, y, and z.

Referenced by _wrap_pol(), bernsteinv(), SyFi::Hermite::compute_basis_functions(), SyFi::Lagrange::compute_basis_functions(), main(), pol(), and polv().

{
        using SyFi::x;
        using SyFi::y;
        using SyFi::z;

        GiNaC::ex ret;                           // ex to return
        int dof;                                         // degrees of freedom
        GiNaC::ex A;                             // ex holding the coefficients a_0 .. a_dof
        GiNaC::lst basis;

        if (nsd == 1)
        {
                /* 1D:
                 * P^n = a_0 + a_1*x + .... + a_n*x^n
                 * dof : n+1
                 */
                dof = order+1;
                A = get_symbolic_matrix(1,dof, a);
                int o=0;
                for (GiNaC::const_iterator i = A.begin(); i != A.end(); ++i)
                {
                        ret += (*i)*pow(x,o);
                        basis.append(pow(x,o));
                        o++;
                }
        }
        else if ( nsd == 2)
        {

                /* 2D: structure of coefficients (a_i)
                 * [ a_0      a_1 x     a_3 x^2     a_6 x^3
                 * [ a_2 y    a_4 xy    a_7 x^2y
                 * [ a_5 y^2  a_8 xy^2
                 * [ a_9 y^3
                 */
                dof = (order+1)*(order+2)/2;
                A = get_symbolic_matrix(1, dof , a);

                size_t i=0;
                for (unsigned int o = 0; o <= order; o++)
                {
                        for (unsigned int d = 0; d <= o; d++)
                        {
                                ret += A.op(i)*pow(y,d)*pow(x,o-d);
                                basis.append(pow(y,d)*pow(x,o-d));
                                i++;
                        }
                }
        }
        else if (nsd == 3)
        {

                /* Similar structure as in 2D, but
                 * structured as a tetraheder, i.e.,
                 *   a_o + a_1 x + a_2 y + a_3 z
                 * + a_4 x^2 + a_5 xy +
                 */
                dof = 0;
                for (unsigned int j=0; j<= order; j++)
                {
                        dof += (j+1)*(j+2)/2;
                }
                A = get_symbolic_matrix(1, dof , a);

                size_t i=0;
                for (unsigned int o = 0; o <= order; o++)
                {
                        for (unsigned int d = 0; d <= o; d++)
                        {
                                for (unsigned int f = 0; f <= o; f++)
                                {
                                        if ( int(o)-int(d)-int(f) >= 0)
                                        {
                                                ret += A.op(i)*pow(y,f)*pow(z,d)*pow(x,o-d-f);
                                                basis.append(pow(y,f)*pow(z,d)*pow(x,o-d-f));
                                                i++;
                                        }
                                }
                        }
                }
        }
        return GiNaC::lst(ret,matrix_to_lst2(A), basis);
}
def SyFi.pol (   args)
pol(unsigned int order, unsigned int nsd, std::string const a) -> GiNaC::ex

Definition at line 1410 of file SyFi.py.

References pol().

01410 
01411 def pol(*args):
01412   """pol(unsigned int order, unsigned int nsd, std::string const a) -> GiNaC::ex"""
01413   return _SyFi.pol(*args)

GiNaC::exmap SyFi::pol2basisandcoeff ( GiNaC::ex  e,
GiNaC::ex  s 
)

Definition at line 878 of file ginac_tools.cpp.

References test_syfi::debug::c.

Referenced by _wrap_pol2basisandcoeff__SWIG_0(), _wrap_pol2basisandcoeff__SWIG_1(), SyFi::Nedelec::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), and pol2basisandcoeff().

{
        if (GiNaC::is_a<GiNaC::symbol>(s))
        {
                GiNaC::symbol ss = GiNaC::ex_to<GiNaC::symbol>(s);
                e = expand(e);
                GiNaC::ex c;
                GiNaC::ex b;
                GiNaC::exmap map;
                for (int i=e.ldegree(ss); i<=e.degree(ss); ++i)
                {
                        c = e.coeff(ss,i);
                        b = pow(ss,i);
                        map[b] = c;
                }
                return map;
        }
        else
        {
                throw(std::invalid_argument("The second argument must be a symbol."));
        }
}
GiNaC::exmap SyFi::pol2basisandcoeff ( GiNaC::ex  e)

Definition at line 902 of file ginac_tools.cpp.

References test_syfi::debug::c, x, y, and z.

{
        using SyFi::x;
        using SyFi::y;
        using SyFi::z;

        e = expand(e);
        GiNaC::ex c;
        GiNaC::ex b;
        GiNaC::exmap map;
        for (int i=e.ldegree(x); i<=e.degree(x); ++i)
        {
                for (int j=e.ldegree(y); j<=e.degree(y); ++j)
                {
                        for (int k=e.ldegree(z); k<=e.degree(z); ++k)
                        {
                                c = e.coeff(x,i).coeff(y, j).coeff(z,k);
                                b = pow(x,i)*pow(y,j)*pow(z,k);
                                map[b] = c;
                        }
                }
        }
        return map;
}
def SyFi.pol2basisandcoeff (   args)
  pol2basisandcoeff(GiNaC::ex e) -> GiNaC::exmap
  pol2basisandcoeff(GiNaC::ex e, GiNaC::ex s) -> GiNaC::exmap
  

Definition at line 1449 of file SyFi.py.

References pol2basisandcoeff().

01449 
01450 def pol2basisandcoeff(*args):
01451   """
01452     pol2basisandcoeff(GiNaC::ex e) -> GiNaC::exmap
01453     pol2basisandcoeff(GiNaC::ex e, GiNaC::ex s) -> GiNaC::exmap
01454     """
01455   return _SyFi.pol2basisandcoeff(*args)

GiNaC::ex SyFi::polb ( unsigned int  order,
unsigned int  nsd,
const std::string  a 
)
GiNaC::ex SyFi::polb ( unsigned int  order,
unsigned int  nsd,
const string  a 
)

Definition at line 738 of file ginac_tools.cpp.

References run_tests::f, get_symbolic_matrix(), matrix_to_lst2(), x, y, and z.

Referenced by _wrap_polb(), and polb().

{
        using SyFi::x;
        using SyFi::y;
        using SyFi::z;

        GiNaC::ex ret;                           // ex to return
        int dof;                                         // degrees of freedom
        GiNaC::ex A;                             // ex holding the coefficients a_0 .. a_dof
        GiNaC::lst basis;

        if (nsd == 1)
        {
                /* 1D:
                 * P^n = a_0 + a_1*x + .... + a_n*x^n
                 * dof : n+1
                 */
                dof = order+1;
                A = get_symbolic_matrix(1,dof, a);
                int o=0;
                for (GiNaC::const_iterator i = A.begin(); i != A.end(); ++i)
                {
                        ret += (*i)*pow(x,o);
                        basis.append(pow(x,o));
                        o++;
                }
        }
        else if ( nsd == 2)
        {

                /* 2D: structure of coefficients (a_i)
                 * [ a_0      a_1 x     a_3 x^2     a_6 x^3
                 * [ a_2 y    a_4 xy    a_7 x^2y
                 * [ a_5 y^2  a_8 xy^2
                 * [ a_9 y^3
                 */

                dof = (order+1)*(order+1);
                A = get_symbolic_matrix(1, dof , a);

                size_t i=0;
                for (unsigned int o = 0; o <= order; o++)
                {
                        for (unsigned int d = 0; d <= order; d++)
                        {
                                ret += A.op(i)*pow(y,d)*pow(x,o);
                                basis.append(pow(y,d)*pow(x,o));
                                i++;
                        }
                }
        }
        else if (nsd == 3)
        {

                /* Similar structure as in 2D, but
                 * structured as a tetraheder, i.e.,
                 *   a_o + a_1 x + a_2 y + a_3 z
                 * + a_4 x^2 + a_5 xy +
                 */
                dof = (order+1)*(order+1)*(order+1);
                A = get_symbolic_matrix(1, dof , a);

                size_t i=0;
                for (unsigned int o = 0; o <= order; o++)
                {
                        for (unsigned int d = 0; d <= order; d++)
                        {
                                for (unsigned int f = 0; f <= order; f++)
                                {
                                        ret += A.op(i)*pow(y,f)*pow(z,d)*pow(x,o);
                                        basis.append(pow(y,f)*pow(z,d)*pow(x,o));
                                        i++;
                                }
                        }
                }
        }

        return GiNaC::lst(ret,matrix_to_lst2(A), basis);
}
def SyFi.polb (   args)
polb(unsigned int order, unsigned int nsd, std::string const a) -> GiNaC::ex

Definition at line 1418 of file SyFi.py.

References polb().

01418 
01419 def polb(*args):
01420   """polb(unsigned int order, unsigned int nsd, std::string const a) -> GiNaC::ex"""
01421   return _SyFi.polb(*args)

GiNaC::lst SyFi::polv ( unsigned int  no_fields,
unsigned int  order,
unsigned int  nsd,
const std::string  a 
)
GiNaC::lst SyFi::polv ( unsigned int  no_fields,
unsigned int  order,
unsigned int  nsd,
const string  a 
)

Definition at line 699 of file ginac_tools.cpp.

References pol().

Referenced by _wrap_polv(), and polv().

{
        GiNaC::lst ret1;                         // contains the polynom
        GiNaC::lst ret2;                         // contains the coefficients
        GiNaC::lst ret3;                         // constains the basis functions
        GiNaC::lst basis_tmp;
        for (unsigned int i=0; i< no_fields; i++)
        {
                GiNaC::lst basis;
                std::ostringstream s;
                s <<a<<""<<i<<"_";
                GiNaC::ex polspace = pol(order, nsd, s.str());
                ret1.append(polspace.op(0));
                ret2.append(polspace.op(1));
                basis_tmp = GiNaC::ex_to<GiNaC::lst>(polspace.op(2));
                for (GiNaC::lst::const_iterator basis_iterator = basis_tmp.begin();
                        basis_iterator != basis_tmp.end(); ++basis_iterator)
                {
                        GiNaC::lst tmp_lst;
                        for (unsigned int d=1; d<=no_fields; d++) tmp_lst.append(0);
                        tmp_lst.let_op(i) = (*basis_iterator);
                        ret3.append(tmp_lst);
                }
        }
        return GiNaC::lst(ret1,ret2,ret3);

        /* Old Code:
           GiNaC::lst ret;
           for (int i=1; i<= nsd; i++) {
           std::ostringstream s;
           s <<a<<"^"<<i<<"_";
           GiNaC::ex p = pol(order, nsd, s.str());
        ret.append(p);
        }
        return ret;
        */
}
def SyFi.polv (   args)
polv(unsigned int no_fields, unsigned int order, unsigned int nsd, std::string const a) -> GiNaC::lst

Definition at line 1414 of file SyFi.py.

References polv().

01414 
01415 def polv(*args):
01416   """polv(unsigned int no_fields, unsigned int order, unsigned int nsd, std::string const a) -> GiNaC::lst"""
01417   return _SyFi.polv(*args)

void SyFi::print ( GiNaC::lst &  l)

Definition at line 89 of file utilities.cpp.

        {
                //  for (GiNaC::lst::const_iterator i = l.begin(); i != l.end(); ++i)
                //    cout << *i << endl;
                //
                GiNaC::lst::const_iterator i = l.begin();
                cout <<"GiNaC::lst("<<*i;
                ++i;

                for (; i != l.end() ; ++i)
                {
                        cout << ","<< *i;
                }
                cout <<");"<<endl;
        }
void SyFi::print ( GiNaC::exvector &  v)

Definition at line 105 of file utilities.cpp.

        {
                cout <<"v=[";
                for (unsigned int i=0; i< v.size()-1; i++)
                {
                        cout <<v[i]<<"," <<endl;
                }
                cout <<v[v.size()-1]<< "]"<<endl;
        }
void SyFi::print ( std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > &  A)

Definition at line 115 of file utilities.cpp.

        {
                map<std::pair<unsigned int,unsigned int>,GiNaC::ex>::iterator iter;
                for (iter = A.begin(); iter != A.end() ; iter++)
                {
                        cout <<"A["<<(*iter).first.first<<","<<(*iter).first.second<<"]="<<(*iter).second<<endl;
                }
        }
void SyFi::print ( ex_int_map  map)

Definition at line 124 of file utilities.cpp.

References SyFi.ex_int_map::begin(), test_syfi::debug::c, and SyFi.ex_int_map::end().

        {
                GiNaC::ex b;
                int c=0;
                ex_int_map::iterator iter;
                iter = map.begin();
                cout <<"{";
                for (iter = map.begin(); iter != map.end(); iter++)
                {
                        b = (*iter).first; c = map[b];
                        cout <<", "<<b<<":"<<c;
                }
                cout <<"}"<<endl;
        }
void SyFi::print ( GiNaC::exmap  map)

Definition at line 139 of file utilities.cpp.

References test_syfi::debug::c.

        {
                GiNaC::ex b;
                GiNaC::ex c;
                GiNaC::exmap::iterator iter;
                cout <<"{" <<b<<":"<<c;
                for (iter = map.begin(); iter != map.end(); iter++)
                {
                        b = (*iter).first; c = map[b];
                        cout <<", "<<b<<":"<<c;
                }
                cout <<"}"<<endl;
        }
GiNaC::ex SyFi::replace_powers ( const GiNaC::ex &  e,
const std::list< GiNaC::symbol > &  symbols,
std::list< symexpair > &  sel,
const std::string &  tmpsymbolprefix = "p_" 
)
ex SyFi::replace_powers ( const ex &  ein,
const list< symbol > &  symbols,
list< symexpair > &  sel,
const string &  tmpsymbolprefix 
)

Definition at line 1394 of file ginac_tools.cpp.

References get_symbol(), and int2string().

Referenced by _wrap_replace_powers__SWIG_0(), _wrap_replace_powers__SWIG_1(), replace_powers(), and variants().

{
        ex e = ein;
        // build power expressions
        list<symbol>::const_iterator it = symbols.begin();
        for(; it != symbols.end(); it++)
        {
                int deg      = e.degree(*it);
                if(deg > 0)
                {
                        symbol sym   = ex_to<symbol>(*it);
                        string sname = tmpsymbolprefix + sym.get_name();

                        // make list of new symbols
                        vector<symbol> symbols(deg);
                        symbols[0] = sym;
                        for(int i=1; i<deg; i++)
                        {
                                symbols[i] = get_symbol( sname + int2string(i+1) );
                                sel.push_back(make_pair(symbols[i], symbols[i-1]*sym));
                        }

                        // with highest order first, subs in e
                        ex prod = sym;
                        for(int i=deg-1; i>=1; i--)
                        {
                                e = e.subs(power(sym,i+1) == symbols[i], subs_options::algebraic);
                        }
                }
        }
        return e;
}
def SyFi.replace_powers (   args)
  replace_powers(GiNaC::ex const & e, std::list< GiNaC::symbol,std::allocator< GiNaC::symbol > > const & symbols, 
      symexlist sel, std::string const & tmpsymbolprefix="p_") -> GiNaC::ex
  replace_powers(GiNaC::ex const & e, std::list< GiNaC::symbol,std::allocator< GiNaC::symbol > > const & symbols, 
      symexlist sel) -> GiNaC::ex
  

Definition at line 1499 of file SyFi.py.

References replace_powers().

01499 
01500 def replace_powers(*args):
01501   """
01502     replace_powers(GiNaC::ex const & e, std::list< GiNaC::symbol,std::allocator< GiNaC::symbol > > const & symbols, 
01503         symexlist sel, std::string const & tmpsymbolprefix="p_") -> GiNaC::ex
01504     replace_powers(GiNaC::ex const & e, std::list< GiNaC::symbol,std::allocator< GiNaC::symbol > > const & symbols, 
01505         symexlist sel) -> GiNaC::ex
01506     """
01507   return _SyFi.replace_powers(*args)

void SyFi::set_tolerance ( double  tolerance)

Definition at line 35 of file Ptv_tools.cpp.

References Ptv::tol.

        {
                Ptv::tol = tolerance;
        }
def SyFi.setDigits (   args)
setDigits(int a)

Definition at line 85 of file SyFi.py.

00085 
00086 def setDigits(*args):
00087   """setDigits(int a)"""
  return _SyFi.setDigits(*args)
void SyFi::sort_vector ( vector< Ptv > &  a)

Definition at line 30 of file Ptv_tools.cpp.

        {
                sort(a.begin(), a.end(), Ptv_is_less());
        }
void SyFi::sub ( const Ptv a,
const Ptv b,
Ptv c 
)

Definition at line 90 of file Ptv_tools.cpp.

References Ptv::redim(), and Ptv::size().

Referenced by SyFi::CrouzeixRaviart::compute_basis_functions(), is_inside_triangle(), and line_contains().

        {
                if ( a.size() != b.size() )
                {
                        throw(std::logic_error("Exception from add(const Ptv&, const Ptv&, Ptv&):  The dimentions of a and b must be the same."));
                }

                c.redim(a.size());
                for (unsigned int i=0; i< c.size(); i++)
                {
                        c[i] = a[i] - b[i];
                }
        }

Definition at line 15 of file SyFi.py.

00015 
00016     def swig_import_helper():
00017         from os.path import dirname
00018         import imp
00019         fp = None
00020         try:
00021             fp, pathname, description = imp.find_module('_SyFi', [dirname(__file__)])
00022         except ImportError:
00023             import _SyFi
00024             return _SyFi
00025         if fp is not None:
00026             try:
00027                 _mod = imp.load_module('_SyFi', fp, pathname, description)
00028             finally:
00029                 fp.close()
            return _mod
bool SyFi::symbol_exists ( const std::string &  name)
bool SyFi::symbol_exists ( const string &  name)

Definition at line 118 of file syfi/symbol_factory.cpp.

References symbol_collection.

        {
                return symbol_collection.find(name) != symbol_collection.end();
        }
def SyFi.symbol_exists (   args)
symbol_exists(std::string const & name) -> bool

Definition at line 1512 of file SyFi.py.

Referenced by _wrap_symbol_exists(), and main().

01512 
01513 def symbol_exists(*args):
01514   """symbol_exists(std::string const & name) -> bool"""
01515   return _SyFi.symbol_exists(*args)

GiNaC::symbol SyFi::t ( "(t is not initialized since initSyFi has never been called)"  )
def SyFi.tangent (   args)
tangent(Triangle arg1, unsigned int i) -> GiNaC::lst

Definition at line 2023 of file SyFi.py.

References tangent().

02023 
02024 def tangent(*args):
02025   """tangent(Triangle arg1, unsigned int i) -> GiNaC::lst"""
  return _SyFi.tangent(*args)
GiNaC::lst SyFi::tangent ( Triangle &  triangle,
unsigned int  i 
)

Definition at line 2041 of file Polygon.cpp.

References SyFi::Triangle::line(), norm(), and SyFi::Polygon::vertex().

Referenced by _wrap_tangent(), SyFi::Nedelec::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), and tangent().

        {
                /*
                Line line = triangle.line(i);
                //FIXME: 5 lines to compute the tangent vector, these should
                // be put somewhere else.
                GiNaC::symbol t("t");
                ex line_repr = line.repr(t);
                ex t1 = line_repr.op(0).rhs().coeff(t,1);
                ex t2 = line_repr.op(1).rhs().coeff(t,1);
                ex norm = sqrt(pow(t1,2) + pow(t2,2));
                lst tangent = lst(t1/norm,t2/norm);
                return tangent;
                */
                /*
                ex t1, t2;
                if ( i == 0 ) {
                  t1 = triangle.vertex(2).op(0) - triangle.vertex(1).op(0);
                  t2 = triangle.vertex(2).op(1) - triangle.vertex(1).op(1);
                } else if ( i == 1 ) {
                t1 = triangle.vertex(0).op(0) - triangle.vertex(2).op(0);
                t2 = triangle.vertex(0).op(1) - triangle.vertex(2).op(1);
                } else if ( i == 2 ) {
                t1 = triangle.vertex(1).op(0) - triangle.vertex(0).op(0);
                t2 = triangle.vertex(1).op(1) - triangle.vertex(0).op(1);
                } else {
                throw(std::out_of_range("The side index is out of range!"));
                }
                */
                Line line = triangle.line(i);
                ex t1 = line.vertex(1).op(0) - line.vertex(0).op(0);
                ex t2 = line.vertex(1).op(1) - line.vertex(0).op(1);

                ex norm = sqrt(pow(t1,2) + pow(t2,2));
                lst tangent = lst(t1/norm,t2/norm);
                return tangent;

        }
void SyFi::usage ( FE &  fe)

Definition at line 27 of file ElementComputations.cpp.

References SyFi::FE::dof(), grad(), SyFi::FE::N(), and SyFi::FE::nbf().

Referenced by usage().

        {
                for (unsigned int i=0; i< fe.nbf(); i++)
                {
                        cout <<"fe.N("<<i<<")         =   "<<fe.N(i)<<endl;
                        cout <<"grad(fe.N("<<i<<"))   =   "<<grad(fe.N(i))<<endl;
                        cout <<"fe.dof("<<i<<")       =   "<<fe.dof(i)<<endl;
                }
        }
void SyFi::usage ( FE &  v_fe,
FE &  p_fe 
)

Definition at line 37 of file ElementComputations.cpp.

References SyFi::FE::dof(), grad(), SyFi::FE::N(), and SyFi::FE::nbf().

        {
                for (unsigned int i=0; i< v_fe.nbf(); i++)
                {
                        cout <<"v_fe.N("<<i<<")         =   "<<v_fe.N(i)<<endl;
                        cout <<"grad(v_fe.N("<<i<<"))   =   "<<grad(v_fe.N(i))<<endl;
                        cout <<"v_fe.dof("<<i<<")       =   "<<v_fe.dof(i)<<endl;
                }
                for (unsigned int i=0; i< p_fe.nbf(); i++)
                {
                        cout <<"p_fe.N("<<i<<")=   "<<p_fe.N(i)<<endl;
                        cout <<"p_fe.dof("<<i<<")= "<<p_fe.dof(i)<<endl;
                }
        }
def SyFi.usage (   args)
  usage(FE fe)
  usage(FE v_fe, FE p_fe)
  

Definition at line 2426 of file SyFi.py.

References usage().

02426 
02427 def usage(*args):
02428   """
02429     usage(FE fe)
02430     usage(FE v_fe, FE p_fe)
02431     """
02432   return _SyFi.usage(*args)

void SyFi::visitor_subst_pow ( GiNaC::ex  e,
GiNaC::exmap &  map,
ex_int_map &  intmap,
std::string  a 
)
void SyFi::visitor_subst_pow ( GiNaC::ex  e,
GiNaC::exmap &  map,
ex_int_map &  intmap,
string  a 
)

Definition at line 400 of file ginac_tools.cpp.

Referenced by _wrap_visitor_subst_pow(), and visitor_subst_pow().

{
        static int i=0;
        if (map.find(e) != map.end())
        {
                intmap[e] = intmap[e]+1;
                return;
        }
        if (GiNaC::is_exactly_a<GiNaC::power>(e))
        {
                std::ostringstream s;
                s <<a<<i++;
                map[e] = GiNaC::symbol(s.str());
                intmap[e] = 0;
                for (unsigned int i=0; i< e.nops(); i++)
                {
                        GiNaC::ex e2 = e.op(i);
                        //       cout <<"power e "<<e2<<endl;
                        visitor_subst_pow(e2,map,intmap, a);
                }
        }
        else if (GiNaC::is_a<GiNaC::function>(e))
        {
                std::ostringstream s;
                s <<a<<i++;
                map[e] = GiNaC::symbol(s.str());
                intmap[e] = 0;
                for (unsigned int i=0; i< e.nops(); i++)
                {
                        GiNaC::ex e2 = e.op(i);
                        //       cout <<"function e "<<e2<<endl;
                        visitor_subst_pow(e2,map,intmap, a);
                }
        }
        else if (GiNaC::is_a<GiNaC::mul>(e))
        {
                if (e.nops() > 4 && e.nops() < 10 )
                {
                        std::ostringstream s;
                        s <<a<<i++;
                        map[e] = GiNaC::symbol(s.str());
                        intmap[e] = 0;
                }

                for (unsigned int i=0; i< e.nops(); i++)
                {
                        GiNaC::ex e2 = e.op(i);
                        visitor_subst_pow(e2,map,intmap, a);
                }
        }
        else if (GiNaC::is_a<GiNaC::add>(e))
        {
                for (unsigned int i=0; i< e.nops(); i++)
                {
                        GiNaC::ex e2 = e.op(i);
                        visitor_subst_pow(e2,map,intmap,a);
                }
        }
}
def SyFi.visitor_subst_pow (   args)
visitor_subst_pow(GiNaC::ex e, GiNaC::exmap & map, ex_int_map intmap, std::string a)

Definition at line 1406 of file SyFi.py.

References visitor_subst_pow().

01406 
01407 def visitor_subst_pow(*args):
01408   """visitor_subst_pow(GiNaC::ex e, GiNaC::exmap & map, ex_int_map intmap, std::string a)"""
01409   return _SyFi.visitor_subst_pow(*args)

GiNaC::symbol SyFi::x ( "(x is not initialized since initSyFi has never been called)"  )
GiNaC::symbol SyFi::y ( "(y is not initialized since initSyFi has never been called)"  )
GiNaC::symbol SyFi::z ( "(z is not initialized since initSyFi has never been called)"  )

Variable Documentation

int SyFi::_newclass = 0

Definition at line 71 of file SyFi.py.

Definition at line 30 of file SyFi.py.

SyFi::cvar = _SyFi.cvar

Definition at line 1490 of file SyFi.py.

SyFi::GINACLIB_MAJOR_VERSION = _SyFi.GINACLIB_MAJOR_VERSION

Definition at line 88 of file SyFi.py.

SyFi::GINACLIB_MICRO_VERSION = _SyFi.GINACLIB_MICRO_VERSION

Definition at line 90 of file SyFi.py.

SyFi::GINACLIB_MINOR_VERSION = _SyFi.GINACLIB_MINOR_VERSION

Definition at line 89 of file SyFi.py.

map<string, symbol> SyFi::symbol_collection

Definition at line 116 of file syfi/symbol_factory.cpp.

Referenced by get_symbol(), and symbol_exists().

const int SyFi::version_major = cvar.version_major

Definition at line 1491 of file SyFi.py.

Referenced by Swig_var_version_major_get().

const int SyFi::version_minor = cvar.version_minor

Definition at line 1492 of file SyFi.py.

Referenced by Swig_var_version_minor_get().

GiNaC::symbol SyFi::x

Referenced by _p_SyFi__ArnoldFalkWintherWeakSymPTo_p_SyFi__StandardFE(), _p_SyFi__ArnoldFalkWintherWeakSymSigmaTo_p_SyFi__StandardFE(), _p_SyFi__ArnoldFalkWintherWeakSymUTo_p_SyFi__StandardFE(), _p_SyFi__BoxTo_p_SyFi__Polygon(), _p_SyFi__BubbleTo_p_SyFi__StandardFE(), _p_SyFi__CrouzeixRaviartTo_p_SyFi__StandardFE(), _p_SyFi__DiscontinuousLagrangeTo_p_SyFi__FE(), _p_SyFi__DiscontinuousLagrangeTo_p_SyFi__Lagrange(), _p_SyFi__HermiteTo_p_SyFi__StandardFE(), _p_SyFi__LagrangeTo_p_SyFi__StandardFE(), _p_SyFi__LineTo_p_SyFi__Polygon(), _p_SyFi__MixedFETo_p_SyFi__FE(), _p_SyFi__Nedelec2HdivTo_p_SyFi__StandardFE(), _p_SyFi__NedelecTo_p_SyFi__StandardFE(), _p_SyFi__P0To_p_SyFi__StandardFE(), _p_SyFi__RaviartThomasTo_p_SyFi__StandardFE(), _p_SyFi__RectangleTo_p_SyFi__Polygon(), _p_SyFi__ReferenceBoxTo_p_SyFi__Box(), _p_SyFi__ReferenceLineTo_p_SyFi__Line(), _p_SyFi__ReferenceRectangleTo_p_SyFi__Rectangle(), _p_SyFi__ReferenceTetrahedronTo_p_SyFi__Tetrahedron(), _p_SyFi__ReferenceTriangleTo_p_SyFi__Triangle(), _p_SyFi__RobustTo_p_SyFi__StandardFE(), _p_SyFi__SimplexTo_p_SyFi__Polygon(), _p_SyFi__SpaceTimeDomainTo_p_SyFi__Polygon(), _p_SyFi__SpaceTimeElementTo_p_SyFi__StandardFE(), _p_SyFi__StandardFETo_p_SyFi__FE(), _p_SyFi__TensorLagrangeTo_p_SyFi__StandardFE(), _p_SyFi__TensorP0To_p_SyFi__StandardFE(), _p_SyFi__TetrahedronTo_p_SyFi__Polygon(), _p_SyFi__TriangleTo_p_SyFi__Polygon(), _p_SyFi__VectorCrouzeixRaviartTo_p_SyFi__StandardFE(), _p_SyFi__VectorDiscontinuousLagrangeTo_p_SyFi__FE(), _p_SyFi__VectorDiscontinuousLagrangeTo_p_SyFi__VectorLagrange(), _p_SyFi__VectorLagrangeTo_p_SyFi__StandardFE(), _p_SyFi__VectorP0To_p_SyFi__StandardFE(), barycenter_line(), barycenter_tetrahedron(), barycenter_triangle(), code_gen2D(), coeff(), coeffs(), SyFi::Hermite::compute_basis_functions(), SyFi::Lagrange::compute_basis_functions(), SyFi::CrouzeixRaviart::compute_basis_functions(), SyFi::Nedelec::compute_basis_functions(), SyFi::Bubble::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::SpaceTimeElement::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), div(), ex2equations(), grad(), homogenous_pol(), initSyFi(), SyFi::SpaceTimeDomain::integrate(), legendre(), legendre1D(), main(), matvec(), pickExpression(), pol(), pol2basisandcoeff(), polb(), Ptv::Ptv(), SyFi::Triangle::repr(), SyFi::Rectangle::repr(), SyFi::Tetrahedron::repr(), SyFi::Box::repr(), SyFi::Simplex::repr(), std_list_Sl_GiNaC_ex_Sg__pop(), std_list_Sl_std_pair_Sl_GiNaC_symbol_Sc_GiNaC_ex_Sg__Sg__pop(), std_map_Sl_GiNaC_ex_Sc_GiNaC_ex_Sc_GiNaC_ex_is_less_Sg____setitem____SWIG_1(), std_map_Sl_GiNaC_ex_Sc_int_Sc_GiNaC_ex_is_less_Sg____setitem____SWIG_1(), std_vector_Sl_GiNaC_ex_Sg__pop(), SWIG_CanCastAsInteger(), Swig_var_x_get(), Swig_var_x_set(), and variants().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines