Skip to content
Snippets Groups Projects
Commit 28b722b7 authored by Nicolas Marsic's avatar Nicolas Marsic
Browse files

Auto mapping part 1

parent 44f2054e
No related branches found
No related tags found
No related merge requests found
......@@ -12,11 +12,11 @@ LocalFunctionSpace::~LocalFunctionSpace(void){
void LocalFunctionSpace::selectTransform(int form){
switch(form){
case 0:
transform = jac::map;
transform = LocalFunctionSpace::form0;
break;
case 1:
transform = jac::grad;
transform = LocalFunctionSpace::form1;
break;
case 2:
......@@ -28,7 +28,7 @@ void LocalFunctionSpace::selectTransform(int form){
break;
default:
throw Exception ("Unknow %d-form", from);
throw Exception ("Unknow %d-form", form);
break;
}
}
......@@ -25,7 +25,10 @@ class LocalFunctionSpace{
int type;
Jacobian* jac;
JacMethod transform;
fullVector<double> (*transform)(const Jacobian&,
double,
double,
double);
public:
//! Deletes this LocalFunctionSpace
......@@ -61,7 +64,24 @@ class LocalFunctionSpace{
//! @param form The @em type of the Basis used
void selectTransform(int form);
//! Mapping of 0-form
//! @param jac The Jacobian to use
//! @param u,v,w The @em reference coordinate to map
//! @return Returns The mapped coordinate in the @em physical space
static fullVector<double> form0(const Jacobian& jac,
double u,
double v,
double w);
//! Mapping of 1-form
//! @param jac The Jacobian to use
//! @param u,v,w The @em reference coordinate to map
//! @return Returns The mapped coordinate in the @em physical space
static fullVector<double> form1(const Jacobian& jac,
double u,
double v,
double w);
};
//////////////////////
......@@ -79,4 +99,19 @@ inline int LocalFunctionSpace::getSize(void) const{
inline int LocalFunctionSpace::getType(void) const{
return type;
}
inline fullVector<double> LocalFunctionSpace::form0(const Jacobian& jac,
double u,
double v,
double w){
return jac.map(u, v);
}
inline fullVector<double> LocalFunctionSpace::form1(const Jacobian& jac,
double u,
double v,
double w){
return jac.grad(u, v);
}
#endif
......@@ -10,7 +10,10 @@ LocalFunctionSpaceScalar::LocalFunctionSpaceScalar(const Basis& basis){
this->scalar = true;
this->size = b.getSize();
this->type = b.getType();
this->basis = &(b.getBasis());
selectTransform(type);
}
LocalFunctionSpaceScalar::~LocalFunctionSpaceScalar(void){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment