SyFi
0.3
|
Classes | |
class | ArnoldFalkWintherWeakSymSigma |
class | ArnoldFalkWintherWeakSymU |
class | ArnoldFalkWintherWeakSymP |
class | BrezziDouglasMarini |
class | Bubble |
class | CrouzeixRaviart |
class | VectorCrouzeixRaviart |
class | DiscontinuousLagrange |
class | VectorDiscontinuousLagrange |
class | Dof |
class | FE |
class | StandardFE |
class | SymbolMapBuilderVisitor |
class | SymbolCounterVisitor |
class | ExStatsVisitor |
class | ExStats |
class | Hermite |
class | Lagrange |
class | VectorLagrange |
class | TensorLagrange |
class | MixedFE |
class | Nedelec |
class | Nedelec2Hdiv |
class | OrderedPtvSet |
struct | OrderedPtvSet_is_less |
class | OrderedPtvSet_i |
struct | OrderedPtvSet_i_is_less |
class | P0 |
class | VectorP0 |
class | TensorP0 |
class | Polygon |
class | Line |
class | ReferenceLine |
class | Triangle |
class | ReferenceTriangle |
class | Rectangle |
class | ReferenceRectangle |
class | Tetrahedron |
class | ReferenceTetrahedron |
class | Box |
class | ReferenceBox |
class | Simplex |
class | RaviartThomas |
class | Robust |
class | SpaceTimeDomain |
class | SpaceTimeElement |
class | _object |
class | SwigPyIterator |
class | exvector |
class | exmap |
class | ex_int_map |
class | symexpair |
class | symexlist |
class | exlist |
class | exset |
Typedefs | |
typedef std::pair < GiNaC::symbol, GiNaC::ex > | symexpair |
typedef std::list< std::pair < GiNaC::symbol, GiNaC::ex > > | symexlist |
typedef std::list< GiNaC::ex > | exlist |
typedef std::set< GiNaC::ex, GiNaC::ex_is_less > | exset |
typedef std::map< GiNaC::ex, int, GiNaC::ex_is_less > | ex_int_map |
typedef std::pair< unsigned int, unsigned int > | pair_ii |
typedef std::vector< std::pair < unsigned int, unsigned int > > | vector_ii |
Enumerations | |
enum | Repr_format { SUBS_PERFORMED = 1, SUBS_NOT_PERFORMED = 2 } |
Functions | |
GiNaC::ex | div (GiNaC::ex v) |
GiNaC::ex | div (GiNaC::ex v, GiNaC::ex G) |
GiNaC::ex | div (GiNaC::lst &v) |
GiNaC::ex | div (GiNaC::lst &v, GiNaC::ex G) |
GiNaC::ex | div (GiNaC::exvector &v) |
GiNaC::ex | grad (GiNaC::ex f) |
GiNaC::ex | grad (GiNaC::ex f, GiNaC::ex G) |
void | usage (FE &fe) |
void | usage (FE &v_fe, FE &p_fe) |
void | compute_Poisson_element_matrix (FE &fe, Dof &dof, std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > &A) |
void | compute_Stokes_element_matrix (FE &v_fe, FE &p_fe, Dof &dof, std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > &A) |
void | compute_mixed_Poisson_element_matrix (FE &v_fe, FE &p_fe, Dof &dof, std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > &A) |
GiNaC::lst | cross (GiNaC::lst &v1, GiNaC::lst &v2) |
GiNaC::ex | inner (GiNaC::ex a, GiNaC::ex b, bool transposed) |
GiNaC::ex | inner (GiNaC::lst v1, GiNaC::lst v2) |
GiNaC::ex | inner (GiNaC::exvector &v1, GiNaC::exvector &v2) |
GiNaC::lst | matvec (GiNaC::matrix &M, GiNaC::lst &x) |
GiNaC::ex | matvec (GiNaC::ex A, GiNaC::ex x) |
GiNaC::lst | ex2equations (GiNaC::ex rel) |
GiNaC::lst | collapse (GiNaC::lst l) |
GiNaC::matrix | equations2matrix (const GiNaC::ex &eqns, const GiNaC::ex &symbols) |
void | matrix_from_equations (const GiNaC::ex &eqns, const GiNaC::ex &symbols, GiNaC::matrix &A, GiNaC::matrix &b) |
GiNaC::ex | lst_to_matrix2 (const GiNaC::lst &l) |
GiNaC::lst | matrix_to_lst2 (const GiNaC::ex &m) |
GiNaC::lst | lst_equals (GiNaC::ex a, GiNaC::ex b) |
int | find (GiNaC::ex e, GiNaC::lst list) |
void | visitor_subst_pow (GiNaC::ex e, GiNaC::exmap &map, ex_int_map &intmap, string a) |
void | check_visitor (GiNaC::ex e, GiNaC::lst &exlist) |
GiNaC::ex | homogenous_pol (unsigned int order, unsigned int nsd, const string a) |
GiNaC::lst | homogenous_polv (unsigned int no_fields, unsigned int order, unsigned int nsd, const string a) |
GiNaC::ex | pol (unsigned int order, unsigned int nsd, const string a) |
GiNaC::lst | polv (unsigned int no_fields, unsigned int order, unsigned int nsd, const string a) |
GiNaC::ex | polb (unsigned int order, unsigned int nsd, const string a) |
GiNaC::lst | coeffs (GiNaC::lst pols) |
GiNaC::lst | coeffs (GiNaC::ex pol) |
GiNaC::exvector | coeff (GiNaC::ex pol) |
GiNaC::exmap | pol2basisandcoeff (GiNaC::ex e, GiNaC::ex s) |
GiNaC::exmap | pol2basisandcoeff (GiNaC::ex e) |
GiNaC::ex | legendre1D (const GiNaC::symbol x, unsigned int n) |
GiNaC::ex | legendre (unsigned int order, unsigned int nsd, const string s) |
GiNaC::lst | legendrev (unsigned int no_fields, unsigned int order, unsigned int nsd, const string a) |
bool | compare (const ex &e, const string &s) |
void | EQUAL_OR_DIE (const ex &e, const string &s) |
exhashmap< int > | count_symbols (const ex &e) |
ex | extract_symbols (const ex &e) |
void | collect_symbols (const GiNaC::ex &e, exset &v) |
GiNaC::exvector | collect_symbols (const GiNaC::ex &e) |
bool | compare_archives (const string &first, const string &second, std::ostream &os) |
ExStats | count_ops (const ex &e) |
ex | replace_powers (const ex &ein, const list< symbol > &symbols, list< symexpair > &sel, const string &tmpsymbolprefix) |
bool | compare (const GiNaC::ex &e, const std::string &s) |
void | EQUAL_OR_DIE (const GiNaC::ex &e, const std::string &s) |
bool | compare_archives (const std::string &first, const std::string &second, std::ostream &os=std::cout) |
void | visitor_subst_pow (GiNaC::ex e, GiNaC::exmap &map, ex_int_map &intmap, std::string a) |
GiNaC::ex | pol (unsigned int order, unsigned int nsd, const std::string a) |
GiNaC::lst | polv (unsigned int no_fields, unsigned int order, unsigned int nsd, const std::string a) |
GiNaC::ex | polb (unsigned int order, unsigned int nsd, const std::string a) |
GiNaC::ex | homogenous_pol (unsigned int order, unsigned int nsd, const std::string a) |
GiNaC::lst | homogenous_polv (unsigned int no_fields, unsigned int order, unsigned int nsd, const std::string a) |
GiNaC::ex | legendre (unsigned int order, unsigned int nsd, const std::string a) |
GiNaC::lst | legendrev (unsigned int no_fields, unsigned int order, unsigned int nsd, const std::string a) |
GiNaC::exhashmap< int > | count_symbols (const GiNaC::ex &e) |
GiNaC::ex | extract_symbols (const GiNaC::ex &e) |
ExStats | count_ops (const GiNaC::ex &e) |
GiNaC::ex | replace_powers (const GiNaC::ex &e, const std::list< GiNaC::symbol > &symbols, std::list< symexpair > &sel, const std::string &tmpsymbolprefix="p_") |
GiNaC::ex | lagrange (unsigned int order, Polygon &p, const std::string &a) |
GiNaC::lst | lagrangev (unsigned int no_fields, unsigned int order, Polygon &p, const std::string &a) |
std::ostream & | operator<< (std::ostream &os, const OrderedPtvSet &p) |
std::ostream & | operator<< (std::ostream &os, const OrderedPtvSet_i &p) |
lst | bezier_ordinates (Tetrahedron &tetrahedra, unsigned int d) |
lst | interior_coordinates (Tetrahedron &tetrahedra, unsigned int d) |
lst | bezier_ordinates (Triangle &triangle, unsigned int d) |
lst | interior_coordinates (Triangle &triangle, unsigned int d) |
lst | bezier_ordinates (Line &line, unsigned int d) |
lst | interior_coordinates (Line &line, unsigned int d) |
ex | barycenter_line (ex p0, ex p1) |
ex | barycenter_triangle (ex p0, ex p1, ex p2) |
ex | barycenter_tetrahedron (ex p0, ex p1, ex p2, ex p3) |
ex | barycenter (Simplex &simplex) |
ex | bernstein (unsigned int order, Polygon &p, const string &a) |
lst | bernsteinv (unsigned int no_fields, unsigned int order, Polygon &p, const string &a) |
lst | normal (Tetrahedron &tetrahedron, unsigned int i) |
lst | normal (Triangle &triangle, unsigned int i) |
lst | tangent (Triangle &triangle, unsigned int i) |
GiNaC::ex | barycenter_line (GiNaC::ex p0, GiNaC::ex p1) |
GiNaC::ex | barycenter_triangle (GiNaC::ex p0, GiNaC::ex p1, GiNaC::ex p2) |
GiNaC::ex | barycenter_tetrahedron (GiNaC::ex p0, GiNaC::ex p1, GiNaC::ex p2, GiNaC::ex p3) |
GiNaC::ex | bernstein (unsigned int order, Polygon &p, const std::string &a) |
GiNaC::lst | bernsteinv (unsigned int no_fields, unsigned int order, Polygon &p, const std::string &a) |
void | sort_vector (vector< Ptv > &a) |
void | set_tolerance (double tolerance) |
double | mul (const Ptv &a, const Ptv &b) |
double | norm (const Ptv &a) |
void | normalize (Ptv &a) |
void | add (const Ptv &a, const Ptv &b, Ptv &c) |
void | sub (const Ptv &a, const Ptv &b, Ptv &c) |
void | cross (const Ptv &a, const Ptv &b, Ptv &c) |
bool | is_equal (Ptv &a, Ptv &b) |
bool | line_contains (Ptv &e0, Ptv &e1, Ptv &p) |
bool | is_inside_triangle (Ptv &e0, Ptv &e1, Ptv &e2, Ptv &p) |
bool | contains2D (Ptv &e0, Ptv &e1, Ptv &p) |
bool | contains3D (Ptv &e0, Ptv &e1, Ptv &e2, Ptv &p) |
def | swig_import_helper |
def | _swig_setattr_nondynamic |
def | _swig_setattr |
def | _swig_getattr |
def | _swig_repr |
def | _swig_setattr_nondynamic_method |
def | setDigits |
def | dirac |
def | int2string |
def | 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 | new_instancemethod = lambdafunc,inst,cls:_SyFi.SWIG_PyInstanceMethod_New(func) |
tuple | _SyFi = swig_import_helper() |
int | _newclass = 0 |
GINACLIB_MAJOR_VERSION = _SyFi.GINACLIB_MAJOR_VERSION | |
GINACLIB_MINOR_VERSION = _SyFi.GINACLIB_MINOR_VERSION | |
GINACLIB_MICRO_VERSION = _SyFi.GINACLIB_MICRO_VERSION | |
SwigPyIterator_swigregister = _SyFi.SwigPyIterator_swigregister | |
exvector_swigregister = _SyFi.exvector_swigregister | |
exmap_swigregister = _SyFi.exmap_swigregister | |
ex_int_map_swigregister = _SyFi.ex_int_map_swigregister | |
symexpair_swigregister = _SyFi.symexpair_swigregister | |
symexlist_swigregister = _SyFi.symexlist_swigregister | |
exlist_swigregister = _SyFi.exlist_swigregister | |
exset_swigregister = _SyFi.exset_swigregister | |
ExStats_swigregister = _SyFi.ExStats_swigregister | |
cvar = _SyFi.cvar | |
version_major = cvar.version_major | |
version_minor = cvar.version_minor | |
Polygon_swigregister = _SyFi.Polygon_swigregister | |
Line_swigregister = _SyFi.Line_swigregister | |
ReferenceLine_swigregister = _SyFi.ReferenceLine_swigregister | |
Triangle_swigregister = _SyFi.Triangle_swigregister | |
ReferenceTriangle_swigregister = _SyFi.ReferenceTriangle_swigregister | |
Rectangle_swigregister = _SyFi.Rectangle_swigregister | |
ReferenceRectangle_swigregister = _SyFi.ReferenceRectangle_swigregister | |
Tetrahedron_swigregister = _SyFi.Tetrahedron_swigregister | |
ReferenceTetrahedron_swigregister = _SyFi.ReferenceTetrahedron_swigregister | |
Box_swigregister = _SyFi.Box_swigregister | |
ReferenceBox_swigregister = _SyFi.ReferenceBox_swigregister | |
Simplex_swigregister = _SyFi.Simplex_swigregister | |
FE_swigregister = _SyFi.FE_swigregister | |
StandardFE_swigregister = _SyFi.StandardFE_swigregister | |
Lagrange_swigregister = _SyFi.Lagrange_swigregister | |
VectorLagrange_swigregister = _SyFi.VectorLagrange_swigregister | |
TensorLagrange_swigregister = _SyFi.TensorLagrange_swigregister | |
Dof_swigregister = _SyFi.Dof_swigregister | |
CrouzeixRaviart_swigregister = _SyFi.CrouzeixRaviart_swigregister | |
VectorCrouzeixRaviart_swigregister = _SyFi.VectorCrouzeixRaviart_swigregister | |
P0_swigregister = _SyFi.P0_swigregister | |
VectorP0_swigregister = _SyFi.VectorP0_swigregister | |
TensorP0_swigregister = _SyFi.TensorP0_swigregister | |
RaviartThomas_swigregister = _SyFi.RaviartThomas_swigregister | |
DiscontinuousLagrange_swigregister = _SyFi.DiscontinuousLagrange_swigregister | |
VectorDiscontinuousLagrange_swigregister = _SyFi.VectorDiscontinuousLagrange_swigregister | |
Hermite_swigregister = _SyFi.Hermite_swigregister | |
Nedelec_swigregister = _SyFi.Nedelec_swigregister | |
Nedelec2Hdiv_swigregister = _SyFi.Nedelec2Hdiv_swigregister | |
Bubble_swigregister = _SyFi.Bubble_swigregister | |
ArnoldFalkWintherWeakSymSigma_swigregister = _SyFi.ArnoldFalkWintherWeakSymSigma_swigregister | |
ArnoldFalkWintherWeakSymU_swigregister = _SyFi.ArnoldFalkWintherWeakSymU_swigregister | |
ArnoldFalkWintherWeakSymP_swigregister = _SyFi.ArnoldFalkWintherWeakSymP_swigregister | |
Robust_swigregister = _SyFi.Robust_swigregister | |
MixedFE_swigregister = _SyFi.MixedFE_swigregister | |
SpaceTimeDomain_swigregister = _SyFi.SpaceTimeDomain_swigregister | |
SpaceTimeElement_swigregister = _SyFi.SpaceTimeElement_swigregister | |
unsigned int | nsd = 2 |
GiNaC::lst | p |
map< string, symbol > | symbol_collection |
GiNaC::symbol | x |
GiNaC::symbol | y |
GiNaC::symbol | z |
GiNaC::symbol | t |
GiNaC::symbol | infinity |
GiNaC::symbol | DUMMY |
const char * | version_micro = SYFILIB_MICRO_VERSION |
typedef std::map<GiNaC::ex, int, GiNaC::ex_is_less> SyFi::ex_int_map |
Definition at line 40 of file containers.h.
typedef std::list<GiNaC::ex> SyFi::exlist |
Definition at line 37 of file containers.h.
typedef std::set<GiNaC::ex, GiNaC::ex_is_less> SyFi::exset |
Definition at line 38 of file containers.h.
typedef std::pair<unsigned int, unsigned int> SyFi::pair_ii |
typedef std::list< std::pair<GiNaC::symbol, GiNaC::ex> > SyFi::symexlist |
Definition at line 34 of file containers.h.
typedef std::pair<GiNaC::symbol, GiNaC::ex> SyFi::symexpair |
Definition at line 33 of file containers.h.
typedef std::vector< std::pair<unsigned int, unsigned int> > SyFi::vector_ii |
enum SyFi::Repr_format |
Definition at line 27 of file Polygon.h.
{ SUBS_PERFORMED = 1, SUBS_NOT_PERFORMED = 2 };
def SyFi._swig_getattr | ( | self, | |
class_type, | |||
name | |||
) | [private] |
Definition at line 55 of file SyFi.py.
00055 00056 def _swig_getattr(self,class_type,name): 00057 if (name == "thisown"): return self.this.own() 00058 method = class_type.__swig_getmethods__.get(name,None) 00059 if method: return method(self) 00060 raise AttributeError(name)
def SyFi._swig_repr | ( | self | ) | [private] |
Definition at line 61 of file SyFi.py.
00061 00062 def _swig_repr(self): 00063 try: strthis = "proxy of " + self.this.__repr__() 00064 except: strthis = "" 00065 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) 00066 00067 try: 00068 _object = object _newclass = 1
def SyFi._swig_setattr | ( | self, | |
class_type, | |||
name, | |||
value | |||
) | [private] |
Definition at line 52 of file SyFi.py.
References _swig_setattr_nondynamic().
00052 00053 def _swig_setattr(self,class_type,name,value): 00054 return _swig_setattr_nondynamic(self,class_type,name,value,0)
def SyFi._swig_setattr_nondynamic | ( | self, | |
class_type, | |||
name, | |||
value, | |||
static = 1 |
|||
) | [private] |
Definition at line 39 of file SyFi.py.
Referenced by _swig_setattr().
00039 00040 def _swig_setattr_nondynamic(self,class_type,name,value,static=1): 00041 if (name == "thisown"): return self.this.own(value) 00042 if (name == "this"): 00043 if type(value).__name__ == 'SwigPyObject': 00044 self.__dict__[name] = value 00045 return 00046 method = class_type.__swig_setmethods__.get(name,None) 00047 if method: return method(self,value) 00048 if (not static): 00049 self.__dict__[name] = value 00050 else: 00051 raise AttributeError("You cannot add attributes to %s" % self)
def SyFi._swig_setattr_nondynamic_method | ( | set | ) | [private] |
Definition at line 74 of file SyFi.py.
00074 00075 def _swig_setattr_nondynamic_method(set): 00076 def set_attr(self,name,value): 00077 if (name == "thisown"): return self.this.own(value) 00078 if hasattr(self,name) or (name == "this"): 00079 set(self,name,value) 00080 else: 00081 raise AttributeError("You cannot add attributes to %s" % self) 00082 return set_attr 00083 00084
Definition at line 76 of file Ptv_tools.cpp.
References Ptv::redim(), and Ptv::size().
Referenced by ex2type().
GiNaC::ex SyFi::barycenter | ( | Simplex & | simplex | ) |
Definition at line 1748 of file Polygon.cpp.
References get_symbolic_vector(), SyFi::Polygon::no_vertices(), nsd, and SyFi::Polygon::vertex().
Referenced by _wrap_barycenter(), barycenter(), and main().
{ if (nsd != simplex.no_vertices()-1) { throw std::runtime_error("Could not compute the barycentric coordinates. Not implemented yet for simplices with no_vertices != nsd +1."); } // put symbols in lst ex b = get_symbolic_vector(simplex.no_vertices(), "b"); lst symbols; for (unsigned int i=0; i<b.nops(); i++) { symbols.append(b.op(i)); } // put equations in lst lst eqs; for (unsigned int i=0; i<nsd; i++) { ex sum = 0; for (unsigned int k=0; k< simplex.no_vertices(); k++) { sum += b.op(k)*simplex.vertex(k).op(i); } ex eqi = p[i] == sum; eqs.append(eqi); } // last eq, sum = 1 ex sum = 0; for (unsigned int i=0; i<symbols.nops(); i++) { sum += symbols.op(i); } ex last_eq = 1 == sum; eqs.append(last_eq); // solve equations ex sol = lsolve(eqs, symbols); return sol; }
def SyFi.barycenter | ( | args | ) |
barycenter(Simplex simplex) -> GiNaC::ex
Definition at line 1990 of file SyFi.py.
References barycenter().
01990 01991 def barycenter(*args): 01992 """barycenter(Simplex simplex) -> GiNaC::ex""" 01993 return _SyFi.barycenter(*args)
GiNaC::ex SyFi::barycenter_line | ( | GiNaC::ex | p0, |
GiNaC::ex | p1 | ||
) |
ex SyFi::barycenter_line | ( | ex | p0, |
ex | p1 | ||
) |
Definition at line 1603 of file Polygon.cpp.
References x.
Referenced by _wrap_barycenter_line(), barycenter_line(), and bernstein().
{ ex sol; // 1D if (!GiNaC::is_a<lst>(p0)) { GiNaC::symbol b0("b0"), b1("b1"); ex eq1 = x == b0*p0 + b1*p1; ex eq2 = 1 == b0 + b1; sol = lsolve(lst(eq1, eq2), lst(b0, b1)); } else if (p0.nops() == 1 && p1.nops() == 1) { GiNaC::symbol b0("b0"), b1("b1"); ex eq1 = x == b0*p0.op(0) + b1*p1.op(0); ex eq2 = 1 == b0 + b1; sol = lsolve(lst(eq1, eq2), lst(b0, b1)); if ( sol == 0 ) { ex eq1 = y == b0*p0.op(1) + b1*p1.op(1); sol = lsolve(lst(eq1, eq2), lst(b0, b1)); } if ( sol == 0 ) { ex eq1 = z == b0*p0.op(2) + b1*p1.op(2); sol = lsolve(lst(eq1, eq2), lst(b0, b1)); } } //2D else if ( p0.nops() == 2 && p1.nops() == 2 ) { GiNaC::symbol b0("b0"), b1("b1"); ex eq1 = x == b0*p0.op(0) + b1*p1.op(0); ex eq3 = 1 == b0 + b1; sol = lsolve(lst(eq1, eq3), lst(b0, b1)); if (sol.nops() == 0) { ex eq2 = y == b0*p0.op(1) + b1*p1.op(1); sol = lsolve(lst(eq2, eq3), lst(b0, b1)); } } //3D else if ( p0.nops() == 3 && p1.nops() == 3 ) { GiNaC::symbol b0("b0"), b1("b1"); ex eq1 = x == b0*p0.op(0) + b1*p1.op(0); ex eq4 = 1 == b0 + b1; sol = lsolve(lst(eq1, eq4), lst(b0, b1)); if (sol.nops() == 0) { ex eq2 = y == b0*p0.op(1) + b1*p1.op(1); sol = lsolve(lst(eq2, eq4), lst(b0, b1)); } if (sol.nops() == 0) { ex eq3 = z == b0*p0.op(2) + b1*p1.op(2); sol = lsolve(lst(eq3, eq4), lst(b0, b1)); } } else { throw std::runtime_error("Could not compute the barycentric coordinates. Check the coordinates."); } return sol; }
def SyFi.barycenter_line | ( | args | ) |
barycenter_line(GiNaC::ex p0, GiNaC::ex p1) -> GiNaC::ex
Definition at line 1978 of file SyFi.py.
References barycenter_line().
01978 01979 def barycenter_line(*args): 01980 """barycenter_line(GiNaC::ex p0, GiNaC::ex p1) -> GiNaC::ex""" 01981 return _SyFi.barycenter_line(*args)
GiNaC::ex SyFi::barycenter_tetrahedron | ( | GiNaC::ex | p0, |
GiNaC::ex | p1, | ||
GiNaC::ex | p2, | ||
GiNaC::ex | p3 | ||
) |
ex SyFi::barycenter_tetrahedron | ( | ex | p0, |
ex | p1, | ||
ex | p2, | ||
ex | p3 | ||
) |
Definition at line 1732 of file Polygon.cpp.
References x.
Referenced by _wrap_barycenter_tetrahedron(), barycenter_tetrahedron(), barycenter_triangle(), bernstein(), and SyFi::Bubble::compute_basis_functions().
{ GiNaC::symbol b0("b0"), b1("b1"), b2("b2"), b3("b3"); // 3D ex eq1 = x == b0*p0.op(0) + b1*p1.op(0) + b2*p2.op(0) + b3*p3.op(0); ex eq2 = y == b0*p0.op(1) + b1*p1.op(1) + b2*p2.op(1) + b3*p3.op(1); ex eq3 = z == b0*p0.op(2) + b1*p1.op(2) + b2*p2.op(2) + b3*p3.op(2); ex eq4 = 1 == b0 + b1 + b2 +b3; ex sol = lsolve(lst(eq1, eq2, eq3, eq4), lst(b0, b1, b2, b3)); return sol; }
def SyFi.barycenter_tetrahedron | ( | args | ) |
barycenter_tetrahedron(GiNaC::ex p0, GiNaC::ex p1, GiNaC::ex p2, GiNaC::ex p3) -> GiNaC::ex
Definition at line 1986 of file SyFi.py.
References barycenter_tetrahedron().
01986 01987 def barycenter_tetrahedron(*args): 01988 """barycenter_tetrahedron(GiNaC::ex p0, GiNaC::ex p1, GiNaC::ex p2, GiNaC::ex p3) -> GiNaC::ex""" 01989 return _SyFi.barycenter_tetrahedron(*args)
GiNaC::ex SyFi::barycenter_triangle | ( | GiNaC::ex | p0, |
GiNaC::ex | p1, | ||
GiNaC::ex | p2 | ||
) |
ex SyFi::barycenter_triangle | ( | ex | p0, |
ex | p1, | ||
ex | p2 | ||
) |
Definition at line 1671 of file Polygon.cpp.
References barycenter_tetrahedron(), cross(), test::n, and x.
Referenced by _wrap_barycenter_triangle(), barycenter_triangle(), bernstein(), and SyFi::Bubble::compute_basis_functions().
{ ex sol; // 2D if ( p0.nops() == 2 && p1.nops() == 2 && p2.nops() == 2) { GiNaC::symbol b0("b0"), b1("b1"), b2("b2"); ex eq1 = x == b0*p0.op(0) + b1*p1.op(0) + b2*p2.op(0); ex eq2 = y == b0*p0.op(1) + b1*p1.op(1) + b2*p2.op(1); ex eq3 = 1 == b0 + b1 + b2; sol = lsolve(lst(eq1, eq2, eq3), lst(b0, b1, b2)); } // 3D else if ( p0.nops() == 3 && p1.nops() == 3 && p2.nops() == 3) { lst n1(p1.op(0) - p0.op(0), p1.op(1) - p0.op(1), p1.op(2) - p0.op(2)); lst n2 = lst(p2.op(0) - p0.op(0), p2.op(1) - p0.op(1), p2.op(2) - p0.op(2)); lst n = cross(n1,n2); lst midpoint = lst((p0.op(0) + p1.op(0) + p2.op(0))/3, (p0.op(1) + p1.op(1) + p2.op(1))/3, (p0.op(2) + p1.op(2) + p2.op(2))/3); ex p3 = lst(midpoint.op(0) + n.op(0), midpoint.op(1) + n.op(1), midpoint.op(2) + n.op(2)); ex s = barycenter_tetrahedron(p0, p1, p2, p3); lst solution; for (unsigned int i=0; i<s.nops(); i++) { ex d = s.op(i).subs(x == p3.op(0)).subs(y == p3.op(1)).subs(z == p3.op(2)); d = d.rhs(); if ( GiNaC::is_a<GiNaC::numeric>(d)) { // FIXME: bad test, should use the toleranse variable set by CLN or something if ( GiNaC::abs(GiNaC::ex_to<GiNaC::numeric>(d)) < 10e-8) { solution.append(s.op(i)); } } else { if ( d.is_zero() ) { solution.append(s.op(i)); } } } sol = solution; } else { throw std::runtime_error("Could not compute the barycentric coordinates. Check the coordinates."); } return sol; }
def SyFi.barycenter_triangle | ( | args | ) |
barycenter_triangle(GiNaC::ex p0, GiNaC::ex p1, GiNaC::ex p2) -> GiNaC::ex
Definition at line 1982 of file SyFi.py.
References barycenter_triangle().
01982 01983 def barycenter_triangle(*args): 01984 """barycenter_triangle(GiNaC::ex p0, GiNaC::ex p1, GiNaC::ex p2) -> GiNaC::ex""" 01985 return _SyFi.barycenter_triangle(*args)
GiNaC::ex SyFi::bernstein | ( | unsigned int | order, |
Polygon & | p, | ||
const std::string & | a | ||
) |
ex SyFi::bernstein | ( | unsigned int | order, |
Polygon & | p, | ||
const string & | a | ||
) |
Definition at line 1790 of file Polygon.cpp.
References barycenter_line(), barycenter_tetrahedron(), barycenter_triangle(), get_symbolic_matrix(), matrix_to_lst2(), SyFi::Polygon::str(), and SyFi::Polygon::vertex().
Referenced by _wrap_bernstein(), bernstein(), bernsteinv(), demos.crouzeixraviart.CrouzeixRaviart::compute_basis_functions(), SyFi::Nedelec::compute_basis_functions(), SyFi::CrouzeixRaviart::compute_basis_functions(), SyFi::Lagrange::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), and main().
{ if ( order < 0 ) { throw(std::logic_error("Can not create polynomials of order less than 0!")); } ex ret; // ex to return int dof; // degrees of freedom ex A; // ex holding the coefficients a_0 .. a_dof lst basis; if ( p.str().find("Line") != string::npos ) { ex bary = barycenter_line(p.vertex(0), p.vertex(1)); ex b0= bary.op(0).rhs(); ex b1= bary.op(1).rhs(); dof = order+1; A = get_symbolic_matrix(1,dof, a); int o=0; for (GiNaC::const_iterator i = A.begin(); i != A.end(); ++i) { ex scale = GiNaC::binomial(order,o); ret += (*i)*scale*pow(b0,o)*pow(b1,order-o); basis.append(scale*pow(b0,o)*pow(b1,order-o)); o++; } } else if ( p.str().find("Triangle") != string::npos ) { dof = (order+1)*(order+2)/2; A = get_symbolic_matrix(1, dof , a); ex bary = barycenter_triangle(p.vertex(0), p.vertex(1), p.vertex(2)); ex b0= bary.op(0).rhs(); ex b1= bary.op(1).rhs(); ex b2= bary.op(2).rhs(); size_t i=0; for (unsigned int o1 = 0; o1 <= order; o1++) { for (unsigned int o2 = 0; o2 <= order; o2++) { for (unsigned int o3 = 0; o3 <= order; o3++) { if ( o1 + o2 + o3 == order ) { ex scale = (GiNaC::factorial(order)/(GiNaC::factorial(o1)*GiNaC::factorial(o2)*GiNaC::factorial(o3))); ret += A.op(i)*scale*pow(b0,o1)*pow(b1,o2)*pow(b2,o3); basis.append(scale*pow(b0,o1)*pow(b1,o2)*pow(b2,o3)); i++; } } } } } else if ( p.str().find("Tetrahedron") != string::npos ) { dof = 0; for (unsigned int j=0; j<= order; j++) { dof += (j+1)*(j+2)/2; } A = get_symbolic_matrix(1, dof , a); ex bary = barycenter_tetrahedron(p.vertex(0), p.vertex(1), p.vertex(2), p.vertex(3)); ex b0= bary.op(0).rhs(); ex b1= bary.op(1).rhs(); ex b2= bary.op(2).rhs(); ex b3= bary.op(3).rhs(); size_t i=0; for (unsigned int o1 = 0; o1 <= order; o1++) { for (unsigned int o2 = 0; o2 <= order; o2++) { for (unsigned int o3 = 0; o3 <= order; o3++) { for (unsigned int o4 = 0; o4 <= order; o4++) { if ( o1 + o2 + o3 + o4 == order ) { ex scale = (GiNaC::factorial(order)/(GiNaC::factorial(o1)*GiNaC::factorial(o2)*GiNaC::factorial(o3)*GiNaC::factorial(o4))); ret += A.op(i)*scale*pow(b0,o1)*pow(b1,o2)*pow(b2,o3)*pow(b3,o4); basis.append(scale*pow(b0,o1)*pow(b1,o2)*pow(b2,o3)*pow(b3,o4)); i++; } } } } } } else if (p.str() == "Simplex" || p.str() == "ReferenceSimplex") { throw std::runtime_error("Not implemented yet."); // ex bary = barycenter(p); } return lst(ret,matrix_to_lst2(A),basis); }
def SyFi.bernstein | ( | args | ) |
bernstein(unsigned int order, Polygon p, string a) -> GiNaC::ex
Definition at line 1994 of file SyFi.py.
References bernstein().
GiNaC::lst SyFi::bernsteinv | ( | unsigned int | no_fields, |
unsigned int | order, | ||
Polygon & | p, | ||
const std::string & | a | ||
) |
lst SyFi::bernsteinv | ( | unsigned int | no_fields, |
unsigned int | order, | ||
Polygon & | p, | ||
const string & | a | ||
) |
Definition at line 1897 of file Polygon.cpp.
References bernstein(), pol(), run::s, and SyFi::Polygon::str().
Referenced by _wrap_bernsteinv(), bernsteinv(), SyFi::Nedelec::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), and SyFi::Robust::compute_basis_functions_old().
{ if ( order < 0 ) { throw(std::logic_error("Can not create polynomials of order less than 0!")); } lst ret1; // contains the polynom lst ret2; // contains the coefficients lst ret3; // constains the basis functions lst basis_tmp; for (unsigned int i=0; i< no_fields; i++) { lst basis; std::ostringstream s; s <<a<<""<<i<<"_"; ex pol = bernstein(order, p, s.str()); ret1.append(pol.op(0)); ret2.append(pol.op(1)); basis_tmp = ex_to<lst>(pol.op(2)); for (lst::const_iterator basis_iterator = basis_tmp.begin(); basis_iterator != basis_tmp.end(); ++basis_iterator) { lst tmp_lst; for (unsigned int d=1; d<=no_fields; d++) tmp_lst.append(0); tmp_lst.let_op(i) = (*basis_iterator); ret3.append(tmp_lst); } } return lst(ret1,ret2,ret3); }
def SyFi.bernsteinv | ( | args | ) |
bernsteinv(unsigned int no_fields, unsigned int order, Polygon p, string a) -> GiNaC::lst
Definition at line 1998 of file SyFi.py.
References bernsteinv().
01998 01999 def bernsteinv(*args): 02000 """ 02001 bernsteinv(unsigned int no_fields, unsigned int order, Polygon p, 02002 string a) -> GiNaC::lst 02003 """ 02004 return _SyFi.bernsteinv(*args)
GiNaC::lst SyFi::bezier_ordinates | ( | Tetrahedron & | tetrahedra, |
unsigned int | d | ||
) |
Definition at line 1372 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(), bezier_ordinates(), SyFi::Lagrange::compute_basis_functions(), and main().
{ //FIXME: ugly conversion to matrix lst ret; ex V1 = tetrahedra.vertex(0); ex V2 = tetrahedra.vertex(1); ex V3 = tetrahedra.vertex(2); ex V4 = tetrahedra.vertex(3); lst V1l = ex_to<lst>(V1); lst V2l = ex_to<lst>(V2); lst V3l = ex_to<lst>(V3); lst V4l = ex_to<lst>(V4); ex V1m = lst_to_matrix2(V1l); ex V2m = lst_to_matrix2(V2l); ex V3m = lst_to_matrix2(V3l); ex V4m = lst_to_matrix2(V4l); int l; for (unsigned int i=0; i<= d; i++) { for (unsigned int j=0; j<= d; j++) { for (unsigned int k=0; k<= d; k++) { if ( d - i - j -k >= 0 ) { l= d - i - j -k; ex sum = (l*V1m + k*V2m + j*V3m + i*V4m)/d; ret.append(matrix_to_lst2(sum.evalm())); } } } } // FIXME how should these be sorted ????? // ret = ret.sort(); return ret; }
GiNaC::lst SyFi::bezier_ordinates | ( | Triangle & | triangle, |
unsigned int | d | ||
) |
Definition at line 1457 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 1531 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 2052 of file SyFi.py.
References bezier_ordinates().
02052 02053 def bezier_ordinates(*args): 02054 """ 02055 bezier_ordinates(Line line, unsigned int d) -> GiNaC::lst 02056 bezier_ordinates(Triangle triangle, unsigned int d) -> GiNaC::lst 02057 bezier_ordinates(Tetrahedron tetrahedra, unsigned int d) -> GiNaC::lst 02058 """ 02059 return _SyFi.bezier_ordinates(*args)
void SyFi::check_visitor | ( | GiNaC::ex | e, |
GiNaC::lst & | exlist | ||
) |
Definition at line 461 of file ginac_tools.cpp.
References find().
Referenced by _wrap_check_visitor(), and check_visitor().
{ if (find(e, exlist) >= 0) return; // cout <<"ex e "<<e<<endl; if (GiNaC::is_a<GiNaC::numeric>(e)) { } else if (GiNaC::is_a<GiNaC::add>(e) ) { // cout <<"e "<<e <<endl; // cout <<"e.nops() "<<e.nops() <<endl; if (e.nops() > 4 && e.nops() < 10 ) exlist.append(e); for (unsigned int i=0; i< e.nops(); i++) { GiNaC::ex e2 = e.op(i); // cout <<"add e "<<e2<<endl; // exlist.append(e2); check_visitor(e2,exlist); } } else if (GiNaC::is_a<GiNaC::mul>(e)) { for (unsigned int i=0; i< e.nops(); i++) { GiNaC::ex e2 = e.op(i); // cout <<"mul e "<<e2<<endl; exlist.append(e2); check_visitor(e2,exlist); } } else if (GiNaC::is_a<GiNaC::lst>(e)) { for (unsigned int i=0; i< e.nops(); i++) { GiNaC::ex e2 = e.op(i); // cout <<"GiNaC::lst e "<<e2<<endl; // exlist.append(e2); check_visitor(e2,exlist); } } else if (GiNaC::is_exactly_a<GiNaC::power>(e)) { exlist.append(e); for (unsigned int i=0; i< e.nops(); i++) { GiNaC::ex e2 = e.op(i); // cout <<"power e "<<e2<<endl; check_visitor(e2,exlist); } } else if (GiNaC::is_a<GiNaC::function>(e)) { exlist.append(e); for (unsigned int i=0; i< e.nops(); i++) { GiNaC::ex e2 = e.op(i); // cout <<"function e "<<e2<<endl; check_visitor(e2,exlist); } } else { // exlist.append(e); // cout <<"atom e "<<e<<endl; } exlist.sort(); exlist.unique(); }
def SyFi.check_visitor | ( | args | ) |
check_visitor(GiNaC::ex e, GiNaC::lst exlist)
Definition at line 1345 of file SyFi.py.
References check_visitor().
01345 01346 def check_visitor(*args): 01347 """check_visitor(GiNaC::ex e, GiNaC::lst exlist)""" 01348 return _SyFi.check_visitor(*args)
GiNaC::exvector SyFi::coeff | ( | GiNaC::ex | pol | ) |
Definition at line 855 of file ginac_tools.cpp.
Referenced by _wrap_coeff(), coeff(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), and SyFi::Robust::compute_basis_functions_old().
{ using SyFi::x; using SyFi::y; using SyFi::z; GiNaC::exvector cc; GiNaC::ex c, b; for (int i=pol.ldegree(x); i<=pol.degree(x); ++i) { for (int j=pol.ldegree(y); j<=pol.degree(y); ++j) { for (int k=pol.ldegree(z); k<=pol.degree(z); ++k) { c = pol.coeff(x,i).coeff(y, j).coeff(z,k); if ( c != 0 ) cc.insert(cc.begin(),c); } } } return cc; }
def SyFi.coeff | ( | args | ) |
GiNaC::lst SyFi::coeffs | ( | GiNaC::lst | pols | ) |
Definition at line 819 of file ginac_tools.cpp.
References collapse().
Referenced by _wrap_coeffs__SWIG_0(), _wrap_coeffs__SWIG_1(), and coeffs().
GiNaC::lst SyFi::coeffs | ( | GiNaC::ex | pol | ) |
Definition at line 832 of file ginac_tools.cpp.
{ using SyFi::x; using SyFi::y; using SyFi::z; GiNaC::lst cc; GiNaC::ex c, b; for (int i=pol.ldegree(x); i<=pol.degree(x); ++i) { for (int j=pol.ldegree(y); j<=pol.degree(y); ++j) { for (int k=pol.ldegree(z); k<=pol.degree(z); ++k) { c = pol.coeff(x,i).coeff(y, j).coeff(z,k); if ( c != 0 ) cc.append(c); } } } return cc; }
def SyFi.coeffs | ( | args | ) |
GiNaC::lst SyFi::collapse | ( | GiNaC::lst | l | ) |
Definition at line 214 of file ginac_tools.cpp.
Referenced by _wrap_collapse(), coeffs(), collapse(), SyFi::Nedelec::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), and SyFi::Robust::compute_basis_functions_old().
{ GiNaC::lst lc; GiNaC::lst::const_iterator iter1, iter2; for (iter1 = l.begin(); iter1 != l.end(); ++iter1) { if (GiNaC::is_a<GiNaC::lst>(*iter1)) { for (iter2 = GiNaC::ex_to<GiNaC::lst>(*iter1).begin(); iter2 != GiNaC::ex_to<GiNaC::lst>(*iter1).end(); ++iter2) { lc.append(*iter2); } } else { lc.append(*iter1); } } lc.sort(); lc.unique(); return lc; }
def SyFi.collapse | ( | args | ) |
collapse(GiNaC::lst l) -> GiNaC::lst
Definition at line 1314 of file SyFi.py.
References collapse().
void SyFi::collect_symbols | ( | const GiNaC::ex & | e, |
exset & | v | ||
) |
Definition at line 1234 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().
GiNaC::exvector SyFi::collect_symbols | ( | const GiNaC::ex & | e | ) |
Definition at line 1250 of file ginac_tools.cpp.
References SyFi.exset::begin(), collect_symbols(), SyFi.exset::end(), run::s, SyFi.exset::size(), and demo::v.
def SyFi.collect_symbols | ( | args | ) |
collect_symbols(GiNaC::ex e, exset v) collect_symbols(GiNaC::ex e) -> GiNaC::exvector
Definition at line 1485 of file SyFi.py.
References collect_symbols().
01485 01486 def collect_symbols(*args): 01487 """ 01488 collect_symbols(GiNaC::ex e, exset v) 01489 collect_symbols(GiNaC::ex e) -> GiNaC::exvector 01490 """ 01491 return _SyFi.collect_symbols(*args) 01492
bool SyFi::compare | ( | const GiNaC::ex & | e, |
const std::string & | s | ||
) |
bool SyFi::compare | ( | const ex & | e, |
const string & | s | ||
) |
Definition at line 1087 of file ginac_tools.cpp.
References test::e, and run::s.
Referenced by _wrap_compare(), compare(), EQUAL_OR_DIE(), and SWIG_MangledTypeQueryModule().
def SyFi.compare | ( | args | ) |
bool SyFi::compare_archives | ( | const std::string & | first, |
const std::string & | second, | ||
std::ostream & | os = std::cout |
||
) |
bool SyFi::compare_archives | ( | const string & | first, |
const string & | second, | ||
std::ostream & | os | ||
) |
Definition at line 1263 of file ginac_tools.cpp.
References extract_symbols(), and test::n.
Referenced by _wrap_compare_archives__SWIG_0(), _wrap_compare_archives__SWIG_1(), check_CrouzeixRaviart(), compare_archives(), and main().
{ bool ret = true; // read both archives archive a1, a2; ifstream if1(first.c_str()), if2(second.c_str()); if1 >> a1; if2 >> a2; // compare size int n = a1.num_expressions(); int n2 = a2.num_expressions(); if(n != n2) { os << "Archives " << first << " and " << second << " has a different number of expressions, " << n << " and " << n2 << "." << endl; os << "Comparing common expressions." << endl; ret = false; } // iterate over all expressions in first archive ex e1,e2; for(int i=0; i<n; i++) { lst syms; string exname; e1 = a1.unarchive_ex(syms, exname, i); syms = ex_to<lst>(extract_symbols(e1)); // os << "Comparing " << exname << " with symbols " << syms << endl; // is this in the second archive? try { e2 = a2.unarchive_ex(syms, exname.c_str()); // got it, now compare bool isequal = is_zero(e1-e2); if(!isequal) { if(ret) { os << "Archives " << first << " and " << second << " are not equal, details follow:" << endl; } os << "Expression with name " << exname << " is not equal:" << endl; os << "First: " << endl << e1 << endl; os << "Second: " << endl << e2 << endl; ret = false; } } catch(...) { os << "Expression " << exname << " is missing from " << second << "." << endl; ret = false; } } return ret; }
def SyFi.compare_archives | ( | args | ) |
compare_archives(string first, string second, std::ostream os = std::cout) -> bool compare_archives(string first, string second) -> bool
Definition at line 1448 of file SyFi.py.
References compare_archives().
01448 01449 def compare_archives(*args): 01450 """ 01451 compare_archives(string first, string second, std::ostream os = std::cout) -> bool 01452 compare_archives(string first, string second) -> bool 01453 """ 01454 return _SyFi.compare_archives(*args)
void SyFi::compute_mixed_Poisson_element_matrix | ( | FE & | v_fe, |
FE & | p_fe, | ||
Dof & | dof, | ||
std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > & | A | ||
) |
Definition at line 150 of file ElementComputations.cpp.
References 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(), 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 2442 of file SyFi.py.
References compute_mixed_Poisson_element_matrix().
02442 02443 def compute_mixed_Poisson_element_matrix(*args): 02444 """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)
void SyFi::compute_Poisson_element_matrix | ( | FE & | fe, |
Dof & | dof, | ||
std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > & | A | ||
) |
Definition at line 52 of file ElementComputations.cpp.
References 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().
Referenced by compute_Poisson_element_matrix().
{ std::pair<unsigned int,unsigned int> index; // Insert the local degrees of freedom into the global Dof for (unsigned int i=0; i< fe.nbf(); i++) { dof.insert_dof(1,i,fe.dof(i)); } Polygon& domain = fe.get_polygon(); // The term (grad u, grad v) for (unsigned int i=0; i< fe.nbf(); i++) { // fetch the global dof for Ni index.first = dof.glob_dof(fe.dof(i)); for (unsigned int j=0; j< fe.nbf(); j++) { // fetch the global dof for Nj index.second = dof.glob_dof(fe.dof(j)); // compute the integrand GiNaC::ex nabla = inner(grad(fe.N(i)), grad(fe.N(j))); // compute the integral GiNaC::ex Aij = domain.integrate(nabla); A[index] += Aij; // add to global matrix } } }
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 2434 of file SyFi.py.
References compute_Poisson_element_matrix().
02434 02435 def compute_Poisson_element_matrix(*args): 02436 """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)""" 02437 return _SyFi.compute_Poisson_element_matrix(*args)
void SyFi::compute_Stokes_element_matrix | ( | FE & | v_fe, |
FE & | p_fe, | ||
Dof & | dof, | ||
std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > & | A | ||
) |
Definition at line 86 of file ElementComputations.cpp.
References 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(), 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 2438 of file SyFi.py.
References compute_Stokes_element_matrix().
02438 02439 def compute_Stokes_element_matrix(*args): 02440 """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)""" 02441 return _SyFi.compute_Stokes_element_matrix(*args)
bool SyFi::contains2D | ( | Ptv & | e0, |
Ptv & | e1, | ||
Ptv & | p | ||
) |
Definition at line 201 of file Ptv_tools.cpp.
References line_contains(), and Ptv::size().
{ if ( e0.size() != e1.size() || e0.size() != p.size() ) { throw(std::logic_error("Exception from contains2D(Ptv&, Ptv&, Ptv&): The dimentions of a and b must be the same.")); } bool b = line_contains(e0, e1, p); return b; }
bool SyFi::contains3D | ( | Ptv & | e0, |
Ptv & | e1, | ||
Ptv & | e2, | ||
Ptv & | p | ||
) |
Definition at line 214 of file Ptv_tools.cpp.
References is_equal(), is_inside_triangle(), and line_contains().
{ // check if p is either e0, e1, or e2 if ( is_equal(e0, p) ) return true; else if ( is_equal(e1, p) ) return true; else if ( is_equal(e2, p) ) return true; // check if p is on the lines connecting e0, e1, and e2 if ( line_contains(e0, e1, p) ) return true; else if ( line_contains(e1, e2, p) ) return true; else if ( line_contains(e2, e1, p) ) return true; // check if p is inside the triangle with verticies e0, e1, and e2 if ( is_inside_triangle(e0, e1, e2, p) ) return true; return false; }
ExStats SyFi::count_ops | ( | const GiNaC::ex & | e | ) |
ExStats SyFi::count_ops | ( | const ex & | e | ) |
Definition at line 1378 of file ginac_tools.cpp.
References SyFi::ExStatsVisitor::es, and demo::v.
Referenced by _wrap_count_ops(), count_ops(), main(), and print().
def SyFi.count_ops | ( | args | ) |
GiNaC::exhashmap<int> SyFi::count_symbols | ( | const GiNaC::ex & | e | ) |
exhashmap<int> SyFi::count_symbols | ( | const ex & | e | ) |
Definition at line 1167 of file ginac_tools.cpp.
References SyFi::SymbolCounterVisitor::symbolcount, and demo::v.
Referenced by _wrap_count_symbols(), count_symbols(), and print().
def SyFi.count_symbols | ( | args | ) |
count_symbols(GiNaC::ex e) -> GiNaC::exhashmap<(int)>
Definition at line 1394 of file SyFi.py.
References count_symbols().
01394 01395 def count_symbols(*args): 01396 """count_symbols(GiNaC::ex e) -> GiNaC::exhashmap<(int)>""" 01397 return _SyFi.count_symbols(*args)
GiNaC::lst SyFi::cross | ( | GiNaC::lst & | v1, |
GiNaC::lst & | v2 | ||
) |
Definition at line 34 of file ginac_tools.cpp.
Referenced by _wrap_cross(), barycenter_triangle(), SyFi::Nedelec::compute_basis_functions(), cross(), line_contains(), and normal().
{ GiNaC::lst ret; if ( v1.nops() != v2.nops() ) { cout <<"incompatible vectors "<<endl; cout <<"v1.nops() "<<v1.nops(); cout <<" v2.nops() "<<v2.nops()<<endl; ; return GiNaC::lst(); } ret.append( v1.op(1)*v2.op(2) - v1.op(2)*v2.op(1)); ret.append(- v1.op(0)*v2.op(2) + v1.op(2)*v2.op(0)); ret.append( v1.op(0)*v2.op(1) - v1.op(1)*v2.op(0)); return ret; }
void SyFi::cross | ( | const Ptv & | a, |
const Ptv & | b, | ||
Ptv & | c | ||
) |
Definition at line 104 of file Ptv_tools.cpp.
References Ptv::redim(), and Ptv::size().
{ if ( a.size() != b.size() ) { throw(std::logic_error("Exception from cross (const Ptv&, const Ptv&, Ptv&): The dimentions of a and b must be the same.")); } if ( a.size() == 2 ) { c.redim(1); c[0] = a[0]*b[1] - a[1]*b[0]; } else if ( a.size() == 3 ) { c.redim(3); c[0] = a[1]*b[2] - b[1]*a[2]; c[1] = - a[0]*b[2] + b[0]*a[2]; c[2] = a[0]*b[1] - b[0]*a[1]; } else { throw(std::logic_error("The cross product can only be computed in 2D and 3D.")); } }
def SyFi.cross | ( | args | ) |
int SyFi::dirac | ( | unsigned int | i, |
unsigned int | j | ||
) |
Definition at line 34 of file utilities.cpp.
{ if (i==j) return 1; else return 0; }
def SyFi.dirac | ( | args | ) |
dirac(unsigned int i, unsigned int j) -> int
Definition at line 1286 of file SyFi.py.
Referenced by _wrap_dirac(), demos.crouzeixraviart.CrouzeixRaviart.compute_basis_functions(), SyFi::CrouzeixRaviart.compute_basis_functions(), and main().
GiNaC::ex SyFi::div | ( | GiNaC::ex | v | ) |
Definition at line 45 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(), fem_sympy::create_matrix(), div(), and main().
{ using SyFi::nsd; using SyFi::x; using SyFi::y; using SyFi::z; GiNaC::ex ret; if (GiNaC::is_a<GiNaC::matrix>(v)) { GiNaC::matrix m = GiNaC::ex_to<GiNaC::matrix>(v); if ( m.cols() == 1 && m.rows() == nsd ) { if (nsd == 1) { ret = diff(m,x); } else if (nsd == 2) { ret = diff(m.op(0),x) + diff(m.op(1),y) ; } else if (nsd == 3) { ret = diff(m.op(0),x) + diff(m.op(1),y) + diff(m.op(2),z) ; } else { throw std::runtime_error("Invalid nsd"); } } else { GiNaC::matrix retm = GiNaC::matrix(m.cols(),1); if ( nsd != m.rows() ) { throw(std::invalid_argument("The number of rows must equal nsd.")); } GiNaC::symbol xr; GiNaC::ex tmp; for (unsigned int c=0; c<m.cols(); c++) { for (unsigned int r=0; r<m.rows(); r++) { if (r+1 == 1) xr = x; if (r+1 == 2) xr = y; if (r+1 == 3) xr = z; retm(c,0) += diff(m(c,r), xr); } } ret = retm; } return ret; } else if (GiNaC::is_a<GiNaC::lst>(v)) { GiNaC::lst l = GiNaC::ex_to<GiNaC::lst>(v); return div(l); } throw std::invalid_argument("v must be a matrix or lst."); }
GiNaC::ex SyFi::div | ( | GiNaC::ex | v, |
GiNaC::ex | G | ||
) |
Definition at line 108 of file diff_tools.cpp.
References div(), 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 159 of file diff_tools.cpp.
GiNaC::ex SyFi::div | ( | GiNaC::lst & | v, |
GiNaC::ex | G | ||
) |
Definition at line 183 of file diff_tools.cpp.
{ 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 | ) |
def SyFi.div | ( | args | ) |
GiNaC::symbol SyFi::DUMMY | ( | "(DUMMY is not initialized since initSyFi has never been called)" | ) |
void SyFi::EQUAL_OR_DIE | ( | const GiNaC::ex & | e, |
const std::string & | s | ||
) |
void SyFi::EQUAL_OR_DIE | ( | const ex & | e, |
const string & | s | ||
) |
Definition at line 1095 of file ginac_tools.cpp.
References compare().
Referenced by _wrap_EQUAL_OR_DIE(), EQUAL_OR_DIE(), and main().
def SyFi.EQUAL_OR_DIE | ( | args | ) |
EQUAL_OR_DIE(GiNaC::ex e, string s)
Definition at line 1302 of file SyFi.py.
References EQUAL_OR_DIE().
01302 01303 def EQUAL_OR_DIE(*args): 01304 """EQUAL_OR_DIE(GiNaC::ex e, string s)""" 01305 return _SyFi.EQUAL_OR_DIE(*args)
GiNaC::matrix SyFi::equations2matrix | ( | const GiNaC::ex & | eqns, |
const GiNaC::ex & | symbols | ||
) |
Definition at line 238 of file ginac_tools.cpp.
Referenced by _wrap_equations2matrix(), and equations2matrix().
{ GiNaC::matrix sys(eqns.nops(),symbols.nops()); GiNaC::matrix rhs(eqns.nops(),1); GiNaC::matrix vars(symbols.nops(),1); for (size_t r=0; r<eqns.nops(); r++) { // lhs-rhs==0 const GiNaC::ex eq = eqns.op(r).op(0)-eqns.op(r).op(1); GiNaC::ex linpart = eq; for (size_t c=0; c<symbols.nops(); c++) { const GiNaC::ex co = eq.coeff(GiNaC::ex_to<GiNaC::symbol>(symbols.op(c)),1); linpart -= co*symbols.op(c); sys(r,c) = co; } linpart = linpart.expand(); rhs(r,0) = -linpart; } return sys; }
def SyFi.equations2matrix | ( | args | ) |
equations2matrix(GiNaC::ex eqns, GiNaC::ex symbols) -> GiNaC::matrix
Definition at line 1318 of file SyFi.py.
References equations2matrix().
01318 01319 def equations2matrix(*args): 01320 """equations2matrix(GiNaC::ex eqns, GiNaC::ex symbols) -> GiNaC::matrix""" 01321 return _SyFi.equations2matrix(*args)
GiNaC::lst SyFi::ex2equations | ( | GiNaC::ex | rel | ) |
Definition at line 187 of file ginac_tools.cpp.
References SyFi_polygons::spacetimedomain::l, x, y, and z.
Referenced by _wrap_ex2equations(), and ex2equations().
{ GiNaC::ex lhs = rel.lhs(); GiNaC::ex rhs = rel.rhs(); GiNaC::ex l; GiNaC::ex r; GiNaC::lst eqs; for (int i=lhs.ldegree(x); i<=lhs.degree(x); ++i) { for (int j=lhs.ldegree(y); j<=lhs.degree(y); ++j) { for (int k=lhs.ldegree(z); k<=lhs.degree(z); ++k) { l = lhs.coeff(x,i).coeff(y, j).coeff(z,k); r = rhs.coeff(x,i).coeff(y, j).coeff(z,k); // if (! (l == 0 && r == 0 ) ) eqs.append(l == r); OLD VERSION if ( (l != 0 && (r == 0 || r == 1) ) ) eqs.append(l == r); } } } eqs.sort(); return eqs; }
def SyFi.ex2equations | ( | args | ) |
ex2equations(GiNaC::ex rel) -> GiNaC::lst
Definition at line 1310 of file SyFi.py.
References ex2equations().
01310 01311 def ex2equations(*args): 01312 """ex2equations(GiNaC::ex rel) -> GiNaC::lst""" 01313 return _SyFi.ex2equations(*args)
GiNaC::ex SyFi::extract_symbols | ( | const GiNaC::ex & | e | ) |
ex SyFi::extract_symbols | ( | const ex & | e | ) |
Definition at line 1215 of file ginac_tools.cpp.
References SyFi_polygons::spacetimedomain::l, SyFi::SymbolCounterVisitor::symbolcount, and demo::v.
Referenced by _wrap_extract_symbols(), compare_archives(), and extract_symbols().
def SyFi.extract_symbols | ( | args | ) |
extract_symbols(GiNaC::ex e) -> GiNaC::ex
Definition at line 1398 of file SyFi.py.
References extract_symbols().
01398 01399 def extract_symbols(*args): 01400 """extract_symbols(GiNaC::ex e) -> GiNaC::ex""" return _SyFi.extract_symbols(*args)
string SyFi::exvector2string | ( | GiNaC::exvector & | v | ) |
int SyFi::find | ( | GiNaC::ex | e, |
GiNaC::lst | list | ||
) |
Definition at line 390 of file ginac_tools.cpp.
Referenced by _wrap_ex_int_map_find(), _wrap_exmap_find(), _wrap_exset_find(), _wrap_find(), check_visitor(), and find().
{ for (unsigned int i=0; i< list.nops(); i++) { if ( e == list.op(i) ) return i; } return -1; }
def SyFi.find | ( | args | ) |
const GiNaC::symbol& SyFi::get_symbol | ( | const std::string & | name | ) |
const symbol& SyFi::get_symbol | ( | const string & | name | ) |
Definition at line 123 of file syfi/symbol_factory.cpp.
References symbol_collection.
{ map<string, symbol>::iterator i = symbol_collection.find(name); if( i != symbol_collection.end() ) { return i->second; } return symbol_collection.insert(make_pair(name, symbol(name))).first->second; }
def SyFi.get_symbol | ( | args | ) |
get_symbol(string name) -> GiNaC::symbol
Definition at line 1505 of file SyFi.py.
Referenced by _wrap_get_symbol(), initSyFi(), isymb(), main(), pickExpression(), and replace_powers().
01505 01506 def get_symbol(*args): 01507 """get_symbol(string name) -> GiNaC::symbol""" 01508 return _SyFi.get_symbol(*args)
GiNaC::ex SyFi::get_symbolic_matrix | ( | int | m, |
int | n, | ||
const std::string & | basename | ||
) |
def SyFi.get_symbolic_matrix | ( | args | ) |
get_symbolic_matrix(int m, int n, string basename) -> GiNaC::ex
Definition at line 1513 of file SyFi.py.
Referenced by _wrap_get_symbolic_matrix(), bernstein(), homogenous_pol(), lagrange(), lagrangev(), legendre(), main(), pol(), and polb().
01513 01514 def get_symbolic_matrix(*args): 01515 """get_symbolic_matrix(int m, int n, string basename) -> GiNaC::ex""" return _SyFi.get_symbolic_matrix(*args)
GiNaC::ex SyFi::get_symbolic_vector | ( | int | m, |
const std::string & | basename | ||
) |
def SyFi.get_symbolic_vector | ( | args | ) |
get_symbolic_vector(int m, string basename) -> GiNaC::ex
Definition at line 1509 of file SyFi.py.
Referenced by _wrap_get_symbolic_vector(), barycenter(), initSyFi(), main(), and SyFi::Simplex.repr().
01509 01510 def get_symbolic_vector(*args): 01511 """get_symbolic_vector(int m, string basename) -> GiNaC::ex""" 01512 return _SyFi.get_symbolic_vector(*args)
GiNaC::ex SyFi::grad | ( | GiNaC::ex | f | ) |
Definition at line 245 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(), sfc_callbacks::scratch::boundary_callback(), compute_nlconvdiff_element_matrix(), compute_poisson_element_matrix(), compute_Poisson_element_matrix(), compute_Poisson_element_matrix(), compute_Stokes_element_matrix(), example_of_use(), grad(), sfc_callbacks::callback_forms::H1_scalar(), sfc_callbacks::callback_forms::H1_semi_scalar(), main(), sfc_callbacks::scratch::nonlinear_boundary_F(), sfc_callbacks::callback_forms::stiffness_matrix(), sfc_callbacks::scratch::stiffness_v1(), sfc_callbacks::scratch::stiffness_v2(), sfc_callbacks::callback_forms::stiffness_with_M_matrix(), sfc_callbacks::scratch::stiffness_with_tokens_matrix(), and usage().
{ using SyFi::nsd; using SyFi::x; using SyFi::y; using SyFi::z; if (GiNaC::is_a<GiNaC::matrix>(f)) { GiNaC::matrix m = GiNaC::ex_to<GiNaC::matrix>(f); GiNaC::matrix ret_m(nsd,m.rows()); for (unsigned int r=0; r< m.rows(); r++) { if (nsd == 1) { // ret_m(0,r) = diff(m.op(r),x); return diff(f, x); } else if ( nsd == 2) { ret_m(0,r) = diff(m.op(r),x); ret_m(1,r) = diff(m.op(r),y); } else if ( nsd == 3) { ret_m(0,r) = diff(m.op(r),x); ret_m(1,r) = diff(m.op(r),y); ret_m(2,r) = diff(m.op(r),z); } } return ret_m; } else { if (nsd == 1) { // return GiNaC::matrix(nsd,1,GiNaC::lst(diff(f,x))); return diff(f,x); } else if ( nsd == 2) { return GiNaC::matrix(nsd,1,GiNaC::lst(diff(f,x), diff(f,y))); } else if ( nsd == 3) { return GiNaC::matrix(nsd,1,GiNaC::lst(diff(f,x), diff(f,y), diff(f,z))); } else { throw(std::invalid_argument("nsd must be either 1, 2, or 3.")); return GiNaC::matrix(); } } }
GiNaC::ex SyFi::grad | ( | GiNaC::ex | f, |
GiNaC::ex | G | ||
) |
Definition at line 301 of file diff_tools.cpp.
References 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.grad | ( | args | ) |
GiNaC::ex SyFi::homogenous_pol | ( | unsigned int | order, |
unsigned int | nsd, | ||
const std::string | a | ||
) |
GiNaC::ex SyFi::homogenous_pol | ( | unsigned int | order, |
unsigned int | nsd, | ||
const string | a | ||
) |
Definition at line 534 of file ginac_tools.cpp.
References demo::a, get_symbolic_matrix(), istr(), matrix_to_lst2(), x, y, and z.
Referenced by _wrap_homogenous_pol(), homogenous_pol(), homogenous_polv(), and main().
{ using SyFi::x; using SyFi::y; using SyFi::z; if ( nsd == 1) { GiNaC::symbol a0(istr(a,0)); return GiNaC::lst(a0*pow(x,order), a0, pow(x,order)); } else if ( nsd == 2 ) { GiNaC::ex variables = get_symbolic_matrix(1,order+1, a); GiNaC::lst basis; GiNaC::ex ret; for (unsigned int i=0; i<= order; i++) { basis.append(pow(x,i)*pow(y,order-i)); ret += variables.op(i)*basis.op(i); } return GiNaC::lst(ret, matrix_to_lst2(variables), basis); } else if ( nsd == 3 ) { GiNaC::lst basis; for (unsigned int i=0; i<= order; i++) { for (unsigned int j=0; j<= order; j++) { for (unsigned int k=0; k<= order; k++) { if ( i + j + k == order ) { basis.append(pow(x,i)*pow(y,j)*pow(z,k)); } } } } GiNaC::ex variables = get_symbolic_matrix(1,basis.nops(), a); GiNaC::ex ret; for (unsigned int i=0; i<basis.nops(); i++) { ret += variables.op(i)*basis.op(i); } return GiNaC::lst(ret, matrix_to_lst2(variables), basis); } throw std::runtime_error("Homogenous polynomials only implemented in 1D, 2D and 3D"); }
def SyFi.homogenous_pol | ( | args | ) |
homogenous_pol(unsigned int order, unsigned int nsd, string a) -> GiNaC::ex
Definition at line 1368 of file SyFi.py.
References homogenous_pol().
01368 01369 def homogenous_pol(*args): 01370 """homogenous_pol(unsigned int order, unsigned int nsd, string a) -> GiNaC::ex""" 01371 return _SyFi.homogenous_pol(*args)
GiNaC::lst SyFi::homogenous_polv | ( | unsigned int | no_fields, |
unsigned int | order, | ||
unsigned int | nsd, | ||
const std::string | a | ||
) |
GiNaC::lst SyFi::homogenous_polv | ( | unsigned int | no_fields, |
unsigned int | order, | ||
unsigned int | nsd, | ||
const string | a | ||
) |
Definition at line 585 of file ginac_tools.cpp.
References homogenous_pol(), and run::s.
Referenced by _wrap_homogenous_polv(), SyFi::Nedelec::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), and homogenous_polv().
{ GiNaC::lst ret1; // contains the polynom GiNaC::lst ret2; // contains the coefficients GiNaC::lst ret3; // constains the basis functions GiNaC::lst basis_tmp; for (unsigned int i=0; i< no_fields; i++) { GiNaC::lst basis; std::ostringstream s; s <<a<<""<<i<<"_"; GiNaC::ex polspace = homogenous_pol(order, nsd, s.str()); ret1.append(polspace.op(0)); ret2.append(polspace.op(1)); basis_tmp = GiNaC::ex_to<GiNaC::lst>(polspace.op(2)); for (GiNaC::lst::const_iterator basis_iterator = basis_tmp.begin(); basis_iterator != basis_tmp.end(); ++basis_iterator) { GiNaC::lst tmp_lst; for (unsigned int d=1; d<=no_fields; d++) tmp_lst.append(0); tmp_lst.let_op(i) = (*basis_iterator); ret3.append(tmp_lst); } } return GiNaC::lst(ret1,ret2,ret3); }
def SyFi.homogenous_polv | ( | args | ) |
homogenous_polv(unsigned int no_fields, unsigned int order, unsigned int nsd, string a) -> GiNaC::lst
Definition at line 1372 of file SyFi.py.
References homogenous_polv().
01372 01373 def homogenous_polv(*args): 01374 """ 01375 homogenous_polv(unsigned int no_fields, unsigned int order, unsigned int nsd, 01376 string a) -> GiNaC::lst 01377 """ 01378 return _SyFi.homogenous_polv(*args)
GiNaC::symbol SyFi::infinity | ( | "(infinity is not initialized since initSyFi has never been called)" | ) |
void SyFi::initSyFi | ( | unsigned int | nsd_ | ) |
Definition at line 46 of file syfi/symbol_factory.cpp.
References DUMMY, get_symbol(), get_symbolic_vector(), infinity, nsd, p, t, x, y, and z.
{ // initSyFi uses the global coordinates x for nsd == 1 // initSyFi uses the global coordinates x,y for nsd == 2 // initSyFi uses the global coordinates x,y,z for nsd == 3 // when nsd > 3 the coordinates can be found in the p, which is of type lst // FIXME: this whole thing is just a mess, but it's a nontrivial job to fix it all over syfi... SyFi::nsd = nsd_; SyFi::t = get_symbol("t"); SyFi::infinity = get_symbol("infinity"); SyFi::DUMMY = get_symbol("DUMMY"); SyFi::x = get_symbol("(SyFi::x is not initialized)"); SyFi::y = get_symbol("(SyFi::y is not initialized)"); SyFi::z = get_symbol("(SyFi::z is not initialized)"); /* std::cout << "SyFi::p before remove_all:" << std::endl; std::cout << SyFi::p << std::endl; */ SyFi::p.remove_all(); /* std::cout << "SyFi::p after remove_all:" << std::endl; std::cout << SyFi::p << std::endl; */ if ( nsd > 3 ) { SyFi::x = get_symbol("(SyFi::x is an invalid symbol when nsd>3)"); SyFi::y = get_symbol("(SyFi::y is an invalid symbol when nsd>3)"); SyFi::z = get_symbol("(SyFi::z is an invalid symbol when nsd>3)"); ex tmp = get_symbolic_vector(nsd, "x"); for (unsigned int i=0; i<tmp.nops(); i++) { p.append(tmp.op(i)); } } else { if ( nsd > 0 ) { SyFi::x = get_symbol("x"); SyFi::p.append(SyFi::x); } if ( nsd > 1 ) { SyFi::y = get_symbol("y"); SyFi::p.append(SyFi::y); } if ( nsd > 2 ) { SyFi::z = get_symbol("z"); SyFi::p.append(SyFi::z); } } /* std::cout << "SyFi::p at end of initSyFi:" << std::endl; std::cout << SyFi::p << std::endl; */ }
def SyFi.initSyFi | ( | args | ) |
initSyFi(unsigned int nsd)
Definition at line 1497 of file SyFi.py.
Referenced by _wrap_initSyFi(), check_CrouzeixRaviart(), check_RaviartThomas(), and main().
GiNaC::ex SyFi::inner | ( | GiNaC::ex | a, |
GiNaC::ex | b, | ||
bool | transposed | ||
) |
Definition at line 50 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(), sfc_callbacks::scratch::boundary_callback(), SyFi::Nedelec::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Robust::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(), sfc_callbacks::callback_forms::H1_scalar(), sfc_callbacks::callback_forms::H1_semi_scalar(), inner(), sfc_callbacks::callback_forms::L2_scalar(), sfc_callbacks::callback_forms::load_vector(), main(), sfc_callbacks::callback_forms::mass_boundary_matrix(), sfc_callbacks::callback_forms::mass_matrix(), sfc_callbacks::scratch::mass_v0(), sfc_callbacks::scratch::mass_v1(), sfc_callbacks::scratch::mass_v2(), sfc_callbacks::callback_forms::mass_with_c_matrix(), sfc_callbacks::scratch::nonlinear_boundary_F(), sfc_callbacks::scratch::nonlinear_F(), sfc_callbacks::callback_forms::source_vector(), sfc_callbacks::callback_forms::stiffness_matrix(), sfc_callbacks::scratch::stiffness_short(), sfc_callbacks::scratch::stiffness_v0(), sfc_callbacks::scratch::stiffness_v1(), sfc_callbacks::scratch::stiffness_v2(), sfc_callbacks::callback_forms::stiffness_with_M_matrix(), sfc_callbacks::scratch::stiffness_with_tokens_matrix(), and ufl2swiginac.Ufl2SwiginacTest::testProduct4().
{ if (GiNaC::is_a<GiNaC::matrix>(a) && GiNaC::is_a<GiNaC::matrix>(b)) { GiNaC::matrix ma = GiNaC::ex_to<GiNaC::matrix>(a); GiNaC::matrix mb = GiNaC::ex_to<GiNaC::matrix>(b); if ( !transposed ) { if (ma.cols() != mb.cols() || ma.rows() != mb.rows() ) { cout <<"Incompatible matrices "<<endl; cout <<"a.cols() "<<ma.cols()<<endl; cout <<"a.rows() "<<ma.rows()<<endl; cout <<"b.cols() "<<mb.cols()<<endl; cout <<"b.rows() "<<mb.rows()<<endl; cout <<"a="<<a<<endl; cout <<"b="<<b<<endl; throw std::runtime_error("Incompatible matrices."); } GiNaC::ex ret; for (unsigned int i=0; i<ma.rows(); i++) { for (unsigned int j=0; j<ma.cols(); j++) { ret += ma(i,j)*mb(i,j); } } return ret; } else { if (ma.cols() != mb.rows() || ma.rows() != mb.cols() ) { cout <<"Incompatible matrices "<<endl; cout <<"a.cols() "<<ma.cols()<<endl; cout <<"a.rows() "<<ma.rows()<<endl; cout <<"b.cols() "<<mb.cols()<<endl; cout <<"b.rows() "<<mb.rows()<<endl; cout <<"a="<<a<<endl; cout <<"b="<<b<<endl; throw std::runtime_error("Incompatible matrices."); } GiNaC::ex ret; for (unsigned int i=0; i<ma.rows(); i++) { for (unsigned int j=0; j<ma.cols(); j++) { ret += ma(i,j)*mb(j,i); } } return ret; } } else if (GiNaC::is_a<GiNaC::lst>(a) && GiNaC::is_a<GiNaC::lst>(b)) { return inner(GiNaC::ex_to<GiNaC::lst>(a), GiNaC::ex_to<GiNaC::lst>(b)); } else { return a*b; } }
GiNaC::ex SyFi::inner | ( | GiNaC::lst | v1, |
GiNaC::lst | v2 | ||
) |
Definition at line 116 of file ginac_tools.cpp.
References inner().
{ GiNaC::ex ret; if ( v1.nops() != v2.nops() ) { cout <<"incompatible vectors "<<endl; cout <<"v1.nops() "<<v1.nops(); cout <<" v2.nops() "<<v2.nops()<<endl; ; return 0; } for (unsigned i = 0; i <= v1.nops()-1 ; ++i) { if ( GiNaC::is_a<GiNaC::lst>(v1.op(i)) && GiNaC::is_a<GiNaC::lst>(v2.op(i)) ) { ret += inner(GiNaC::ex_to<GiNaC::lst>(v1.op(i)), GiNaC::ex_to<GiNaC::lst>(v2.op(i))); } else { ret += v1.op(i)*v2.op(i); } } return ret; }
GiNaC::ex SyFi::inner | ( | GiNaC::exvector & | v1, |
GiNaC::exvector & | v2 | ||
) |
Definition at line 143 of file ginac_tools.cpp.
{ GiNaC::ex ret; for (unsigned int i=0; i< v1.size(); i++) { ret += v1[i]*v2[i]; } return ret; }
def SyFi.inner | ( | args | ) |
inner(GiNaC::ex a, GiNaC::ex b, bool transposed = False) -> GiNaC::ex inner(GiNaC::ex a, GiNaC::ex b) -> GiNaC::ex inner(GiNaC::exvector v1, GiNaC::exvector v2) -> GiNaC::ex inner(GiNaC::lst v1, GiNaC::lst v2) -> GiNaC::ex
Definition at line 1455 of file SyFi.py.
References inner().
01455 01456 def inner(*args): 01457 """ 01458 inner(GiNaC::ex a, GiNaC::ex b, bool transposed = False) -> GiNaC::ex 01459 inner(GiNaC::ex a, GiNaC::ex b) -> GiNaC::ex 01460 inner(GiNaC::exvector v1, GiNaC::exvector v2) -> GiNaC::ex 01461 inner(GiNaC::lst v1, GiNaC::lst v2) -> GiNaC::ex 01462 """ 01463 return _SyFi.inner(*args)
std::string SyFi::int2string | ( | int | i | ) |
Definition at line 40 of file utilities.cpp.
{
ostringstream os;
os << i;
return os.str();
}
def SyFi.int2string | ( | args | ) |
int2string(int i) -> string
Definition at line 1290 of file SyFi.py.
Referenced by _wrap_int2string(), and replace_powers().
01290 01291 def int2string(*args): 01292 """int2string(int i) -> string""" 01293 return _SyFi.int2string(*args)
GiNaC::lst SyFi::interior_coordinates | ( | Tetrahedron & | tetrahedra, |
unsigned int | d | ||
) |
Definition at line 1414 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::RaviartThomas::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), and interior_coordinates().
{ //FIXME: ugly conversion to matrix d = d+4; lst ret; ex V1 = tetrahedra.vertex(0); ex V2 = tetrahedra.vertex(1); ex V3 = tetrahedra.vertex(2); ex V4 = tetrahedra.vertex(3); lst V1l = ex_to<lst>(V1); lst V2l = ex_to<lst>(V2); lst V3l = ex_to<lst>(V3); lst V4l = ex_to<lst>(V4); ex V1m = lst_to_matrix2(V1l); ex V2m = lst_to_matrix2(V2l); ex V3m = lst_to_matrix2(V3l); ex V4m = lst_to_matrix2(V4l); int l; for (unsigned int i=1; i< d; i++) { for (unsigned int j=1; j< d; j++) { for (unsigned int k=1; k< d; k++) { if ( int(d) - int(i) - int(j) - int(k) >= 1 ) { l= int(d) - int(i) - int(j) - int(k); ex sum = (l*V1m + k*V2m + j*V3m + i*V4m)/d; ret.append(matrix_to_lst2(sum.evalm())); } } } } // FIXME how should these be sorted ????? // ret = ret.sort(); return ret; }
GiNaC::lst SyFi::interior_coordinates | ( | Triangle & | triangle, |
unsigned int | d | ||
) |
Definition at line 1493 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 1572 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 2060 of file SyFi.py.
References interior_coordinates().
02060 02061 def interior_coordinates(*args): 02062 """ 02063 interior_coordinates(Line line, unsigned int d) -> GiNaC::lst 02064 interior_coordinates(Triangle triangle, unsigned int d) -> GiNaC::lst 02065 interior_coordinates(Tetrahedron tetrahedra, unsigned int d) -> GiNaC::lst 02066 """ 02067 return _SyFi.interior_coordinates(*args)
bool SyFi::is_equal | ( | Ptv & | a, |
Ptv & | b | ||
) |
Definition at line 132 of file Ptv_tools.cpp.
References Ptv::size(), and Ptv::tol.
Referenced by contains3D(), and line_contains().
bool SyFi::is_inside_triangle | ( | Ptv & | e0, |
Ptv & | e1, | ||
Ptv & | e2, | ||
Ptv & | p | ||
) |
Definition at line 174 of file Ptv_tools.cpp.
References mul(), normalize(), sub(), and Ptv::tol.
Referenced by contains3D().
std::string SyFi::istr | ( | const std::string & | a, |
int | b | ||
) |
std::string SyFi::istr | ( | const std::string & | a, |
int | b, | ||
int | c | ||
) |
string SyFi::istr | ( | const string & | a, |
int | b | ||
) |
Definition at line 47 of file utilities.cpp.
References run::s.
string SyFi::istr | ( | const string & | a, |
int | b, | ||
int | c | ||
) |
Definition at line 54 of file utilities.cpp.
References run::s.
def SyFi.istr | ( | args | ) |
istr(string a, int b) -> string istr(string a, int b, int c) -> string
Definition at line 1425 of file SyFi.py.
Referenced by _wrap_istr__SWIG_0(), _wrap_istr__SWIG_1(), check_CrouzeixRaviart(), SyFi::Nedelec.compute_basis_functions(), SyFi::Lagrange.compute_basis_functions(), SyFi::P0.compute_basis_functions(), SyFi::ArnoldFalkWintherWeakSymSigma.compute_basis_functions(), SyFi::Nedelec2Hdiv.compute_basis_functions(), SyFi::BrezziDouglasMarini.compute_basis_functions(), SyFi::RaviartThomas.compute_basis_functions(), SyFi::Robust.compute_basis_functions(), SyFi::ArnoldFalkWintherWeakSymU.compute_basis_functions(), SyFi::ArnoldFalkWintherWeakSymP.compute_basis_functions(), SyFi::Robust.compute_basis_functions_old(), homogenous_pol(), isymb(), SyFi::Triangle.line(), SyFi::Rectangle.line(), SyFi::Tetrahedron.line(), SyFi::Box.line(), main(), SyFi::Box.rectangle(), SyFi::Simplex.sub_simplex(), and SyFi::Tetrahedron.triangle().
const GiNaC::symbol& SyFi::isymb | ( | const std::string & | a, |
int | b | ||
) |
const GiNaC::symbol& SyFi::isymb | ( | const std::string & | a, |
int | b, | ||
int | c | ||
) |
const symbol& SyFi::isymb | ( | const string & | a, |
int | b | ||
) |
Definition at line 133 of file syfi/symbol_factory.cpp.
References get_symbol(), and istr().
{ return get_symbol(istr(a,b)); }
const symbol& SyFi::isymb | ( | const string & | a, |
int | b, | ||
int | c | ||
) |
Definition at line 138 of file syfi/symbol_factory.cpp.
References get_symbol(), and istr().
{ return get_symbol(istr(a,b,c)); }
def SyFi.isymb | ( | args | ) |
isymb(string a, int b) -> GiNaC::symbol isymb(string a, int b, int c) -> GiNaC::symbol
Definition at line 1593 of file SyFi.py.
Referenced by _wrap_isymb__SWIG_0(), _wrap_isymb__SWIG_1(), get_symbolic_matrix(), get_symbolic_vector(), and main().
GiNaC::ex SyFi::lagrange | ( | unsigned int | order, |
Polygon & | p, | ||
const std::string & | a | ||
) |
Definition at line 528 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(), and lagrange().
{ if ( order < 1 ) { throw(std::logic_error("Can not create polynomials of order less than 1!")); } GiNaC::ex A; GiNaC::ex ret; GiNaC::lst basis; Lagrange fe(p,order); A = get_symbolic_matrix(1, fe.nbf(), a); for (unsigned int i=0; i<fe.nbf(); i++) { ret += A.op(i)*fe.N(i); basis.append(fe.N(i)); } return GiNaC::lst(ret,matrix_to_lst2(A),basis); }
def SyFi.lagrange | ( | args | ) |
lagrange(unsigned int order, Polygon p, string a) -> GiNaC::ex
Definition at line 2157 of file SyFi.py.
References lagrange().
GiNaC::lst SyFi::lagrangev | ( | unsigned int | no_fields, |
unsigned int | order, | ||
Polygon & | p, | ||
const std::string & | a | ||
) |
Definition at line 550 of file Lagrange.cpp.
References demo::a, demos::crouzeixraviart::fe, get_symbolic_matrix(), matrix_to_lst2(), SyFi::StandardFE::N(), and SyFi::StandardFE::nbf().
Referenced by _wrap_lagrangev(), and lagrangev().
{ if ( order < 1 ) { throw(std::logic_error("Can not create polynomials of order less than 1!")); } GiNaC::ex A; GiNaC::ex ret; GiNaC::lst basis; VectorLagrange fe(p,order); A = get_symbolic_matrix(1, fe.nbf(), a); for (unsigned int i=0; i<fe.nbf(); i++) { ret += A.op(i)*fe.N(i); basis.append(fe.N(i)); } return GiNaC::lst(ret,matrix_to_lst2(A),basis); }
def SyFi.lagrangev | ( | args | ) |
lagrangev(unsigned int no_fields, unsigned int order, Polygon p, string a) -> GiNaC::lst
Definition at line 2161 of file SyFi.py.
References lagrangev().
GiNaC::ex SyFi::legendre | ( | unsigned int | order, |
unsigned int | nsd, | ||
const std::string | a | ||
) |
GiNaC::ex SyFi::legendre | ( | unsigned int | order, |
unsigned int | nsd, | ||
const string | s | ||
) |
Definition at line 942 of file ginac_tools.cpp.
References demo::f, get_symbolic_matrix(), legendre1D(), matrix_to_lst2(), x, y, and z.
Referenced by _wrap_legendre(), SyFi::Hermite::compute_basis_functions(), legendre(), legendrev(), and main().
{ using SyFi::x; using SyFi::y; using SyFi::z; // The Legendre polynomials to be used in FiniteElement GiNaC::ex leg; GiNaC::ex A; GiNaC::lst basis; int dof; GiNaC::ex b; // 1D if(nsd == 1) { dof = order+1; A = get_symbolic_matrix(1,dof,s); int o=0; for(GiNaC::const_iterator i = A.begin(); i!=A.end(); ++i) { b= legendre1D(x,o); leg+= (*i)*b; basis.append(b); o++; } } // 2D /* else if(nsd == 2){ // NB: Only for tensor products on TRIANGLES (not boxes) / * 2D: structure of coefficients (a_i) * [ a_0 a_1 P_1(x) a_3 P_2(x) a_6 P_3(x) * [ a_2 P_1(y) a_4 P_1(x)*P_1(y) a_7 P_2(x)*P_1(y) * [ a_5 P_2(y) a_8 P_1(x)*P_2(y) * [ a_9 P_3(y) * / dof = (order+1)*(order+2)/2; A = get_symbolic_matrix(1,dof,s); size_t i=0; for (int o = 0; o <= order; o++) { for (int d = 0; d <= o; d++) { b = legendre1D(y,d)*legendre1D(x,o-d); leg += A.op(i)*b; basis.append(b); i++; } } } */ else if(nsd == 2) // NB: Only for tensor products on rectangles { dof = (order+1)*(order+1); A = get_symbolic_matrix(1,dof,s); size_t i=0; for (unsigned int o = 0; o <= order; o++) { for (unsigned int d = 0; d <= order; d++) { b = legendre1D(y,d)*legendre1D(x,o); leg += A.op(i)*b; basis.append(b); i++; } } } /* tetrahedron else if(nsd==3){ dof = 0; for (int j=0; j<= order; j++) { dof += (j+1)*(j+2)/2; } A = get_symbolic_matrix(1, dof , s); size_t i=0; for (int o = 0; o <= order; o++) { for (int d = 0; d <= o; d++) { for (int f = 0; f <= o; f++) { if ( o-d-f >= 0) { b = legendre1D(y,f)*legendre1D(z,d)*legendre1D(x,o-d-f); leg += A.op(i)*b; basis.append(b); i++; } } } } } */ else if(nsd==3) { dof = (order+1)*(order+1)*(order+1); A = get_symbolic_matrix(1, dof , s); size_t i=0; for (unsigned int o = 0; o <= order; o++) { for (unsigned int d = 0; d <= order; d++) { for (unsigned int f = 0; f <= order; f++) { b = legendre1D(y,f)*legendre1D(z,d)*legendre1D(x,o); leg += A.op(i)*b; basis.append(b); i++; } } } } return GiNaC::lst(leg,matrix_to_lst2(A), basis); }
def SyFi.legendre | ( | args | ) |
legendre(unsigned int order, unsigned int nsd, string a) -> GiNaC::ex
Definition at line 1379 of file SyFi.py.
References legendre().
GiNaC::ex SyFi::legendre1D | ( | const GiNaC::symbol | x, |
unsigned int | n | ||
) |
Definition at line 928 of file ginac_tools.cpp.
Referenced by legendre().
{ GiNaC::ex P; // Rodrigue's formula for Legendre polynomial of 1D // The interval [-1, 1] P=1/(pow(2,n)*GiNaC::factorial(n))*GiNaC::diff(GiNaC::pow((x*x-1),n),x,n); // ----------------- // The interval [0,1] // GiNaC::ex xx = 2*x - 1; // P=1/(pow(2,2*n)*GiNaC::factorial(n))*GiNaC::diff(GiNaC::pow((xx*xx-1),n),x,n); return P; }
GiNaC::lst SyFi::legendrev | ( | unsigned int | no_fields, |
unsigned int | order, | ||
unsigned int | nsd, | ||
const std::string | a | ||
) |
GiNaC::lst SyFi::legendrev | ( | unsigned int | no_fields, |
unsigned int | order, | ||
unsigned int | nsd, | ||
const string | a | ||
) |
Definition at line 1059 of file ginac_tools.cpp.
References legendre(), and run::s.
Referenced by _wrap_legendrev(), and legendrev().
{ GiNaC::lst ret1; // contains the polynom GiNaC::lst ret2; // contains the coefficients GiNaC::lst ret3; // constains the basis functions GiNaC::lst basis_tmp; for (unsigned int i=1; i<= no_fields; i++) { GiNaC::lst basis; std::ostringstream s; s <<a<<""<<i<<"_"; GiNaC::ex polspace = legendre(order, nsd, s.str()); ret1.append(polspace.op(0)); ret2.append(polspace.op(1)); basis_tmp = GiNaC::ex_to<GiNaC::lst>(polspace.op(2)); for (GiNaC::lst::const_iterator basis_iterator = basis_tmp.begin(); basis_iterator != basis_tmp.end(); ++basis_iterator) { GiNaC::lst tmp_lst; for (unsigned int d=1; d<=no_fields; d++) tmp_lst.append(0); tmp_lst.let_op(i-1) = (*basis_iterator); ret3.append(tmp_lst); } } return GiNaC::lst(ret1,ret2,ret3); }
def SyFi.legendrev | ( | args | ) |
legendrev(unsigned int no_fields, unsigned int order, unsigned int nsd, string a) -> GiNaC::lst
Definition at line 1383 of file SyFi.py.
References legendrev().
bool SyFi::line_contains | ( | Ptv & | e0, |
Ptv & | e1, | ||
Ptv & | p | ||
) |
Definition at line 147 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 | ) |
def SyFi.lst2string | ( | args | ) |
lst2string(GiNaC::lst l) -> string
Definition at line 1294 of file SyFi.py.
Referenced by _wrap_lst2string(), and main().
01294 01295 def lst2string(*args): 01296 """lst2string(GiNaC::lst l) -> string""" 01297 return _SyFi.lst2string(*args)
GiNaC::lst SyFi::lst_equals | ( | GiNaC::ex | a, |
GiNaC::ex | b | ||
) |
Definition at line 365 of file ginac_tools.cpp.
References demo::a.
Referenced by _wrap_lst_equals(), and lst_equals().
{ GiNaC::lst ret; if ( (GiNaC::is_a<GiNaC::lst>(a)) && (GiNaC::is_a<GiNaC::lst>(b)) /*&& (a.nops() == b.nops())*/ ) { for (unsigned int i=0; i<= a.nops()-1; i++) { ret.append(b.op(i) == a.op(i)); } } else if ( !(GiNaC::is_a<GiNaC::lst>(a)) && !(GiNaC::is_a<GiNaC::lst>(b))) { ret.append(b == a); } else if ( !(GiNaC::is_a<GiNaC::lst>(a)) && (GiNaC::is_a<GiNaC::lst>(b))) { ret.append(b.op(0) == a); } else { throw(std::invalid_argument("Make sure that the lists a and b are comparable.")); } return ret; }
def SyFi.lst_equals | ( | args | ) |
lst_equals(GiNaC::ex a, GiNaC::ex b) -> GiNaC::lst
Definition at line 1337 of file SyFi.py.
References lst_equals().
01337 01338 def lst_equals(*args): 01339 """lst_equals(GiNaC::ex a, GiNaC::ex b) -> GiNaC::lst""" 01340 return _SyFi.lst_equals(*args)
GiNaC::ex SyFi::lst_to_matrix2 | ( | const GiNaC::lst & | l | ) |
Definition at line 287 of file ginac_tools.cpp.
Referenced by _wrap_lst_to_matrix2(), bezier_ordinates(), interior_coordinates(), and lst_to_matrix2().
{ GiNaC::lst::const_iterator itr, itc; // Find number of rows and columns size_t rows = l.nops(), cols = 0; for (itr = l.begin(); itr != l.end(); ++itr) { if (!GiNaC::is_a<GiNaC::lst>(*itr)) // throw (std::invalid_argument("lst_to_matrix: argument must be a list of lists")); cols = 1; if (itr->nops() > cols) cols = itr->nops(); } // Allocate and fill matrix GiNaC::matrix &M = *new GiNaC::matrix(rows, cols); M.setflag(GiNaC::status_flags::dynallocated); unsigned i; for (itr = l.begin(), i = 0; itr != l.end(); ++itr, ++i) { unsigned j; if (cols == 1) { M(i, 0) = *itr; } else { for (itc = GiNaC::ex_to<GiNaC::lst>(*itr).begin(), j = 0; itc != GiNaC::ex_to<GiNaC::lst>(*itr).end(); ++itc, ++j) M(i, j) = *itc; } } return M; }
def SyFi.lst_to_matrix2 | ( | args | ) |
lst_to_matrix2(GiNaC::lst l) -> GiNaC::ex
Definition at line 1329 of file SyFi.py.
References lst_to_matrix2().
01329 01330 def lst_to_matrix2(*args): 01331 """lst_to_matrix2(GiNaC::lst l) -> GiNaC::ex""" 01332 return _SyFi.lst_to_matrix2(*args)
void SyFi::matrix_from_equations | ( | const GiNaC::ex & | eqns, |
const GiNaC::ex & | symbols, | ||
GiNaC::matrix & | A, | ||
GiNaC::matrix & | b | ||
) |
Definition at line 262 of file ginac_tools.cpp.
Referenced by _wrap_matrix_from_equations(), SyFi::Hermite::compute_basis_functions(), SyFi::Nedelec::compute_basis_functions(), SyFi::Lagrange::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), and matrix_from_equations().
{ // build matrix from equation system GiNaC::matrix sys(eqns.nops(),symbols.nops()); GiNaC::matrix rhs(eqns.nops(),1); GiNaC::matrix vars(symbols.nops(),1); for (size_t r=0; r<eqns.nops(); r++) { // lhs-rhs==0 const GiNaC::ex eq = eqns.op(r).op(0)-eqns.op(r).op(1); GiNaC::ex linpart = eq; for (size_t c=0; c<symbols.nops(); c++) { const GiNaC::ex co = eq.coeff(GiNaC::ex_to<GiNaC::symbol>(symbols.op(c)),1); linpart -= co*symbols.op(c); sys(r,c) = co; } linpart = linpart.expand(); rhs(r,0) = -linpart; } A = sys; b = rhs; }
def SyFi.matrix_from_equations | ( | args | ) |
matrix_from_equations(GiNaC::ex eqns, GiNaC::ex symbols, GiNaC::matrix A, GiNaC::matrix b)
Definition at line 1322 of file SyFi.py.
References matrix_from_equations().
01322 01323 def matrix_from_equations(*args): 01324 """ 01325 matrix_from_equations(GiNaC::ex eqns, GiNaC::ex symbols, GiNaC::matrix A, 01326 GiNaC::matrix b) 01327 """ 01328 return _SyFi.matrix_from_equations(*args)
GiNaC::lst SyFi::matrix_to_lst2 | ( | const GiNaC::ex & | m | ) |
Definition at line 322 of file ginac_tools.cpp.
References run::m.
Referenced by _wrap_matrix_to_lst2(), bernstein(), bezier_ordinates(), homogenous_pol(), interior_coordinates(), lagrange(), lagrangev(), legendre(), matrix_to_lst2(), pol(), and polb().
{ if (GiNaC::is_a<GiNaC::matrix>(m)) { GiNaC::matrix A = GiNaC::ex_to<GiNaC::matrix>(m); int cols = A.cols(); int rows = A.rows(); GiNaC::lst ret; if ( cols == 1 ) { for (unsigned int i=0; i<=A.rows()-1; i++) { ret.append(A(i,0)); } } else if ( rows == 1 ) { for (unsigned int i=0; i<=A.cols()-1; i++) { ret.append(A(0,i)); } } else { for (unsigned int i=0; i<=A.rows()-1; i++) { GiNaC::lst rl; for (unsigned int j=0; j<=A.cols()-1; j++) { rl.append(A(i,j)); } ret.append(rl); } } return ret; } else { return GiNaC::lst(); } }
def SyFi.matrix_to_lst2 | ( | args | ) |
matrix_to_lst2(GiNaC::ex m) -> GiNaC::lst
Definition at line 1333 of file SyFi.py.
References matrix_to_lst2().
01333 01334 def matrix_to_lst2(*args): 01335 """matrix_to_lst2(GiNaC::ex m) -> GiNaC::lst""" 01336 return _SyFi.matrix_to_lst2(*args)
GiNaC::lst SyFi::matvec | ( | GiNaC::matrix & | M, |
GiNaC::lst & | x | ||
) |
Definition at line 153 of file ginac_tools.cpp.
Referenced by _wrap_matvec__SWIG_0(), _wrap_matvec__SWIG_1(), and matvec().
{ GiNaC::lst ret; int nr = M.rows(); int nc = M.cols(); for (int i = 0; i < nr; i++) { GiNaC::ex tmp; for (int j = 0; j < nc; j++) { tmp = tmp + M(i,j)*(x.op(j)); } ret.append(tmp); } return ret; }
GiNaC::ex SyFi::matvec | ( | GiNaC::ex | A, |
GiNaC::ex | x | ||
) |
Definition at line 170 of file ginac_tools.cpp.
References x.
def SyFi.matvec | ( | args | ) |
Definition at line 40 of file Ptv_tools.cpp.
References Ptv::size().
Referenced by ex2type(), and is_inside_triangle().
double SyFi::norm | ( | const Ptv & | a | ) |
Definition at line 55 of file Ptv_tools.cpp.
References Ptv::size().
Referenced by line_contains(), normal(), normalize(), and tangent().
{ double sum = 0.0; for (unsigned int i=0; i < a.size(); i++) { sum += a[i]*a[i]; } sum = sqrt(sum); return sum; }
GiNaC::lst SyFi::normal | ( | Tetrahedron & | tetrahedron, |
unsigned int | i | ||
) |
Definition at line 1931 of file Polygon.cpp.
References cross(), norm(), demos::crouzeixraviart::triangle, SyFi::Tetrahedron::triangle(), and SyFi::Polygon::vertex().
Referenced by _wrap_normal__SWIG_0(), _wrap_normal__SWIG_1(), SyFi::Nedelec::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), main(), normal(), and variants().
{ // Normal as defined by Maries note Triangle triangle = tetrahedron.triangle(i); lst vertex_i = ex_to<lst>(tetrahedron.vertex(i)); lst vertex_0 = ex_to<lst>(triangle.vertex(0)); lst vertex_1 = ex_to<lst>(triangle.vertex(1)); lst vertex_2 = ex_to<lst>(triangle.vertex(2)); lst n1(vertex_1.op(0) - vertex_0.op(0), vertex_1.op(1) - vertex_0.op(1), vertex_1.op(2) - vertex_0.op(2)); lst n2(vertex_2.op(0) - vertex_0.op(0), vertex_2.op(1) - vertex_0.op(1), vertex_2.op(2) - vertex_0.op(2)); /* lst n3(vertex_0.op(0) - vertex_i.op(0), vertex_0.op(1) - vertex_i.op(1), vertex_0.op(2) - vertex_i.op(2)); */ lst n4 = cross(n1,n2); /* ex nn = inner(n3, n4); int sign = 1; if ( is_a<numeric>(nn)) { if ( nn > 0 ) { sign = 1; } else if ( nn < 0) { sign = -1; } else { sign = 0; } } */ ex norm = sqrt(pow(n4.op(0),2) + pow(n4.op(1),2) + pow(n4.op(2),2)); n4.let_op(0) = n4.op(0)/norm; n4.let_op(1) = n4.op(1)/norm; n4.let_op(2) = n4.op(2)/norm; return n4; }
GiNaC::lst SyFi::normal | ( | Triangle & | triangle, |
unsigned int | i | ||
) |
Definition at line 1981 of file Polygon.cpp.
References SyFi::Triangle::line(), norm(), and SyFi::Polygon::vertex().
{ Line line = triangle.line(i); lst vertex_i = ex_to<lst>(triangle.vertex(i)); lst vertex_0 = ex_to<lst>(line.vertex(0)); lst vertex_1 = ex_to<lst>(line.vertex(1)); /* lst n1 = lst (- (vertex_1.op(1) - vertex_0.op(1)), vertex_1.op(0) - vertex_0.op(0) ); lst n2 = lst (vertex_0.op(0) - vertex_i.op(0), vertex_0.op(1) - vertex_i.op(1)); ex nn = inner(n1, n2); int sign = 1; / * if ( is_a<numeric>(nn)) { if ( nn > 0 ) { sign = 1; } else if ( nn < 0) { sign = -1; } else { sign = 0; } } ex norm = sqrt(pow(n1.op(0),2) + pow(n1.op(1),2)); n1.let_op(0) = sign*n1.op(0)/norm; n1.let_op(1) = sign*n1.op(1)/norm; */ // normal vector as Marie has defined them lst n1 = lst ( (vertex_1.op(1) - vertex_0.op(1)), -(vertex_1.op(0) - vertex_0.op(0)) ); ex norm = sqrt(pow(n1.op(0),2) + pow(n1.op(1),2)); n1.let_op(0) = n1.op(0)/norm; n1.let_op(1) = n1.op(1)/norm; return n1; }
def SyFi.normal | ( | args | ) |
void SyFi::normalize | ( | Ptv & | a | ) |
Definition at line 67 of file Ptv_tools.cpp.
References norm(), and Ptv::size().
Referenced by is_inside_triangle().
std::ostream & SyFi::operator<< | ( | std::ostream & | os, |
const OrderedPtvSet & | p | ||
) |
Definition at line 118 of file OrderedPtvSet.cpp.
References SyFi::OrderedPtvSet::size().
std::ostream & SyFi::operator<< | ( | std::ostream & | os, |
const OrderedPtvSet_i & | p | ||
) |
Definition at line 198 of file OrderedPtvSet.cpp.
References SyFi::OrderedPtvSet_i::get_i(), SyFi::OrderedPtvSet_i::get_OrderedPtvSet(), and SyFi::OrderedPtvSet_i::size().
GiNaC::ex SyFi::pol | ( | unsigned int | order, |
unsigned int | nsd, | ||
const std::string | a | ||
) |
GiNaC::ex SyFi::pol | ( | unsigned int | order, |
unsigned int | nsd, | ||
const string | a | ||
) |
Definition at line 613 of file ginac_tools.cpp.
References demo::f, get_symbolic_matrix(), matrix_to_lst2(), x, y, and z.
Referenced by _wrap_pol(), bernsteinv(), SyFi::Hermite::compute_basis_functions(), SyFi::Lagrange::compute_basis_functions(), main(), pol(), and polv().
{ using SyFi::x; using SyFi::y; using SyFi::z; GiNaC::ex ret; // ex to return int dof; // degrees of freedom GiNaC::ex A; // ex holding the coefficients a_0 .. a_dof GiNaC::lst basis; if (nsd == 1) { /* 1D: * P^n = a_0 + a_1*x + .... + a_n*x^n * dof : n+1 */ dof = order+1; A = get_symbolic_matrix(1,dof, a); int o=0; for (GiNaC::const_iterator i = A.begin(); i != A.end(); ++i) { ret += (*i)*pow(x,o); basis.append(pow(x,o)); o++; } } else if ( nsd == 2) { /* 2D: structure of coefficients (a_i) * [ a_0 a_1 x a_3 x^2 a_6 x^3 * [ a_2 y a_4 xy a_7 x^2y * [ a_5 y^2 a_8 xy^2 * [ a_9 y^3 */ dof = (order+1)*(order+2)/2; A = get_symbolic_matrix(1, dof , a); size_t i=0; for (unsigned int o = 0; o <= order; o++) { for (unsigned int d = 0; d <= o; d++) { ret += A.op(i)*pow(y,d)*pow(x,o-d); basis.append(pow(y,d)*pow(x,o-d)); i++; } } } else if (nsd == 3) { /* Similar structure as in 2D, but * structured as a tetraheder, i.e., * a_o + a_1 x + a_2 y + a_3 z * + a_4 x^2 + a_5 xy + */ dof = 0; for (unsigned int j=0; j<= order; j++) { dof += (j+1)*(j+2)/2; } A = get_symbolic_matrix(1, dof , a); size_t i=0; for (unsigned int o = 0; o <= order; o++) { for (unsigned int d = 0; d <= o; d++) { for (unsigned int f = 0; f <= o; f++) { if ( int(o)-int(d)-int(f) >= 0) { ret += A.op(i)*pow(y,f)*pow(z,d)*pow(x,o-d-f); basis.append(pow(y,f)*pow(z,d)*pow(x,o-d-f)); i++; } } } } } return GiNaC::lst(ret,matrix_to_lst2(A), basis); }
def SyFi.pol | ( | args | ) |
GiNaC::exmap SyFi::pol2basisandcoeff | ( | GiNaC::ex | e, |
GiNaC::ex | s | ||
) |
Definition at line 878 of file ginac_tools.cpp.
References run::s.
Referenced by _wrap_pol2basisandcoeff__SWIG_0(), _wrap_pol2basisandcoeff__SWIG_1(), SyFi::Nedelec::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), and pol2basisandcoeff().
{ if (GiNaC::is_a<GiNaC::symbol>(s)) { GiNaC::symbol ss = GiNaC::ex_to<GiNaC::symbol>(s); e = expand(e); GiNaC::ex c; GiNaC::ex b; GiNaC::exmap map; for (int i=e.ldegree(ss); i<=e.degree(ss); ++i) { c = e.coeff(ss,i); b = pow(ss,i); map[b] = c; } return map; } else { throw(std::invalid_argument("The second argument must be a symbol.")); } }
GiNaC::exmap SyFi::pol2basisandcoeff | ( | GiNaC::ex | e | ) |
Definition at line 902 of file ginac_tools.cpp.
{ 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 1478 of file SyFi.py.
References pol2basisandcoeff().
01478 01479 def pol2basisandcoeff(*args): 01480 """ 01481 pol2basisandcoeff(GiNaC::ex e) -> GiNaC::exmap 01482 pol2basisandcoeff(GiNaC::ex e, GiNaC::ex s) -> GiNaC::exmap 01483 """ 01484 return _SyFi.pol2basisandcoeff(*args)
GiNaC::ex SyFi::polb | ( | unsigned int | order, |
unsigned int | nsd, | ||
const std::string | a | ||
) |
GiNaC::ex SyFi::polb | ( | unsigned int | order, |
unsigned int | nsd, | ||
const string | a | ||
) |
Definition at line 738 of file ginac_tools.cpp.
References demo::f, get_symbolic_matrix(), matrix_to_lst2(), x, y, and z.
Referenced by _wrap_polb(), and polb().
{ using SyFi::x; using SyFi::y; using SyFi::z; GiNaC::ex ret; // ex to return int dof; // degrees of freedom GiNaC::ex A; // ex holding the coefficients a_0 .. a_dof GiNaC::lst basis; if (nsd == 1) { /* 1D: * P^n = a_0 + a_1*x + .... + a_n*x^n * dof : n+1 */ dof = order+1; A = get_symbolic_matrix(1,dof, a); int o=0; for (GiNaC::const_iterator i = A.begin(); i != A.end(); ++i) { ret += (*i)*pow(x,o); basis.append(pow(x,o)); o++; } } else if ( nsd == 2) { /* 2D: structure of coefficients (a_i) * [ a_0 a_1 x a_3 x^2 a_6 x^3 * [ a_2 y a_4 xy a_7 x^2y * [ a_5 y^2 a_8 xy^2 * [ a_9 y^3 */ dof = (order+1)*(order+1); A = get_symbolic_matrix(1, dof , a); size_t i=0; for (unsigned int o = 0; o <= order; o++) { for (unsigned int d = 0; d <= order; d++) { ret += A.op(i)*pow(y,d)*pow(x,o); basis.append(pow(y,d)*pow(x,o)); i++; } } } else if (nsd == 3) { /* Similar structure as in 2D, but * structured as a tetraheder, i.e., * a_o + a_1 x + a_2 y + a_3 z * + a_4 x^2 + a_5 xy + */ dof = (order+1)*(order+1)*(order+1); A = get_symbolic_matrix(1, dof , a); size_t i=0; for (unsigned int o = 0; o <= order; o++) { for (unsigned int d = 0; d <= order; d++) { for (unsigned int f = 0; f <= order; f++) { ret += A.op(i)*pow(y,f)*pow(z,d)*pow(x,o); basis.append(pow(y,f)*pow(z,d)*pow(x,o)); i++; } } } } return GiNaC::lst(ret,matrix_to_lst2(A), basis); }
def SyFi.polb | ( | args | ) |
GiNaC::lst SyFi::polv | ( | unsigned int | no_fields, |
unsigned int | order, | ||
unsigned int | nsd, | ||
const std::string | a | ||
) |
GiNaC::lst SyFi::polv | ( | unsigned int | no_fields, |
unsigned int | order, | ||
unsigned int | nsd, | ||
const string | a | ||
) |
Definition at line 699 of file ginac_tools.cpp.
Referenced by _wrap_polv(), and polv().
{ GiNaC::lst ret1; // contains the polynom GiNaC::lst ret2; // contains the coefficients GiNaC::lst ret3; // constains the basis functions GiNaC::lst basis_tmp; for (unsigned int i=0; i< no_fields; i++) { GiNaC::lst basis; std::ostringstream s; s <<a<<""<<i<<"_"; GiNaC::ex polspace = pol(order, nsd, s.str()); ret1.append(polspace.op(0)); ret2.append(polspace.op(1)); basis_tmp = GiNaC::ex_to<GiNaC::lst>(polspace.op(2)); for (GiNaC::lst::const_iterator basis_iterator = basis_tmp.begin(); basis_iterator != basis_tmp.end(); ++basis_iterator) { GiNaC::lst tmp_lst; for (unsigned int d=1; d<=no_fields; d++) tmp_lst.append(0); tmp_lst.let_op(i) = (*basis_iterator); ret3.append(tmp_lst); } } return GiNaC::lst(ret1,ret2,ret3); /* Old Code: GiNaC::lst ret; for (int i=1; i<= nsd; i++) { std::ostringstream s; s <<a<<"^"<<i<<"_"; GiNaC::ex p = pol(order, nsd, s.str()); ret.append(p); } return ret; */ }
def SyFi.polv | ( | args | ) |
void SyFi::print | ( | GiNaC::lst & | l | ) |
Definition at line 89 of file utilities.cpp.
void SyFi::print | ( | GiNaC::exvector & | v | ) |
void SyFi::print | ( | std::map< std::pair< unsigned int, unsigned int >, GiNaC::ex > & | A | ) |
Definition at line 115 of file utilities.cpp.
{ map<std::pair<unsigned int,unsigned int>,GiNaC::ex>::iterator iter; for (iter = A.begin(); iter != A.end() ; iter++) { cout <<"A["<<(*iter).first.first<<","<<(*iter).first.second<<"]="<<(*iter).second<<endl; } }
void SyFi::print | ( | ex_int_map | map | ) |
Definition at line 124 of file utilities.cpp.
References SyFi.ex_int_map::begin(), and SyFi.ex_int_map::end().
{ GiNaC::ex b; int c=0; ex_int_map::iterator iter; iter = map.begin(); cout <<"{"; for (iter = map.begin(); iter != map.end(); iter++) { b = (*iter).first; c = map[b]; cout <<", "<<b<<":"<<c; } cout <<"}"<<endl; }
void SyFi::print | ( | GiNaC::exmap | map | ) |
Definition at line 139 of file utilities.cpp.
{ GiNaC::ex b; GiNaC::ex c; GiNaC::exmap::iterator iter; cout <<"{" <<b<<":"<<c; for (iter = map.begin(); iter != map.end(); iter++) { b = (*iter).first; c = map[b]; cout <<", "<<b<<":"<<c; } cout <<"}"<<endl; }
GiNaC::ex SyFi::replace_powers | ( | const GiNaC::ex & | e, |
const std::list< GiNaC::symbol > & | symbols, | ||
std::list< symexpair > & | sel, | ||
const std::string & | tmpsymbolprefix = "p_" |
||
) |
ex SyFi::replace_powers | ( | const ex & | ein, |
const list< symbol > & | symbols, | ||
list< symexpair > & | sel, | ||
const string & | tmpsymbolprefix | ||
) |
Definition at line 1394 of file ginac_tools.cpp.
References test::e, get_symbol(), and int2string().
Referenced by _wrap_replace_powers__SWIG_0(), _wrap_replace_powers__SWIG_1(), replace_powers(), and variants().
{ ex e = ein; // build power expressions list<symbol>::const_iterator it = symbols.begin(); for(; it != symbols.end(); it++) { int deg = e.degree(*it); if(deg > 0) { symbol sym = ex_to<symbol>(*it); string sname = tmpsymbolprefix + sym.get_name(); // make list of new symbols vector<symbol> symbols(deg); symbols[0] = sym; for(int i=1; i<deg; i++) { symbols[i] = get_symbol( sname + int2string(i+1) ); sel.push_back(make_pair(symbols[i], symbols[i-1]*sym)); } // with highest order first, subs in e ex prod = sym; for(int i=deg-1; i>=1; i--) { e = e.subs(power(sym,i+1) == symbols[i], subs_options::algebraic); } } } return e; }
def SyFi.replace_powers | ( | args | ) |
replace_powers(GiNaC::ex 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 1583 of file SyFi.py.
References replace_powers().
01583 01584 def replace_powers(*args): 01585 """ 01586 replace_powers(GiNaC::ex e, std::list<(GiNaC::symbol,std::allocator<(GiNaC::symbol)>)> symbols, 01587 std::list<(SyFi::symexpair,std::allocator<(SyFi::symexpair)>)> sel, 01588 string tmpsymbolprefix = "p_") -> GiNaC::ex 01589 replace_powers(GiNaC::ex e, std::list<(GiNaC::symbol,std::allocator<(GiNaC::symbol)>)> symbols, 01590 std::list<(SyFi::symexpair,std::allocator<(SyFi::symexpair)>)> sel) -> GiNaC::ex 01591 """ 01592 return _SyFi.replace_powers(*args)
void SyFi::set_tolerance | ( | double | tolerance | ) |
def SyFi.setDigits | ( | args | ) |
void SyFi::sort_vector | ( | vector< Ptv > & | a | ) |
Definition at line 30 of file Ptv_tools.cpp.
{ sort(a.begin(), a.end(), Ptv_is_less()); }
Definition at line 90 of file Ptv_tools.cpp.
References Ptv::redim(), and Ptv::size().
Referenced by SyFi::CrouzeixRaviart::compute_basis_functions(), is_inside_triangle(), and line_contains().
def SyFi.swig_import_helper | ( | ) |
Definition at line 15 of file SyFi.py.
00015 00016 def swig_import_helper(): 00017 from os.path import dirname 00018 import imp 00019 fp = None 00020 try: 00021 fp, pathname, description = imp.find_module('_SyFi', [dirname(__file__)]) 00022 except ImportError: 00023 import _SyFi 00024 return _SyFi 00025 if fp is not None: 00026 try: 00027 _mod = imp.load_module('_SyFi', fp, pathname, description) 00028 finally: 00029 fp.close() return _mod
bool SyFi::symbol_exists | ( | const std::string & | name | ) |
bool SyFi::symbol_exists | ( | const string & | name | ) |
Definition at line 118 of file syfi/symbol_factory.cpp.
References symbol_collection.
{ return symbol_collection.find(name) != symbol_collection.end(); }
def SyFi.symbol_exists | ( | args | ) |
symbol_exists(string name) -> bool
Definition at line 1501 of file SyFi.py.
Referenced by _wrap_symbol_exists(), and main().
01501 01502 def symbol_exists(*args): 01503 """symbol_exists(string name) -> bool""" 01504 return _SyFi.symbol_exists(*args)
GiNaC::symbol SyFi::t | ( | "(t is not initialized since initSyFi has never been called)" | ) |
def SyFi.tangent | ( | args | ) |
GiNaC::lst SyFi::tangent | ( | Triangle & | triangle, |
unsigned int | i | ||
) |
Definition at line 2021 of file Polygon.cpp.
References SyFi::Triangle::line(), norm(), and SyFi::Polygon::vertex().
Referenced by _wrap_tangent(), SyFi::Nedelec::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), and tangent().
{ /* Line line = triangle.line(i); //FIXME: 5 lines to compute the tangent vector, these should // be put somewhere else. GiNaC::symbol t("t"); ex line_repr = line.repr(t); ex t1 = line_repr.op(0).rhs().coeff(t,1); ex t2 = line_repr.op(1).rhs().coeff(t,1); ex norm = sqrt(pow(t1,2) + pow(t2,2)); lst tangent = lst(t1/norm,t2/norm); return tangent; */ /* ex t1, t2; if ( i == 0 ) { t1 = triangle.vertex(2).op(0) - triangle.vertex(1).op(0); t2 = triangle.vertex(2).op(1) - triangle.vertex(1).op(1); } else if ( i == 1 ) { t1 = triangle.vertex(0).op(0) - triangle.vertex(2).op(0); t2 = triangle.vertex(0).op(1) - triangle.vertex(2).op(1); } else if ( i == 2 ) { t1 = triangle.vertex(1).op(0) - triangle.vertex(0).op(0); t2 = triangle.vertex(1).op(1) - triangle.vertex(0).op(1); } else { throw(std::out_of_range("The side index is out of range!")); } */ Line line = triangle.line(i); ex t1 = line.vertex(1).op(0) - line.vertex(0).op(0); ex t2 = line.vertex(1).op(1) - line.vertex(0).op(1); ex norm = sqrt(pow(t1,2) + pow(t2,2)); lst tangent = lst(t1/norm,t2/norm); return tangent; }
void SyFi::usage | ( | FE & | fe | ) |
Definition at line 27 of file ElementComputations.cpp.
References SyFi::FE::dof(), grad(), SyFi::FE::N(), and SyFi::FE::nbf().
Referenced by usage().
void SyFi::usage | ( | FE & | v_fe, |
FE & | p_fe | ||
) |
Definition at line 37 of file ElementComputations.cpp.
References SyFi::FE::dof(), grad(), SyFi::FE::N(), and SyFi::FE::nbf().
{ for (unsigned int i=0; i< v_fe.nbf(); i++) { cout <<"v_fe.N("<<i<<") = "<<v_fe.N(i)<<endl; cout <<"grad(v_fe.N("<<i<<")) = "<<grad(v_fe.N(i))<<endl; cout <<"v_fe.dof("<<i<<") = "<<v_fe.dof(i)<<endl; } for (unsigned int i=0; i< p_fe.nbf(); i++) { cout <<"p_fe.N("<<i<<")= "<<p_fe.N(i)<<endl; cout <<"p_fe.dof("<<i<<")= "<<p_fe.dof(i)<<endl; } }
def SyFi.usage | ( | args | ) |
void SyFi::visitor_subst_pow | ( | GiNaC::ex | e, |
GiNaC::exmap & | map, | ||
ex_int_map & | intmap, | ||
std::string | a | ||
) |
void SyFi::visitor_subst_pow | ( | GiNaC::ex | e, |
GiNaC::exmap & | map, | ||
ex_int_map & | intmap, | ||
string | a | ||
) |
Definition at line 400 of file ginac_tools.cpp.
References test::e, and run::s.
Referenced by _wrap_visitor_subst_pow(), and visitor_subst_pow().
{ static int i=0; if (map.find(e) != map.end()) { intmap[e] = intmap[e]+1; return; } if (GiNaC::is_exactly_a<GiNaC::power>(e)) { std::ostringstream s; s <<a<<i++; map[e] = GiNaC::symbol(s.str()); intmap[e] = 0; for (unsigned int i=0; i< e.nops(); i++) { GiNaC::ex e2 = e.op(i); // cout <<"power e "<<e2<<endl; visitor_subst_pow(e2,map,intmap, a); } } else if (GiNaC::is_a<GiNaC::function>(e)) { std::ostringstream s; s <<a<<i++; map[e] = GiNaC::symbol(s.str()); intmap[e] = 0; for (unsigned int i=0; i< e.nops(); i++) { GiNaC::ex e2 = e.op(i); // cout <<"function e "<<e2<<endl; visitor_subst_pow(e2,map,intmap, a); } } else if (GiNaC::is_a<GiNaC::mul>(e)) { if (e.nops() > 4 && e.nops() < 10 ) { std::ostringstream s; s <<a<<i++; map[e] = GiNaC::symbol(s.str()); intmap[e] = 0; } for (unsigned int i=0; i< e.nops(); i++) { GiNaC::ex e2 = e.op(i); visitor_subst_pow(e2,map,intmap, a); } } else if (GiNaC::is_a<GiNaC::add>(e)) { for (unsigned int i=0; i< e.nops(); i++) { GiNaC::ex e2 = e.op(i); visitor_subst_pow(e2,map,intmap,a); } } }
def SyFi.visitor_subst_pow | ( | args | ) |
visitor_subst_pow(GiNaC::ex e, GiNaC::exmap map, ex_int_map intmap, string a)
Definition at line 1349 of file SyFi.py.
References visitor_subst_pow().
01349 01350 def visitor_subst_pow(*args): 01351 """visitor_subst_pow(GiNaC::ex e, GiNaC::exmap map, ex_int_map intmap, string a)""" 01352 return _SyFi.visitor_subst_pow(*args)
GiNaC::symbol SyFi::x | ( | "(x is not initialized since initSyFi has never been called)" | ) |
GiNaC::symbol SyFi::y | ( | "(y is not initialized since initSyFi has never been called)" | ) |
GiNaC::symbol SyFi::z | ( | "(z is not initialized since initSyFi has never been called)" | ) |
int SyFi::_newclass = 0 |
tuple SyFi::_SyFi = swig_import_helper() |
SyFi::cvar = _SyFi.cvar |
GiNaC::symbol SyFi::DUMMY |
Referenced by initSyFi(), Swig_var_DUMMY_get(), and Swig_var_DUMMY_set().
SyFi::GINACLIB_MAJOR_VERSION = _SyFi.GINACLIB_MAJOR_VERSION |
SyFi::GINACLIB_MICRO_VERSION = _SyFi.GINACLIB_MICRO_VERSION |
SyFi::GINACLIB_MINOR_VERSION = _SyFi.GINACLIB_MINOR_VERSION |
GiNaC::symbol SyFi::infinity |
Referenced by initSyFi(), Swig_var_infinity_get(), and Swig_var_infinity_set().
tuple SyFi::new_instancemethod = lambdafunc,inst,cls:_SyFi.SWIG_PyInstanceMethod_New(func) |
Definition at line 11 of file SyFi.py.
Referenced by SyFi.SwigPyIterator.__iter__(), SyFi::MixedFE.append(), SyFi::Robust.compute_basis_functions_old(), SyFi::Line.copy(), SyFi::ReferenceLine.copy(), SyFi::Triangle.copy(), SyFi::ReferenceTriangle.copy(), SyFi::Rectangle.copy(), SyFi::ReferenceRectangle.copy(), SyFi::Tetrahedron.copy(), SyFi::ReferenceTetrahedron.copy(), SyFi::Box.copy(), SyFi::ReferenceBox.copy(), SyFi::Simplex.copy(), SyFi::StandardFE.get_order(), SyFi::Dof.glob2loc(), SyFi::Polygon.rectangle(), SyFi::DiscontinuousLagrange.set_element_number(), SyFi::VectorDiscontinuousLagrange.set_element_number(), SyFi::VectorLagrange.set_size(), SyFi::TensorLagrange.set_size(), SyFi::VectorCrouzeixRaviart.set_size(), SyFi::VectorP0.set_size(), SyFi::TensorP0.set_size(), SyFi::SpaceTimeElement.set_spatial_element(), and SyFi::FE.str().
unsigned int SyFi::nsd = 2 |
Definition at line 33 of file syfi/symbol_factory.cpp.
Referenced by barycenter(), div(), grad(), initSyFi(), main(), SyFi::Simplex::repr(), Swig_var_nsd_get(), Swig_var_nsd_set(), SyFi::TensorLagrange::TensorLagrange(), SyFi::TensorP0::TensorP0(), SyFi::VectorCrouzeixRaviart::VectorCrouzeixRaviart(), SyFi::VectorLagrange::VectorLagrange(), and SyFi::VectorP0::VectorP0().
GiNaC::lst SyFi::p |
Definition at line 39 of file syfi/symbol_factory.cpp.
Referenced by swig::traits_asptr< Type >::asptr(), swig::traits_asptr_stdseq< Seq, T >::asptr(), swig::traits_asptr< std::pair< T, U > >::asptr(), swig::traits_asptr< std::map< K, T, Compare, Alloc > >::asptr(), swig::traits_asval< Type >::asval(), swig::traits_asval< Type * >::asval(), SyFi::StandardFE::get_polygon(), initSyFi(), DofT< D, C >::insert_dof(), SyFi::Dof::insert_dof(), main(), SyFi::StandardFE::set_polygon(), SyFi::StandardFE::StandardFE(), Swig_var_p_get(), Swig_var_p_set(), SyFi::SymbolCounterVisitor::visit(), and SyFi::StandardFE::~StandardFE().
map<string, symbol> SyFi::symbol_collection |
Definition at line 116 of file syfi/symbol_factory.cpp.
Referenced by get_symbol(), and symbol_exists().
GiNaC::symbol SyFi::t |
Definition at line 33 of file cachetest/test.py.
Referenced by SyFi::CrouzeixRaviart::compute_basis_functions(), SyFi::Lagrange::compute_basis_functions(), SyFi::Nedelec::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::SpaceTimeElement::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), initSyFi(), SyFi::SpaceTimeDomain::integrate(), main(), SyFi::SpaceTimeDomain::repr(), SyFi::Rectangle::repr(), SyFi::Tetrahedron::repr(), SyFi::Box::repr(), Swig_var_t_get(), and Swig_var_t_set().
const int SyFi::version_major = cvar.version_major |
Definition at line 1422 of file SyFi.py.
Referenced by Swig_var_version_major_get().
const char * SyFi::version_micro = SYFILIB_MICRO_VERSION |
Definition at line 32 of file utilities.cpp.
Referenced by Swig_var_version_micro_get(), and Swig_var_version_micro_set().
const int SyFi::version_minor = cvar.version_minor |
Definition at line 1423 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::Hermite::compute_basis_functions(), SyFi::Lagrange::compute_basis_functions(), SyFi::CrouzeixRaviart::compute_basis_functions(), SyFi::Nedelec::compute_basis_functions(), SyFi::Bubble::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::SpaceTimeElement::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), div(), ex2equations(), grad(), homogenous_pol(), initSyFi(), SyFi::SpaceTimeDomain::integrate(), legendre(), legendre1D(), main(), matvec(), pickExpression(), pol(), pol2basisandcoeff(), polb(), Ptv::Ptv(), SyFi::Triangle::repr(), SyFi::Rectangle::repr(), SyFi::Tetrahedron::repr(), SyFi::Box::repr(), SyFi::Simplex::repr(), std_list_Sl_GiNaC_ex_Sg__pop(), std_list_Sl_std_pair_Sl_GiNaC_symbol_Sc_GiNaC_ex_Sg__Sg__pop(), std_map_Sl_GiNaC_ex_Sc_GiNaC_ex_Sc_GiNaC_ex_is_less_Sg____setitem____SWIG_1(), std_map_Sl_GiNaC_ex_Sc_int_Sc_GiNaC_ex_is_less_Sg____setitem____SWIG_1(), std_vector_Sl_GiNaC_ex_Sg__pop(), SWIG_CanCastAsInteger(), Swig_var_x_get(), Swig_var_x_set(), and variants().
GiNaC::symbol SyFi::y |
Definition at line 4 of file simple.py.
Referenced by code_gen2D(), coeff(), coeffs(), SyFi::CrouzeixRaviart::compute_basis_functions(), SyFi::Hermite::compute_basis_functions(), SyFi::Lagrange::compute_basis_functions(), SyFi::Nedelec::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::Robust::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), SyFi::BrezziDouglasMarini::compute_basis_functions(), SyFi::Robust::compute_basis_functions_old(), div(), ex2equations(), grad(), homogenous_pol(), initSyFi(), legendre(), main(), pickExpression(), pol(), pol2basisandcoeff(), polb(), Ptv::Ptv(), Swig_var_y_get(), Swig_var_y_set(), and variants().
GiNaC::symbol SyFi::z |
Definition at line 10 of file fem_sympy_core.py.
Referenced by coeff(), coeffs(), SyFi::CrouzeixRaviart::compute_basis_functions(), SyFi::Lagrange::compute_basis_functions(), SyFi::Nedelec::compute_basis_functions(), SyFi::Hermite::compute_basis_functions(), SyFi::Nedelec2Hdiv::compute_basis_functions(), SyFi::RaviartThomas::compute_basis_functions(), div(), ex2equations(), grad(), homogenous_pol(), initSyFi(), legendre(), main(), pickExpression(), pol(), pol2basisandcoeff(), polb(), Ptv::Ptv(), Swig_var_z_get(), Swig_var_z_set(), and variants().