37 #ifndef __H__UG__PLUGINS__ELECTROMAGNETISM__EDDY_CURRENT_GF_USER_DATA__
38 #define __H__UG__PLUGINS__ELECTROMAGNETISM__EDDY_CURRENT_GF_USER_DATA__
50 #include "../nedelec_local_ass.h"
54 #include "../em_material.h"
57 namespace Electromagnetism{
66 template <
typename TGr
idFunc>
102 std::string fctString = std::string (cmp);
103 std::vector<std::string> tokens;
105 if ((
int) tokens.size () != 2)
106 UG_THROW(
"EddyCurrentHeat: Needed 2 components "
107 "in symbolic function names (for Re and Im), "
108 "but given: " << cmp);
109 for (
size_t i = 0; i < tokens.size (); i++)
113 for (
int i = 0; i < 2; i++)
116 m_fct [i] =
m_spGF->fct_id_by_name (tokens[i].c_str ());
119 "component for the name '" << tokens[i] <<
"'.");
122 for (
int i = 0; i < 2; i++)
124 UG_THROW (
"EddyCurrentHeat: The function space of component "
125 << tokens[i] <<
" of the grid function does not correspond "
126 "to the Nedelec element.");
136 template <
int refDim>
150 std::vector<std::vector<number> > vvvDeriv[],
156 UG_THROW (
"EddyCurrentHeat: Derivatives are not implemented.");
160 int elem_si =
m_spGF->approx_space()->subset_handler()->get_subset_index (elem);
162 UG_THROW (
"EddyCurrentHeat: No material data set to subset" << si
163 <<
" (or this is a low-dim. domain).");
166 for (
size_t i = 0; i < nip; i++) vValue [i] = 0.0;
171 std::vector<MathVector<dim> > E [2];
172 std::vector<DoFIndex> ind;
173 std::vector<number> dofValues;
175 for (
size_t part = 0; part < 2; part++)
177 E[part].resize (nip);
183 dofValues.resize (ind.size ());
184 for (
size_t sh = 0; sh < dofValues.size (); ++sh)
189 (
m_spGF->domain().
get(), elem, vCornerCoords, &(dofValues[0]),
190 vLocIP, nip, & (E[part][0]));
194 for (
size_t i = 0; i < nip; i++)
209 template <
typename TImpl,
size_t ReIm,
typename TGFunc>
233 const TImpl *
this_impl ()
const {
return static_cast<const TImpl*
> (
this);}
245 std::string fctString = std::string (cmp);
246 std::vector<std::string> tokens;
248 if ((
int) tokens.size () != 2)
249 UG_THROW(
"EddyCurrentReB: Needed 2 components "
250 "in symbolic function names (for Re and Im), "
251 "but given: " << cmp);
252 for (
size_t i = 0; i < tokens.size (); i++)
256 for (
int i = 0; i < 2; i++)
259 m_fct [i] =
m_spGF->fct_id_by_name (tokens[i].c_str ());
262 "component for the name '" << tokens[i] <<
"'.");
265 for (
int i = 0; i < 2; i++)
267 UG_THROW (
"EddyCurrent: The function space of component "
268 << tokens[i] <<
" of the grid function does not correspond "
269 "to the Nedelec element.");
279 template <
int refDim>
299 UG_THROW (
"EddyCurrentReB: Derivatives are not implemented.");
302 std::vector<DoFIndex> ind;
306 std::vector<number> dofValues (ind.size());
307 for (
size_t sh = 0; sh < dofValues.size (); ++sh)
313 (
m_spGF->domain().
get(), elem, vCornerCoords, &(dofValues[0]), curl);
314 for (
size_t ip = 0;
ip < nip;
ip++)
327 template <
typename TGr
idFunc>
330 <EddyCurrentReBofEUserData<TGridFunc>, EddyCurrentTraits::_Im_, TGridFunc>
371 template <
typename TGr
idFunc>
374 <EddyCurrentImBofEUserData<TGridFunc>, EddyCurrentTraits::_Re_, TGridFunc>
Class for subdomain-dependent data for the E-based formulated problems.
Definition: em_material.h:63
Definition: eddy_current_gf_user_data.h:213
EddyCurrentCurlEDependentCmpUserData(SmartPtr< TGFunc > spGridFct, const char *cmp)
constructor
Definition: eddy_current_gf_user_data.h:238
size_t m_fct[2]
components (Re and Im) of the grid function
Definition: eddy_current_gf_user_data.h:229
domain_type::position_type position_type
Type of position coordinates (e.g. position_type)
Definition: eddy_current_gf_user_data.h:222
static const int dim
World dimension.
Definition: eddy_current_gf_user_data.h:219
void eval_and_deriv(MathVector< dim > vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, LocalVector *u, bool bDeriv, int s, std::vector< std::vector< MathVector< dim > > > vvvDeriv[], const MathMatrix< refDim, dim > *vJT=NULL) const
Performs the main computations:
Definition: eddy_current_gf_user_data.h:281
virtual bool continuous() const
The vector field retrieved from the Nedelec-type 1 (Whitney-1) dofs are not continuous.
Definition: eddy_current_gf_user_data.h:273
TGFunc::domain_type domain_type
Type of domain.
Definition: eddy_current_gf_user_data.h:216
SmartPtr< TGFunc > m_spGF
grid function
Definition: eddy_current_gf_user_data.h:226
const TImpl * this_impl() const
const 'this' pointer of the implementation class
Definition: eddy_current_gf_user_data.h:233
virtual bool requires_grid_fct() const
Returns true to get the grid element in the evaluation routine.
Definition: eddy_current_gf_user_data.h:276
Definition: eddy_current_gf_user_data.h:70
static const int dim
World dimension.
Definition: eddy_current_gf_user_data.h:76
SmartPtr< EMaterial< domain_type > > m_spEMaterial
subdomain-dependent data (propertiels of the materials)
Definition: eddy_current_gf_user_data.h:89
SmartPtr< TGridFunc > m_spGF
grid function for
Definition: eddy_current_gf_user_data.h:83
size_t m_fct[2]
components (Re and Im) of the grid function
Definition: eddy_current_gf_user_data.h:86
virtual bool continuous() const
The vector field retrieved from the Nedelec-type 1 (Whitney-1) dofs are not continuous.
Definition: eddy_current_gf_user_data.h:130
domain_type::position_type position_type
Type of position coordinates (e.g. position_type)
Definition: eddy_current_gf_user_data.h:79
virtual bool requires_grid_fct() const
Returns true to get the grid element in the evaluation routine.
Definition: eddy_current_gf_user_data.h:133
EddyCurrentHeat(SmartPtr< TGridFunc > spGridFct, const char *cmp, SmartPtr< EMaterial< domain_type > > emMatherial)
constructor
Definition: eddy_current_gf_user_data.h:94
TGridFunc::domain_type domain_type
Type of domain.
Definition: eddy_current_gf_user_data.h:73
void eval_and_deriv(number vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, LocalVector *u, bool bDeriv, int s, std::vector< std::vector< number > > vvvDeriv[], const MathMatrix< refDim, dim > *vJT=NULL) const
Performs the main computations:
Definition: eddy_current_gf_user_data.h:138
Definition: eddy_current_gf_user_data.h:375
void get_value(const MathVector< dim > &ReCurlE, MathVector< dim > &ImB) const
Definition: eddy_current_gf_user_data.h:400
static const int dim
World dimension.
Definition: eddy_current_gf_user_data.h:380
TGridFunc::domain_type domain_type
Type of domain.
Definition: eddy_current_gf_user_data.h:377
EddyCurrentImBofEUserData(SmartPtr< TGridFunc > spGridFct, const char *cmp, number omega)
constructor
Definition: eddy_current_gf_user_data.h:389
number m_omega
Frequency .
Definition: eddy_current_gf_user_data.h:384
Definition: eddy_current_gf_user_data.h:331
TGridFunc::domain_type domain_type
Type of domain.
Definition: eddy_current_gf_user_data.h:333
static const int dim
World dimension.
Definition: eddy_current_gf_user_data.h:336
void get_value(const MathVector< dim > &ImCurlE, MathVector< dim > &ReB) const
Definition: eddy_current_gf_user_data.h:356
EddyCurrentReBofEUserData(SmartPtr< TGridFunc > spGridFct, const char *cmp, number omega)
constructor
Definition: eddy_current_gf_user_data.h:345
number m_omega
Frequency .
Definition: eddy_current_gf_user_data.h:340
Auxiliary class defining some important constants.
Definition: eddy_current_traits.h:44
static const size_t _Im_
index of the imaginary part in the grid functions
Definition: eddy_current_traits.h:50
static const size_t _Re_
index of the real part in the grid functions
Definition: eddy_current_traits.h:48
static void curl(const TDomain *domain, GridObject *elem, const position_type corners[], const number dofs[], MathVector< WDim > &curl_vec)
computes curl of the function
Definition: nedelec_local_ass.h:434
static void value(const TDomain *domain, GridObject *elem, const position_type corners[], const number dofs[], const MathVector< refDim > local[], const size_t n_pnt, MathVector< WDim > values[])
computes the values at given points
Definition: nedelec_local_ass.h:411
const MathVector< dim > & ip(size_t s, size_t ip) const
MathVector< dim > position_type
vector< string > TokenizeString(const char *str, const char delimiter=',')
void RemoveWhitespaceFromString(std::string &string)
#define UG_CATCH_THROW(msg)
vector_t::value_type VecTwoNormSq(const vector_t &v)
const number & DoFRef(const TMatrix &mat, const DoFIndex &iInd, const DoFIndex &jInd)