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 setDigits
def dirac
def int2string
def lst2string
def compare
def EQUAL_OR_DIE
def cross
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 count_symbols
def extract_symbols
def istr
def div
def grad
def compare_archives
def inner
def matvec
def coeffs
def pol2basisandcoeff
def collect_symbols
def count_ops
def initSyFi
def symbol_exists
def get_symbol
def get_symbolic_vector
def get_symbolic_matrix
def replace_powers
def isymb
def barycenter_line
def barycenter_triangle
def barycenter_tetrahedron
def barycenter
def bernstein
def bernsteinv
def tangent
def bezier_ordinates
def interior_coordinates
def normal
def lagrange
def lagrangev
def compute_Poisson_element_matrix
def compute_Stokes_element_matrix
def compute_mixed_Poisson_element_matrix
def usage
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 _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
 SYFILIB_MAJOR_VERSION = _SyFi.SYFILIB_MAJOR_VERSION
 SYFILIB_MINOR_VERSION = _SyFi.SYFILIB_MINOR_VERSION
 SYFILIB_MICRO_VERSION = _SyFi.SYFILIB_MICRO_VERSION
 ExStats_swigregister = _SyFi.ExStats_swigregister
 cvar = _SyFi.cvar
 version_major = cvar.version_major
 version_minor = cvar.version_minor
 version_micro = cvar.version_micro
 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

Typedef Documentation

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

Definition at line 26 of file containers.h.

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

Definition at line 23 of file containers.h.

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

Definition at line 24 of file containers.h.

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

Definition at line 18 of file Dof.h.

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

Definition at line 20 of file containers.h.

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

Definition at line 19 of file containers.h.

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

Definition at line 19 of file Dof.h.


Enumeration Type Documentation

Enumerator:
SUBS_PERFORMED 
SUBS_NOT_PERFORMED 

Definition at line 13 of file Polygon.h.


Function Documentation

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

Definition at line 50 of file SyFi.py.

00051                                        :
00052     if (name == "thisown"): return self.this.own()
00053     method = class_type.__swig_getmethods__.get(name,None)
00054     if method: return method(self)
00055     raise AttributeError(name)

def SyFi::_swig_repr (   self) [private]

Definition at line 56 of file SyFi.py.

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

Definition at line 47 of file SyFi.py.

00048                                              :
00049     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 34 of file SyFi.py.

00035                                                                  :
00036     if (name == "thisown"): return self.this.own(value)
00037     if (name == "this"):
00038         if type(value).__name__ == 'SwigPyObject':
00039             self.__dict__[name] = value
00040             return
00041     method = class_type.__swig_setmethods__.get(name,None)
00042     if method: return method(self,value)
00043     if (not static) or hasattr(self,name):
00044         self.__dict__[name] = value
00045     else:
00046         raise AttributeError("You cannot add attributes to %s" % self)

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

Definition at line 62 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 1734 of file Polygon.cpp.

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

Referenced by _wrap_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 1971 of file SyFi.py.

01972                      :
01973   """barycenter(Simplex simplex) -> GiNaC::ex"""
01974   return _SyFi.barycenter(*args)

def SyFi::barycenter_line (   args)
barycenter_line(GiNaC::ex p0, GiNaC::ex p1) -> GiNaC::ex

Definition at line 1959 of file SyFi.py.

01960                           :
01961   """barycenter_line(GiNaC::ex p0, GiNaC::ex p1) -> GiNaC::ex"""
01962   return _SyFi.barycenter_line(*args)

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

Definition at line 1589 of file Polygon.cpp.

References x.

Referenced by _wrap_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;
        }
GiNaC::ex SyFi::barycenter_line ( GiNaC::ex  p0,
GiNaC::ex  p1 
)
ex SyFi::barycenter_tetrahedron ( ex  p0,
ex  p1,
ex  p2,
ex  p3 
)

Definition at line 1718 of file Polygon.cpp.

References x.

Referenced by _wrap_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;

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

Definition at line 1967 of file SyFi.py.

01968                                  :
01969   """barycenter_tetrahedron(GiNaC::ex p0, GiNaC::ex p1, GiNaC::ex p2, GiNaC::ex p3) -> GiNaC::ex"""
01970   return _SyFi.barycenter_tetrahedron(*args)

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

Definition at line 1657 of file Polygon.cpp.

References barycenter_tetrahedron(), cross(), test::n, and x.

Referenced by _wrap_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 1963 of file SyFi.py.

01964                               :
01965   """barycenter_triangle(GiNaC::ex p0, GiNaC::ex p1, GiNaC::ex p2) -> GiNaC::ex"""
01966   return _SyFi.barycenter_triangle(*args)

GiNaC::ex SyFi::barycenter_triangle ( GiNaC::ex  p0,
GiNaC::ex  p1,
GiNaC::ex  p2 
)
def SyFi::bernstein (   args)
bernstein(unsigned int order, Polygon p, string a) -> GiNaC::ex

Definition at line 1975 of file SyFi.py.

01976                     :
01977   """bernstein(unsigned int order, Polygon p, string a) -> GiNaC::ex"""
01978   return _SyFi.bernstein(*args)

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

Definition at line 1776 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(), bernsteinv(), SyFi::Robust::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Nedelec::compute_basis_functions(), SyFi::Lagrange::compute_basis_functions(), SyFi::CrouzeixRaviart::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);
        }
GiNaC::ex SyFi::bernstein ( unsigned int  order,
Polygon &  p,
const std::string &  a 
)
def SyFi::bernsteinv (   args)
  bernsteinv(unsigned int no_fields, unsigned int order, Polygon p, 
      string a) -> GiNaC::lst
  

Definition at line 1979 of file SyFi.py.

01980                      :
01981   """
01982     bernsteinv(unsigned int no_fields, unsigned int order, Polygon p, 
01983         string a) -> GiNaC::lst
01984     """
01985   return _SyFi.bernsteinv(*args)

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

Definition at line 1883 of file Polygon.cpp.

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

Referenced by _wrap_bernsteinv(), SyFi::Robust::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Nedelec::compute_basis_functions(), SyFi::BrezziDouglasMarini::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);

        }
GiNaC::lst SyFi::bernsteinv ( unsigned int  no_fields,
unsigned int  order,
Polygon &  p,
const std::string &  a 
)
GiNaC::lst SyFi::bezier_ordinates ( Tetrahedron &  tetrahedra,
unsigned int  d 
)

Definition at line 1358 of file Polygon.cpp.

References SyFi_polygons::spacetimedomain::l, 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(), 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 1443 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 1517 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 2030 of file SyFi.py.

02031                            :
02032   """
02033     bezier_ordinates(Line line, unsigned int d) -> GiNaC::lst
02034     bezier_ordinates(Triangle triangle, unsigned int d) -> GiNaC::lst
02035     bezier_ordinates(Tetrahedron tetrahedra, unsigned int d) -> GiNaC::lst
02036     """
02037   return _SyFi.bezier_ordinates(*args)

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

Definition at line 447 of file ginac_tools.cpp.

References find().

Referenced by _wrap_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 1166 of file SyFi.py.

01167                         :
01168   """check_visitor(GiNaC::ex e, GiNaC::lst exlist)"""
01169   return _SyFi.check_visitor(*args)

def SyFi::coeff (   args)
coeff(GiNaC::ex pol) -> GiNaC::exvector

Definition at line 1211 of file SyFi.py.

01212                 :
01213   """coeff(GiNaC::ex pol) -> GiNaC::exvector"""
01214   return _SyFi.coeff(*args)

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

Definition at line 841 of file ginac_tools.cpp.

References x, y, and z.

Referenced by _wrap_coeff(), SyFi::Robust::compute_basis_functions(), SyFi::Nedelec2Hdiv::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;
}
GiNaC::lst SyFi::coeffs ( GiNaC::lst  pols)

Definition at line 805 of file ginac_tools.cpp.

References collapse().

Referenced by _wrap_coeffs__SWIG_0(), and _wrap_coeffs__SWIG_1().

{
        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;
}
def SyFi::coeffs (   args)
  coeffs(GiNaC::ex pol) -> GiNaC::lst
  coeffs(GiNaC::lst pols) -> GiNaC::lst
  

Definition at line 1308 of file SyFi.py.

01309                  :
01310   """
01311     coeffs(GiNaC::ex pol) -> GiNaC::lst
01312     coeffs(GiNaC::lst pols) -> GiNaC::lst
01313     """
01314   return _SyFi.coeffs(*args)

GiNaC::lst SyFi::coeffs ( GiNaC::ex  pol)

Definition at line 818 of file ginac_tools.cpp.

References 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;
}
GiNaC::lst SyFi::collapse ( GiNaC::lst  l)

Definition at line 200 of file ginac_tools.cpp.

Referenced by _wrap_collapse(), coeffs(), SyFi::Robust::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Nedelec::compute_basis_functions(), SyFi::BrezziDouglasMarini::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 1135 of file SyFi.py.

01136                    :
01137   """collapse(GiNaC::lst l) -> GiNaC::lst"""
01138   return _SyFi.collapse(*args)

def SyFi::collect_symbols (   args)
  collect_symbols(GiNaC::ex e, exset v)
  collect_symbols(GiNaC::ex e) -> GiNaC::exvector
  

Definition at line 1322 of file SyFi.py.

01323                           :
01324   """
01325     collect_symbols(GiNaC::ex e, exset v)
01326     collect_symbols(GiNaC::ex e) -> GiNaC::exvector
01327     """
01328   return _SyFi.collect_symbols(*args)
01329 

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

Definition at line 1220 of file ginac_tools.cpp.

References SyFi::exset::insert(), and demo::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 1236 of file ginac_tools.cpp.

References SyFi::exset::begin(), collect_symbols(), SyFi::exset::end(), run::s, SyFi::exset::size(), and demo::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;
}
bool SyFi::compare ( const ex &  e,
const string &  s 
)

Definition at line 1073 of file ginac_tools.cpp.

References test::e, and run::s.

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

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

Definition at line 1119 of file SyFi.py.

01120                   :
01121   """compare(GiNaC::ex e, string s) -> bool"""
01122   return _SyFi.compare(*args)

def SyFi::compare_archives (   args)
  compare_archives(string first, string second, std::ostream os = std::cout) -> bool
  compare_archives(string first, string second) -> bool
  

Definition at line 1285 of file SyFi.py.

01286                            :
01287   """
01288     compare_archives(string first, string second, std::ostream os = std::cout) -> bool
01289     compare_archives(string first, string second) -> bool
01290     """
01291   return _SyFi.compare_archives(*args)

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

Definition at line 1249 of file ginac_tools.cpp.

References extract_symbols(), and test::n.

Referenced by _wrap_compare_archives__SWIG_0(), _wrap_compare_archives__SWIG_1(), check_CrouzeixRaviart(), 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;
}
bool SyFi::compare_archives ( const std::string &  first,
const std::string &  second,
std::ostream &  os = std::cout 
)
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 136 of file ElementComputations.cpp.

References demos::poisson1::Aij, 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(), 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;
                        }
                }
        }
def SyFi::compute_mixed_Poisson_element_matrix (   args)
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<(q(const).std::pair<(unsigned int,unsigned int)>,GiNaC::ex)>)>)> A)

Definition at line 2636 of file SyFi.py.

02637                                                :
02638   """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<(q(const).std::pair<(unsigned int,unsigned int)>,GiNaC::ex)>)>)> A)"""
  return _SyFi.compute_mixed_Poisson_element_matrix(*args)
def SyFi::compute_Poisson_element_matrix (   args)
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<(q(const).std::pair<(unsigned int,unsigned int)>,GiNaC::ex)>)>)> A)

Definition at line 2628 of file SyFi.py.

02629                                          :
02630   """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<(q(const).std::pair<(unsigned int,unsigned int)>,GiNaC::ex)>)>)> A)"""
02631   return _SyFi.compute_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 38 of file ElementComputations.cpp.

References demos::poisson1::Aij, 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().

        {
                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
                        }
                }
        }
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 72 of file ElementComputations.cpp.

References demos::poisson1::Aij, 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(), 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;
                        }
                }
        }
def SyFi::compute_Stokes_element_matrix (   args)
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<(q(const).std::pair<(unsigned int,unsigned int)>,GiNaC::ex)>)>)> A)

Definition at line 2632 of file SyFi.py.

02633                                         :
02634   """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<(q(const).std::pair<(unsigned int,unsigned int)>,GiNaC::ex)>)>)> A)"""
02635   return _SyFi.compute_Stokes_element_matrix(*args)

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

Definition at line 187 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 200 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)
def SyFi::count_ops (   args)
count_ops(GiNaC::ex e) -> ExStats

Definition at line 1330 of file SyFi.py.

01331                     :
01332   """count_ops(GiNaC::ex e) -> ExStats"""
01333   return _SyFi.count_ops(*args)

ExStats SyFi::count_ops ( const ex &  e)

Definition at line 1364 of file ginac_tools.cpp.

References SyFi::ExStatsVisitor::es, and demo::v.

Referenced by _wrap_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_symbols (   args)
count_symbols(GiNaC::ex e) -> GiNaC::exhashmap<(int)>

Definition at line 1215 of file SyFi.py.

01216                         :
01217   """count_symbols(GiNaC::ex e) -> GiNaC::exhashmap<(int)>"""
01218   return _SyFi.count_symbols(*args)

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

Definition at line 1153 of file ginac_tools.cpp.

References SyFi::SymbolCounterVisitor::symbolcount, and demo::v.

Referenced by _wrap_count_symbols(), and print().

{
        SymbolCounterVisitor v;
        e.traverse(v);
        return v.symbolcount;
}
GiNaC::exhashmap<int> SyFi::count_symbols ( const GiNaC::ex &  e)
GiNaC::lst SyFi::cross ( GiNaC::lst &  v1,
GiNaC::lst &  v2 
)

Definition at line 20 of file ginac_tools.cpp.

Referenced by _wrap_cross(), barycenter_triangle(), SyFi::Nedelec::compute_basis_functions(), 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 90 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 1127 of file SyFi.py.

01128                 :
01129   """cross(GiNaC::lst v1, GiNaC::lst v2) -> GiNaC::lst"""
01130   return _SyFi.cross(*args)

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

Definition at line 20 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 1107 of file SyFi.py.

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

01108                 :
01109   """dirac(unsigned int i, unsigned int j) -> int"""
01110   return _SyFi.dirac(*args)

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 1269 of file SyFi.py.

01270               :
01271   """
01272     div(GiNaC::lst v) -> GiNaC::ex
01273     div(GiNaC::lst v, GiNaC::ex G) -> GiNaC::ex
01274     div(GiNaC::ex v) -> GiNaC::ex
01275     div(GiNaC::ex v, GiNaC::ex G) -> GiNaC::ex
01276     """
01277   return _SyFi.div(*args)

GiNaC::ex SyFi::div ( GiNaC::lst &  v,
GiNaC::ex  G 
)

Definition at line 169 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 212 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;
        }
GiNaC::ex SyFi::div ( GiNaC::ex  v)

Definition at line 31 of file diff_tools.cpp.

References SyFi_polygons::spacetimedomain::l, run::m, nsd, demo::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 94 of file diff_tools.cpp.

References div(), SyFi_polygons::spacetimedomain::l, run::m, nsd, demo::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 145 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::symbol SyFi::DUMMY ( "(DUMMY is not initialized since initSyFi has never been called)"  )
void SyFi::EQUAL_OR_DIE ( const ex &  e,
const string &  s 
)

Definition at line 1081 of file ginac_tools.cpp.

References compare().

Referenced by _wrap_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());
        }
}
void SyFi::EQUAL_OR_DIE ( const GiNaC::ex &  e,
const std::string &  s 
)
def SyFi::EQUAL_OR_DIE (   args)
EQUAL_OR_DIE(GiNaC::ex e, string s)

Definition at line 1123 of file SyFi.py.

01124                        :
01125   """EQUAL_OR_DIE(GiNaC::ex e, string s)"""
01126   return _SyFi.EQUAL_OR_DIE(*args)

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

Definition at line 224 of file ginac_tools.cpp.

Referenced by _wrap_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 eqns, GiNaC::ex symbols) -> GiNaC::matrix

Definition at line 1139 of file SyFi.py.

01140                            :
01141   """equations2matrix(GiNaC::ex eqns, GiNaC::ex symbols) -> GiNaC::matrix"""
01142   return _SyFi.equations2matrix(*args)

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

Definition at line 173 of file ginac_tools.cpp.

References SyFi_polygons::spacetimedomain::l, x, y, and z.

Referenced by _wrap_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 1131 of file SyFi.py.

01132                        :
01133   """ex2equations(GiNaC::ex rel) -> GiNaC::lst"""
01134   return _SyFi.ex2equations(*args)

def SyFi::extract_symbols (   args)
extract_symbols(GiNaC::ex e) -> GiNaC::ex

Definition at line 1219 of file SyFi.py.

01220                           :
01221   """extract_symbols(GiNaC::ex e) -> GiNaC::ex"""
  return _SyFi.extract_symbols(*args)
ex SyFi::extract_symbols ( const ex &  e)

Definition at line 1201 of file ginac_tools.cpp.

References SyFi_polygons::spacetimedomain::l, SyFi::SymbolCounterVisitor::symbolcount, and demo::v.

Referenced by _wrap_extract_symbols(), and compare_archives().

{
        // 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;
}
GiNaC::ex SyFi::extract_symbols ( const GiNaC::ex &  e)
string SyFi::exvector2string ( GiNaC::exvector &  v)

Definition at line 63 of file utilities.cpp.

References run::s.

        {
                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 376 of file ginac_tools.cpp.

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

{
        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 1162 of file SyFi.py.

01163                :
01164   """find(GiNaC::ex e, GiNaC::lst list) -> int"""
01165   return _SyFi.find(*args)

def SyFi::get_symbol (   args)
get_symbol(string name) -> GiNaC::symbol

Definition at line 1342 of file SyFi.py.

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

01343                      :
01344   """get_symbol(string name) -> GiNaC::symbol"""
01345   return _SyFi.get_symbol(*args)

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

Definition at line 109 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;
        }
const GiNaC::symbol& SyFi::get_symbol ( const std::string &  name)
def SyFi::get_symbolic_matrix (   args)
get_symbolic_matrix(int m, int n, string basename) -> GiNaC::ex

Definition at line 1350 of file SyFi.py.

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

01351                               :
01352   """get_symbolic_matrix(int m, int n, string basename) -> GiNaC::ex"""
  return _SyFi.get_symbolic_matrix(*args)
GiNaC::ex SyFi::get_symbolic_matrix ( int  m,
int  n,
const std::string &  basename 
)

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

References test::e, isymb(), run::m, and test::n.

        {
                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_vector (   args)
get_symbolic_vector(int m, string basename) -> GiNaC::ex

Definition at line 1346 of file SyFi.py.

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

01347                               :
01348   """get_symbolic_vector(int m, string basename) -> GiNaC::ex"""
01349   return _SyFi.get_symbolic_vector(*args)

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

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

References test::e, isymb(), and run::m.

        {
                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::grad (   args)
  grad(GiNaC::ex f) -> GiNaC::ex
  grad(GiNaC::ex f, GiNaC::ex G) -> GiNaC::ex
  

Definition at line 1278 of file SyFi.py.

01279                :
01280   """
01281     grad(GiNaC::ex f) -> GiNaC::ex
01282     grad(GiNaC::ex f, GiNaC::ex G) -> GiNaC::ex
01283     """
01284   return _SyFi.grad(*args)

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

Definition at line 231 of file diff_tools.cpp.

References demo::f, run::m, 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(), 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 287 of file diff_tools.cpp.

References demo::f, run::m, 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::homogenous_pol (   args)
homogenous_pol(unsigned int order, unsigned int nsd, string a) -> GiNaC::ex

Definition at line 1189 of file SyFi.py.

01190                          :
01191   """homogenous_pol(unsigned int order, unsigned int nsd, string a) -> GiNaC::ex"""
01192   return _SyFi.homogenous_pol(*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 520 of file ginac_tools.cpp.

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

Referenced by _wrap_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_polv (   args)
  homogenous_polv(unsigned int no_fields, unsigned int order, unsigned int nsd, 
      string a) -> GiNaC::lst
  

Definition at line 1193 of file SyFi.py.

01194                           :
01195   """
01196     homogenous_polv(unsigned int no_fields, unsigned int order, unsigned int nsd, 
01197         string a) -> GiNaC::lst
01198     """
01199   return _SyFi.homogenous_polv(*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 571 of file ginac_tools.cpp.

References homogenous_pol(), and run::s.

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

{
        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);
}
GiNaC::symbol SyFi::infinity ( "(infinity is not initialized since initSyFi has never been called)"  )
def SyFi::initSyFi (   args)
initSyFi(unsigned int nsd)

Definition at line 1334 of file SyFi.py.

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

01335                    :
01336   """initSyFi(unsigned int nsd)"""
01337   return _SyFi.initSyFi(*args)

void SyFi::initSyFi ( unsigned int  nsd_)

Definition at line 32 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::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 1292 of file SyFi.py.

01293                 :
01294   """
01295     inner(GiNaC::ex a, GiNaC::ex b, bool transposed = False) -> GiNaC::ex
01296     inner(GiNaC::ex a, GiNaC::ex b) -> GiNaC::ex
01297     inner(GiNaC::exvector v1, GiNaC::exvector v2) -> GiNaC::ex
01298     inner(GiNaC::lst v1, GiNaC::lst v2) -> GiNaC::ex
01299     """
01300   return _SyFi.inner(*args)

GiNaC::ex SyFi::inner ( GiNaC::exvector &  v1,
GiNaC::exvector &  v2 
)

Definition at line 129 of file ginac_tools.cpp.

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

Definition at line 36 of file ginac_tools.cpp.

References demo::a.

Referenced by _wrap_inner__SWIG_0(), _wrap_inner__SWIG_1(), _wrap_inner__SWIG_2(), _wrap_inner__SWIG_3(), SyFi::Robust::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Nedelec::compute_basis_functions(), SyFi::BrezziDouglasMarini::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(), and main().

        {
                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 102 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;
        }
std::string SyFi::int2string ( int  i)

Definition at line 26 of file utilities.cpp.

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

Definition at line 1111 of file SyFi.py.

Referenced by _wrap_int2string(), and replace_powers().

01112                      :
01113   """int2string(int i) -> string"""
01114   return _SyFi.int2string(*args)

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

Definition at line 1400 of file Polygon.cpp.

References SyFi_polygons::spacetimedomain::l, 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::Robust::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), and SyFi::BrezziDouglasMarini::compute_basis_functions().

        {

                //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 ( d - i - j -k  >= 1 )
                                        {
                                                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::interior_coordinates ( Triangle &  triangle,
unsigned int  d 
)

Definition at line 1479 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 1558 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 2038 of file SyFi.py.

02039                                :
02040   """
02041     interior_coordinates(Line line, unsigned int d) -> GiNaC::lst
02042     interior_coordinates(Triangle triangle, unsigned int d) -> GiNaC::lst
02043     interior_coordinates(Tetrahedron tetrahedra, unsigned int d) -> GiNaC::lst
02044     """
02045   return _SyFi.interior_coordinates(*args)

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

Definition at line 118 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 160 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;
        }
string SyFi::istr ( const string &  a,
int  b 
)

Definition at line 33 of file utilities.cpp.

References run::s.

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

Definition at line 40 of file utilities.cpp.

References run::s.

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

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

References get_symbol(), and istr().

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

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

References get_symbol(), and istr().

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

Definition at line 1424 of file SyFi.py.

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

01425                 :
01426   """
01427     isymb(string a, int b) -> GiNaC::symbol
01428     isymb(string a, int b, int c) -> GiNaC::symbol
01429     """
01430   return _SyFi.isymb(*args)

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

Definition at line 514 of file Lagrange.cpp.

References demo::a, demos::crouzeixraviart::fe, get_symbolic_matrix(), matrix_to_lst2(), SyFi::StandardFE::N(), and SyFi::StandardFE::nbf().

Referenced by _wrap_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, string a) -> GiNaC::ex

Definition at line 2203 of file SyFi.py.

02204                    :
02205   """lagrange(unsigned int order, Polygon p, string a) -> GiNaC::ex"""
02206   return _SyFi.lagrange(*args)

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

Definition at line 536 of file Lagrange.cpp.

References demo::a, demos::crouzeixraviart::fe, get_symbolic_matrix(), matrix_to_lst2(), SyFi::StandardFE::N(), and SyFi::StandardFE::nbf().

Referenced by _wrap_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, 
      string a) -> GiNaC::lst
  

Definition at line 2207 of file SyFi.py.

02208                     :
02209   """
02210     lagrangev(unsigned int no_fields, unsigned int order, Polygon p, 
02211         string a) -> GiNaC::lst
02212     """
  return _SyFi.lagrangev(*args)
def SyFi::legendre (   args)
legendre(unsigned int order, unsigned int nsd, string a) -> GiNaC::ex

Definition at line 1200 of file SyFi.py.

01201                    :
01202   """legendre(unsigned int order, unsigned int nsd, string a) -> GiNaC::ex"""
01203   return _SyFi.legendre(*args)

GiNaC::ex SyFi::legendre ( unsigned int  order,
unsigned int  nsd,
const string  s 
)

Definition at line 928 of file ginac_tools.cpp.

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

Referenced by _wrap_legendre(), SyFi::Hermite::compute_basis_functions(), 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);
}
GiNaC::ex SyFi::legendre ( unsigned int  order,
unsigned int  nsd,
const std::string  a 
)
GiNaC::ex SyFi::legendre1D ( const GiNaC::symbol  x,
unsigned int  n 
)

Definition at line 914 of file ginac_tools.cpp.

References test::n, and 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;
}
def SyFi::legendrev (   args)
  legendrev(unsigned int no_fields, unsigned int order, unsigned int nsd, 
      string a) -> GiNaC::lst
  

Definition at line 1204 of file SyFi.py.

01205                     :
01206   """
01207     legendrev(unsigned int no_fields, unsigned int order, unsigned int nsd, 
01208         string a) -> GiNaC::lst
01209     """
01210   return _SyFi.legendrev(*args)

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

Definition at line 1045 of file ginac_tools.cpp.

References legendre(), and run::s.

Referenced by _wrap_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);
}
GiNaC::lst SyFi::legendrev ( unsigned int  no_fields,
unsigned int  order,
unsigned int  nsd,
const std::string  a 
)
bool SyFi::line_contains ( Ptv e0,
Ptv e1,
Ptv p 
)

Definition at line 133 of file Ptv_tools.cpp.

References 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 47 of file utilities.cpp.

References run::s.

        {

                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) -> string

Definition at line 1115 of file SyFi.py.

Referenced by _wrap_lst2string(), and main().

01116                      :
01117   """lst2string(GiNaC::lst l) -> string"""
01118   return _SyFi.lst2string(*args)

def SyFi::lst_equals (   args)
lst_equals(GiNaC::ex a, GiNaC::ex b) -> GiNaC::lst

Definition at line 1158 of file SyFi.py.

01159                      :
01160   """lst_equals(GiNaC::ex a, GiNaC::ex b) -> GiNaC::lst"""
01161   return _SyFi.lst_equals(*args)

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

Definition at line 351 of file ginac_tools.cpp.

References demo::a.

Referenced by _wrap_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;
}
GiNaC::ex SyFi::lst_to_matrix2 ( const GiNaC::lst &  l)

Definition at line 273 of file ginac_tools.cpp.

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

        {
                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 l) -> GiNaC::ex

Definition at line 1150 of file SyFi.py.

01151                          :
01152   """lst_to_matrix2(GiNaC::lst l) -> GiNaC::ex"""
01153   return _SyFi.lst_to_matrix2(*args)

def SyFi::matrix_from_equations (   args)
  matrix_from_equations(GiNaC::ex eqns, GiNaC::ex symbols, GiNaC::matrix A, 
      GiNaC::matrix b)
  

Definition at line 1143 of file SyFi.py.

01144                                 :
01145   """
01146     matrix_from_equations(GiNaC::ex eqns, GiNaC::ex symbols, GiNaC::matrix A, 
01147         GiNaC::matrix b)
01148     """
01149   return _SyFi.matrix_from_equations(*args)

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

Definition at line 248 of file ginac_tools.cpp.

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

        {
                // 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;
        }
def SyFi::matrix_to_lst2 (   args)
matrix_to_lst2(GiNaC::ex m) -> GiNaC::lst

Definition at line 1154 of file SyFi.py.

01155                          :
01156   """matrix_to_lst2(GiNaC::ex m) -> GiNaC::lst"""
01157   return _SyFi.matrix_to_lst2(*args)

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

Definition at line 308 of file ginac_tools.cpp.

References run::m.

Referenced by _wrap_matrix_to_lst2(), bernstein(), bezier_ordinates(), homogenous_pol(), interior_coordinates(), lagrange(), lagrangev(), legendre(), 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();
                }
        }
GiNaC::lst SyFi::matvec ( GiNaC::matrix &  M,
GiNaC::lst &  x 
)

Definition at line 139 of file ginac_tools.cpp.

Referenced by _wrap_matvec__SWIG_0(), and _wrap_matvec__SWIG_1().

        {
                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;
        }
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 1301 of file SyFi.py.

01302                  :
01303   """
01304     matvec(GiNaC::matrix M, GiNaC::lst x) -> GiNaC::lst
01305     matvec(GiNaC::ex A, GiNaC::ex x) -> GiNaC::ex
01306     """
01307   return _SyFi.matvec(*args)

GiNaC::ex SyFi::matvec ( GiNaC::ex  A,
GiNaC::ex  x 
)

Definition at line 156 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;
        }
double SyFi::mul ( const Ptv a,
const Ptv b 
)

Definition at line 26 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 41 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 1917 of file Polygon.cpp.

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

Referenced by _wrap_normal__SWIG_0(), _wrap_normal__SWIG_1(), SyFi::Robust::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Nedelec::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), main(), 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;

        }
def SyFi::normal (   args)
  normal(Triangle arg0, unsigned int i) -> GiNaC::lst
  normal(Tetrahedron arg0, unsigned int i) -> GiNaC::lst
  

Definition at line 2046 of file SyFi.py.

02047                  :
02048   """
02049     normal(Triangle arg0, unsigned int i) -> GiNaC::lst
02050     normal(Tetrahedron arg0, unsigned int i) -> GiNaC::lst
02051     """
02052   return _SyFi.normal(*args)

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

Definition at line 1967 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;
        }
void SyFi::normalize ( Ptv a)

Definition at line 53 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_i &  p 
)

Definition at line 184 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;
        }
std::ostream & SyFi::operator<< ( std::ostream &  os,
const OrderedPtvSet &  p 
)

Definition at line 104 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;
        }
GiNaC::ex SyFi::pol ( unsigned int  order,
unsigned int  nsd,
const std::string  a 
)
def SyFi::pol (   args)
pol(unsigned int order, unsigned int nsd, string a) -> GiNaC::ex

Definition at line 1174 of file SyFi.py.

01175               :
01176   """pol(unsigned int order, unsigned int nsd, string a) -> GiNaC::ex"""
01177   return _SyFi.pol(*args)

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

Definition at line 599 of file ginac_tools.cpp.

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

Referenced by _wrap_pol(), bernsteinv(), SyFi::Lagrange::compute_basis_functions(), SyFi::Hermite::compute_basis_functions(), main(), 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);
}
GiNaC::exmap SyFi::pol2basisandcoeff ( GiNaC::ex  e,
GiNaC::ex  s 
)

Definition at line 864 of file ginac_tools.cpp.

References run::s.

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

{
        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 888 of file ginac_tools.cpp.

References 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 1315 of file SyFi.py.

01316                             :
01317   """
01318     pol2basisandcoeff(GiNaC::ex e) -> GiNaC::exmap
01319     pol2basisandcoeff(GiNaC::ex e, GiNaC::ex s) -> GiNaC::exmap
01320     """
01321   return _SyFi.pol2basisandcoeff(*args)

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

Definition at line 724 of file ginac_tools.cpp.

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

Referenced by _wrap_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);
}
GiNaC::ex SyFi::polb ( unsigned int  order,
unsigned int  nsd,
const std::string  a 
)
def SyFi::polb (   args)
polb(unsigned int order, unsigned int nsd, string a) -> GiNaC::ex

Definition at line 1185 of file SyFi.py.

01186                :
01187   """polb(unsigned int order, unsigned int nsd, string a) -> GiNaC::ex"""
01188   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 685 of file ginac_tools.cpp.

References pol(), and run::s.

Referenced by _wrap_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, 
      string a) -> GiNaC::lst
  

Definition at line 1178 of file SyFi.py.

01179                :
01180   """
01181     polv(unsigned int no_fields, unsigned int order, unsigned int nsd, 
01182         string a) -> GiNaC::lst
01183     """
01184   return _SyFi.polv(*args)

void SyFi::print ( GiNaC::exvector &  v)

Definition at line 91 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 ( GiNaC::exmap  map)

Definition at line 125 of file utilities.cpp.

        {
                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;
        }
void SyFi::print ( ex_int_map  map)

Definition at line 110 of file utilities.cpp.

References SyFi::ex_int_map::begin(), 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 ( std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > &  A)

Definition at line 101 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 ( GiNaC::lst &  l)

Definition at line 75 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;
        }
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 1380 of file ginac_tools.cpp.

References test::e, get_symbol(), and int2string().

Referenced by _wrap_replace_powers__SWIG_0(), _wrap_replace_powers__SWIG_1(), 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 e, std::list<(GiNaC::symbol,std::allocator<(GiNaC::symbol)>)> symbols, 
      std::list<(SyFi::symexpair,std::allocator<(SyFi::symexpair)>)> sel, 
      string tmpsymbolprefix = "p_") -> GiNaC::ex
  replace_powers(GiNaC::ex e, std::list<(GiNaC::symbol,std::allocator<(GiNaC::symbol)>)> symbols, 
      std::list<(SyFi::symexpair,std::allocator<(SyFi::symexpair)>)> sel) -> GiNaC::ex
  

Definition at line 1414 of file SyFi.py.

01415                          :
01416   """
01417     replace_powers(GiNaC::ex e, std::list<(GiNaC::symbol,std::allocator<(GiNaC::symbol)>)> symbols, 
01418         std::list<(SyFi::symexpair,std::allocator<(SyFi::symexpair)>)> sel, 
01419         string tmpsymbolprefix = "p_") -> GiNaC::ex
01420     replace_powers(GiNaC::ex e, std::list<(GiNaC::symbol,std::allocator<(GiNaC::symbol)>)> symbols, 
01421         std::list<(SyFi::symexpair,std::allocator<(SyFi::symexpair)>)> sel) -> GiNaC::ex
01422     """
01423   return _SyFi.replace_powers(*args)

void SyFi::set_tolerance ( double  tolerance)

Definition at line 21 of file Ptv_tools.cpp.

References Ptv::tol.

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

Definition at line 70 of file SyFi.py.

00071                     :
00072   """setDigits(int a)"""
  return _SyFi.setDigits(*args)
void SyFi::sort_vector ( vector< Ptv > &  a)

Definition at line 16 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 76 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];
                }
        }
def SyFi::swig_import_helper ( )

Definition at line 10 of file SyFi.py.

00011                             :
00012         from os.path import dirname
00013         import imp
00014         fp = None
00015         try:
00016             fp, pathname, description = imp.find_module('_SyFi', [dirname(__file__)])
00017         except ImportError:
00018             import _SyFi
00019             return _SyFi
00020         if fp is not None:
00021             try:
00022                 _mod = imp.load_module('_SyFi', fp, pathname, description)
00023             finally:
00024                 fp.close()
            return _mod
def SyFi::symbol_exists (   args)
symbol_exists(string name) -> bool

Definition at line 1338 of file SyFi.py.

Referenced by _wrap_symbol_exists(), and main().

01339                         :
01340   """symbol_exists(string name) -> bool"""
01341   return _SyFi.symbol_exists(*args)

bool SyFi::symbol_exists ( const std::string &  name)
bool SyFi::symbol_exists ( const string &  name)

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

References symbol_collection.

        {
                return symbol_collection.find(name) != symbol_collection.end();
        }
GiNaC::symbol SyFi::t ( "(t is not initialized since initSyFi has never been called)"  )
GiNaC::lst SyFi::tangent ( Triangle &  triangle,
unsigned int  i 
)

Definition at line 2007 of file Polygon.cpp.

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

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

        {
                /*
                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;

        }
def SyFi::tangent (   args)
tangent(Triangle arg0, unsigned int i) -> GiNaC::lst

Definition at line 1986 of file SyFi.py.

01987                   :
01988   """tangent(Triangle arg0, unsigned int i) -> GiNaC::lst"""
  return _SyFi.tangent(*args)
void SyFi::usage ( FE &  v_fe,
FE &  p_fe 
)

Definition at line 23 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;
                }
        }
void SyFi::usage ( FE &  fe)

Definition at line 13 of file ElementComputations.cpp.

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

        {
                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;
                }
        }
def SyFi::usage (   args)
  usage(FE fe)
  usage(FE v_fe, FE p_fe)
  

Definition at line 2666 of file SyFi.py.

02667                 :
02668   """
02669     usage(FE fe)
02670     usage(FE v_fe, FE p_fe)
02671     """
02672   return _SyFi.usage(*args)

def SyFi::visitor_subst_pow (   args)
visitor_subst_pow(GiNaC::ex e, GiNaC::exmap map, ex_int_map intmap, string a)

Definition at line 1170 of file SyFi.py.

01171                             :
01172   """visitor_subst_pow(GiNaC::ex e, GiNaC::exmap map, ex_int_map intmap, string a)"""
01173   return _SyFi.visitor_subst_pow(*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 386 of file ginac_tools.cpp.

References test::e, and run::s.

Referenced by _wrap_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);
                }
        }
}
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 66 of file SyFi.py.

tuple SyFi::_SyFi = swig_import_helper()

Definition at line 25 of file SyFi.py.

SyFi::ArnoldFalkWintherWeakSymP_swigregister = _SyFi.ArnoldFalkWintherWeakSymP_swigregister

Definition at line 2724 of file SyFi.py.

SyFi::ArnoldFalkWintherWeakSymSigma_swigregister = _SyFi.ArnoldFalkWintherWeakSymSigma_swigregister

Definition at line 2663 of file SyFi.py.

SyFi::ArnoldFalkWintherWeakSymU_swigregister = _SyFi.ArnoldFalkWintherWeakSymU_swigregister

Definition at line 2697 of file SyFi.py.

SyFi::Box_swigregister = _SyFi.Box_swigregister

Definition at line 1871 of file SyFi.py.

SyFi::Bubble_swigregister = _SyFi.Bubble_swigregister

Definition at line 2624 of file SyFi.py.

SyFi::CrouzeixRaviart_swigregister = _SyFi.CrouzeixRaviart_swigregister

Definition at line 2290 of file SyFi.py.

SyFi::cvar = _SyFi.cvar

Definition at line 1257 of file SyFi.py.

SyFi::DiscontinuousLagrange_swigregister = _SyFi.DiscontinuousLagrange_swigregister

Definition at line 2478 of file SyFi.py.

SyFi::Dof_swigregister = _SyFi.Dof_swigregister

Definition at line 2263 of file SyFi.py.

SyFi::ex_int_map_swigregister = _SyFi.ex_int_map_swigregister

Definition at line 609 of file SyFi.py.

SyFi::exlist_swigregister = _SyFi.exlist_swigregister

Definition at line 986 of file SyFi.py.

SyFi::exmap_swigregister = _SyFi.exmap_swigregister

Definition at line 467 of file SyFi.py.

SyFi::exset_swigregister = _SyFi.exset_swigregister

Definition at line 1100 of file SyFi.py.

SyFi::ExStats_swigregister = _SyFi.ExStats_swigregister

Definition at line 1255 of file SyFi.py.

SyFi::exvector_swigregister = _SyFi.exvector_swigregister

Definition at line 325 of file SyFi.py.

SyFi::FE_swigregister = _SyFi.FE_swigregister

Definition at line 2027 of file SyFi.py.

SyFi::GINACLIB_MAJOR_VERSION = _SyFi.GINACLIB_MAJOR_VERSION

Definition at line 73 of file SyFi.py.

SyFi::GINACLIB_MICRO_VERSION = _SyFi.GINACLIB_MICRO_VERSION

Definition at line 75 of file SyFi.py.

SyFi::GINACLIB_MINOR_VERSION = _SyFi.GINACLIB_MINOR_VERSION

Definition at line 74 of file SyFi.py.

SyFi::Hermite_swigregister = _SyFi.Hermite_swigregister

Definition at line 2540 of file SyFi.py.

SyFi::Lagrange_swigregister = _SyFi.Lagrange_swigregister

Definition at line 2135 of file SyFi.py.

SyFi::Line_swigregister = _SyFi.Line_swigregister

Definition at line 1488 of file SyFi.py.

SyFi::MixedFE_swigregister = _SyFi.MixedFE_swigregister

Definition at line 2823 of file SyFi.py.

SyFi::Nedelec2Hdiv_swigregister = _SyFi.Nedelec2Hdiv_swigregister

Definition at line 2597 of file SyFi.py.

SyFi::Nedelec_swigregister = _SyFi.Nedelec_swigregister

Definition at line 2567 of file SyFi.py.

SyFi::P0_swigregister = _SyFi.P0_swigregister

Definition at line 2349 of file SyFi.py.

SyFi::Polygon_swigregister = _SyFi.Polygon_swigregister

Definition at line 1411 of file SyFi.py.

SyFi::RaviartThomas_swigregister = _SyFi.RaviartThomas_swigregister

Definition at line 2447 of file SyFi.py.

SyFi::Rectangle_swigregister = _SyFi.Rectangle_swigregister

Definition at line 1680 of file SyFi.py.

SyFi::ReferenceBox_swigregister = _SyFi.ReferenceBox_swigregister

Definition at line 1902 of file SyFi.py.

SyFi::ReferenceLine_swigregister = _SyFi.ReferenceLine_swigregister

Definition at line 1533 of file SyFi.py.

SyFi::ReferenceRectangle_swigregister = _SyFi.ReferenceRectangle_swigregister

Definition at line 1711 of file SyFi.py.

SyFi::ReferenceTetrahedron_swigregister = _SyFi.ReferenceTetrahedron_swigregister

Definition at line 1807 of file SyFi.py.

SyFi::ReferenceTriangle_swigregister = _SyFi.ReferenceTriangle_swigregister

Definition at line 1624 of file SyFi.py.

SyFi::Robust_swigregister = _SyFi.Robust_swigregister

Definition at line 2762 of file SyFi.py.

SyFi::Simplex_swigregister = _SyFi.Simplex_swigregister

Definition at line 1955 of file SyFi.py.

SyFi::SpaceTimeDomain_swigregister = _SyFi.SpaceTimeDomain_swigregister

Definition at line 2883 of file SyFi.py.

SyFi::SpaceTimeElement_swigregister = _SyFi.SpaceTimeElement_swigregister

Definition at line 2921 of file SyFi.py.

SyFi::StandardFE_swigregister = _SyFi.StandardFE_swigregister

Definition at line 2108 of file SyFi.py.

SyFi::SwigPyIterator_swigregister = _SyFi.SwigPyIterator_swigregister

Definition at line 160 of file SyFi.py.

SyFi::SYFILIB_MAJOR_VERSION = _SyFi.SYFILIB_MAJOR_VERSION

Definition at line 1103 of file SyFi.py.

SyFi::SYFILIB_MICRO_VERSION = _SyFi.SYFILIB_MICRO_VERSION

Definition at line 1105 of file SyFi.py.

SyFi::SYFILIB_MINOR_VERSION = _SyFi.SYFILIB_MINOR_VERSION

Definition at line 1104 of file SyFi.py.

map<string, symbol> SyFi::symbol_collection

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

Referenced by get_symbol(), and symbol_exists().

SyFi::symexlist_swigregister = _SyFi.symexlist_swigregister

Definition at line 817 of file SyFi.py.

SyFi::symexpair_swigregister = _SyFi.symexpair_swigregister

Definition at line 648 of file SyFi.py.

SyFi::TensorLagrange_swigregister = _SyFi.TensorLagrange_swigregister

Definition at line 2199 of file SyFi.py.

SyFi::TensorP0_swigregister = _SyFi.TensorP0_swigregister

Definition at line 2413 of file SyFi.py.

SyFi::Tetrahedron_swigregister = _SyFi.Tetrahedron_swigregister

Definition at line 1769 of file SyFi.py.

SyFi::Triangle_swigregister = _SyFi.Triangle_swigregister

Definition at line 1586 of file SyFi.py.

SyFi::VectorCrouzeixRaviart_swigregister = _SyFi.VectorCrouzeixRaviart_swigregister

Definition at line 2322 of file SyFi.py.

SyFi::VectorDiscontinuousLagrange_swigregister = _SyFi.VectorDiscontinuousLagrange_swigregister

Definition at line 2513 of file SyFi.py.

SyFi::VectorLagrange_swigregister = _SyFi.VectorLagrange_swigregister

Definition at line 2167 of file SyFi.py.

SyFi::VectorP0_swigregister = _SyFi.VectorP0_swigregister

Definition at line 2381 of file SyFi.py.

const int SyFi::version_major = cvar.version_major

Definition at line 1258 of file SyFi.py.

Referenced by Swig_var_version_major_get().

const int SyFi::version_micro = cvar.version_micro

Definition at line 1260 of file SyFi.py.

Referenced by Swig_var_version_micro_get().

const int SyFi::version_minor = cvar.version_minor

Definition at line 1259 of file SyFi.py.

Referenced by Swig_var_version_minor_get().

GiNaC::symbol SyFi::x

Definition at line 8 of file crouzeixraviart.py.

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::SpaceTimeElement::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Nedelec::compute_basis_functions(), SyFi::Lagrange::compute_basis_functions(), SyFi::Hermite::compute_basis_functions(), SyFi::CrouzeixRaviart::compute_basis_functions(), SyFi::Bubble::compute_basis_functions(), SyFi::BrezziDouglasMarini::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::Simplex::repr(), SyFi::Box::repr(), SyFi::Tetrahedron::repr(), SyFi::Rectangle::repr(), SyFi::Triangle::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__(), std_map_Sl_GiNaC_ex_Sc_int_Sc_GiNaC_ex_is_less_Sg____setitem__(), 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