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

No commit message

No commit message
parent 6c8eb0f0
No related branches found
No related tags found
No related merge requests found
#include "LocalFunctionSpace.h" #include "LocalFunctionSpace.h"
#include "Exception.h"
LocalFunctionSpace::LocalFunctionSpace(void){ LocalFunctionSpace::LocalFunctionSpace(void){
...@@ -8,3 +9,26 @@ LocalFunctionSpace::~LocalFunctionSpace(void){ ...@@ -8,3 +9,26 @@ LocalFunctionSpace::~LocalFunctionSpace(void){
} }
void LocalFunctionSpace::selectTransform(int form){
switch(form){
case 0:
transform = jac::map;
break;
case 1:
transform = jac::grad;
break;
case 2:
throw Exception("Mapping of 2-form not implemented");
break;
case 3:
throw Exception("Mapping of 3-form not implemented");
break;
default:
throw Exception ("Unknow %d-form", from);
break;
}
}
...@@ -8,13 +8,24 @@ ...@@ -8,13 +8,24 @@
This class is the @em mother (by @em inheritence) of all@n This class is the @em mother (by @em inheritence) of all@n
Local Function Spaces.@n Local Function Spaces.@n
A Local Function Space is a Basis on which we can interpolate on. A Local Function Space is a Basis on which we can interpolate on.@n
In order to interpolate, a Local Function Space shall colaborate
with a Jacobian.
*/ */
#include "Jacobian.h"
class LocalFunctionSpace{ class LocalFunctionSpace{
protected: protected:
bool scalar; typedef fullVector<double>(Jacobian::*JacMethod)
int size; (const fullVector<double>&) const;
bool scalar;
int size;
int type;
Jacobian* jac;
JacMethod transform;
public: public:
//! Deletes this LocalFunctionSpace //! Deletes this LocalFunctionSpace
...@@ -33,10 +44,24 @@ class LocalFunctionSpace{ ...@@ -33,10 +44,24 @@ class LocalFunctionSpace{
//! @return Returns the size of the Basis used //! @return Returns the size of the Basis used
int getSize(void) const; int getSize(void) const;
//! @return Returns the type of the Basis used
//! @li 0 for 0-form
//! @li 1 for 1-form
//! @li 2 for 2-form
//! @li 3 for 3-form
//! @todo Check if the 'form numbering' is good
int getType(void) const;
protected: protected:
//! Instantiate a new LocalFunctionSpace //! Instantiate a new LocalFunctionSpace
//! @warning Users can't instantiate a LocalFunctionSpace //! @warning Users can't instantiate a LocalFunctionSpace
LocalFunctionSpace(void); LocalFunctionSpace(void);
//! Selects the right transorm method for the Jacobian
//! @param form The @em type of the Basis used
void selectTransform(int form);
}; };
////////////////////// //////////////////////
...@@ -51,4 +76,7 @@ inline int LocalFunctionSpace::getSize(void) const{ ...@@ -51,4 +76,7 @@ inline int LocalFunctionSpace::getSize(void) const{
return size; return size;
} }
inline int LocalFunctionSpace::getType(void) const{
return type;
}
#endif #endif
...@@ -18,3 +18,22 @@ LocalFunctionSpaceScalar::~LocalFunctionSpaceScalar(void){ ...@@ -18,3 +18,22 @@ LocalFunctionSpaceScalar::~LocalFunctionSpaceScalar(void){
// for deleting 'basis' // for deleting 'basis'
// It's the Basis job // It's the Basis job
} }
double LocalFunctionSpaceScalar::interpolate
(const fullVector<double>& coef,
double x, double y, double z) const{
if(coef.size() > size)
throw Exception("To many coeficients for interpolation");
if(coef.size() < size)
throw Exception("Not enough coeficients for interpolation");
double res = 0;
for(int i = 0; i < size; ++i){
}
return res;
}
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