33 #ifndef __H__UG__LIB_DISC__SPATIAL_DISC__CONSTRAINTS__LAGRANGE_DIRICHLET_BOUNDARY__
34 #define __H__UG__LIB_DISC__SPATIAL_DISC__CONSTRAINTS__LAGRANGE_DIRICHLET_BOUNDARY__
53 template <
typename TDomain,
typename TAlgebra>
95 #ifdef LAGRANGE_DIRICHLET_ADJ_TRANSFER_FIX
96 , m_bAdjustTransfers(true)
105 #ifdef LAGRANGE_DIRICHLET_ADJ_TRANSFER_FIX
106 , m_bAdjustTransfers(true)
110 #ifdef LAGRANGE_DIRICHLET_ADJ_TRANSFER_FIX
116 m_bAdjustTransfers(bAdjustTransfers)
126 void add(
const char*
name,
const char*
function,
const char* subsets);
127 void add(
const char*
name,
const std::vector<std::string>& Fcts,
const std::vector<std::string>& Subsets);
129 void add(
LuaFunctionHandle fct,
const std::vector<std::string>& Fcts,
const std::vector<std::string>& Subsets);
141 void add(
number value,
const char*
function,
const char* subsets);
142 void add(
number value,
const std::vector<std::string>& Fcts,
const std::vector<std::string>& Subsets);
149 void add(
const char* functions,
const char* subsets);
150 void add(
const std::vector<std::string>& Fcts,
const std::vector<std::string>& Subsets);
194 const std::vector<number>* vScaleMass = NULL,
195 const std::vector<number>* vScaleStiff = NULL);
217 const std::vector<number>* vScaleMass = NULL,
218 const std::vector<number>* vScaleStiff = NULL);
243 template <
typename TUserData,
typename TScheduledUserData>
244 void extract_data(std::map<
int, std::vector<TUserData*> >& mvUserDataBndSegment,
245 std::vector<TScheduledUserData>& vUserData);
247 template <
typename TUserData>
248 void adjust_jacobian(
const std::map<
int, std::vector<TUserData*> >& mvUserData,
252 template <
typename TBaseElem,
typename TUserData>
257 template <
typename TUserData>
258 void adjust_defect(
const std::map<
int, std::vector<TUserData*> >& mvUserData,
262 template <
typename TBaseElem,
typename TUserData>
263 void adjust_defect(
const std::vector<TUserData*>& vUserData,
int si,
267 template <
typename TUserData>
268 void adjust_solution(
const std::map<
int, std::vector<TUserData*> >& mvUserData,
271 template <
typename TUserData>
272 void adjust_correction(
const std::map<
int, std::vector<TUserData*> >& mvUserData,
275 template <
typename TBaseElem,
typename TUserData>
279 template <
typename TBaseElem,
typename TUserData>
283 template <
typename TUserData>
284 void adjust_linear(
const std::map<
int, std::vector<TUserData*> >& mvUserData,
288 template <
typename TBaseElem,
typename TUserData>
289 void adjust_linear(
const std::vector<TUserData*>& vUserData,
int si,
293 template <
typename TUserData>
294 void adjust_rhs(
const std::map<
int, std::vector<TUserData*> >& mvUserData,
298 template <
typename TBaseElem,
typename TUserData>
299 void adjust_rhs(
const std::vector<TUserData*>& vUserData,
int si,
303 template <
typename TUserData>
304 void adjust_error(
const std::map<
int, std::vector<TUserData*> >& mvUserData,
307 template <
typename TUserData>
314 template <
typename TBaseElem,
typename TUserData>
321 template <
typename TUserData>
328 template <
typename TBaseElem,
typename TUserData>
344 std::string fctName_, std::string ssName_)
349 number time,
int si)
const
351 (*spFunctor)(val[0], x, time, si);
return true;
369 std::string fctName_, std::string ssName_)
373 number time,
int si)
const
375 return (*
spFunctor)(val[0], x, time, si);
393 std::string fctName_, std::string ssName_)
397 number time,
int si)
const
417 std::string fctName_, std::string ssName_)
421 number time,
int si)
const
423 (*spFunctor)(val, x, time, si);
return true;
444 number time,
int si)
const
499 typename domain_type::position_accessor_type
m_aaPos;
500 #ifdef LAGRANGE_DIRICHLET_ADJ_TRANSFER_FIX
502 bool m_bAdjustTransfers;
location name
Definition: checkpoint_util.lua:128
Definition: smart_pointer.h:296
Definition: smart_pointer.h:108
base class for approximation spaces without type of algebra or dof distribution
Definition: approximation_space.h:279
Definition: lagrange_dirichlet_boundary.h:56
virtual void adjust_error(const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol=SPNULL, const std::vector< number > *vScaleMass=NULL, const std::vector< number > *vScaleStiff=NULL)
adjusts the assembled error estimator values in the attachments according to the constraint
Definition: lagrange_dirichlet_boundary_impl.h:1599
SmartPtr< ApproximationSpace< TDomain > > m_spApproxSpace
current ApproxSpace
Definition: lagrange_dirichlet_boundary.h:493
DirichletBoundary()
constructor
Definition: lagrange_dirichlet_boundary.h:91
algebra_type::matrix_type matrix_type
Type of algebra matrix.
Definition: lagrange_dirichlet_boundary.h:74
bool m_bDirichletColumns
flag for setting dirichlet columns
Definition: lagrange_dirichlet_boundary.h:484
void add(SmartPtr< UserData< number, dim, bool > > func, const char *function, const char *subsets)
adds a lua callback (cond and non-cond)
Definition: lagrange_dirichlet_boundary_impl.h:73
SmartPtr< TDomain > m_spDomain
current domain
Definition: lagrange_dirichlet_boundary.h:496
std::map< int, std::vector< CondNumberData * > > m_mBNDNumberBndSegment
conditional boundary values for all subsets
Definition: lagrange_dirichlet_boundary.h:471
std::map< int, std::map< int, std::map< int, value_type > > > m_dirichletMap
Definition: lagrange_dirichlet_boundary.h:488
bool m_bInvertSubsetSelection
flag for inverting the subset selection: use Dirichlet throughout except for the given subsets
Definition: lagrange_dirichlet_boundary.h:481
domain_type::position_type position_type
Type of position coordinates (e.g. position_type)
Definition: lagrange_dirichlet_boundary.h:68
std::map< int, std::vector< VectorData * > > m_mVectorBndSegment
non-conditional boundary values for all subsets
Definition: lagrange_dirichlet_boundary.h:474
void assemble_dirichlet_rows(matrix_type &mat, ConstSmartPtr< DoFDistribution > dd, number time=0.0)
Sets dirichlet rows for all registered dirichlet values.
Definition: lagrange_dirichlet_boundary_impl.h:430
algebra_type::vector_type vector_type
Type of algebra vector.
Definition: lagrange_dirichlet_boundary.h:77
void invert_subset_selection()
inverts the subset selection making the conditions be imposed on the rest of the domain
Definition: lagrange_dirichlet_boundary.h:153
void adjust_linear(matrix_type &A, vector_type &b, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
sets unity rows in A and dirichlet values in right-hand side b
Definition: lagrange_dirichlet_boundary_impl.h:1275
matrix_type * m_A
Definition: lagrange_dirichlet_boundary.h:490
std::vector< CondNumberData > m_vBNDNumberData
Definition: lagrange_dirichlet_boundary.h:456
std::vector< VectorData > m_vVectorData
Definition: lagrange_dirichlet_boundary.h:460
std::map< int, std::vector< NumberData * > > m_mNumberBndSegment
non-conditional boundary values for all subsets
Definition: lagrange_dirichlet_boundary.h:465
TDomain domain_type
Type of domain.
Definition: lagrange_dirichlet_boundary.h:62
void adjust_defect(vector_type &d, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol=NULL, const std::vector< number > *vScaleMass=NULL, const std::vector< number > *vScaleStiff=NULL)
sets a zero value in the defect for all dirichlet indices
Definition: lagrange_dirichlet_boundary_impl.h:920
std::vector< NumberData > m_vNumberData
Definition: lagrange_dirichlet_boundary.h:457
std::map< int, std::vector< ConstNumberData * > > m_mConstNumberBndSegment
constant boundary values for all subsets
Definition: lagrange_dirichlet_boundary.h:468
std::vector< ConstNumberData > m_vConstNumberData
Definition: lagrange_dirichlet_boundary.h:458
void set_approximation_space(SmartPtr< ApproximationSpace< TDomain > > approxSpace)
sets the approximation space to work on
Definition: lagrange_dirichlet_boundary_impl.h:53
std::vector< OldNumberData > m_vOldNumberData
Definition: lagrange_dirichlet_boundary.h:462
virtual void adjust_restriction(matrix_type &R, ConstSmartPtr< DoFDistribution > ddCoarse, ConstSmartPtr< DoFDistribution > ddFine, int type, number time=0.0)
sets constraints in restriction
Definition: lagrange_dirichlet_boundary_impl.h:618
void check_functions_and_subsets(FunctionGroup &functionGroup, SubsetGroup &subsetGroup, size_t numFct) const
Definition: lagrange_dirichlet_boundary_impl.h:309
MultipleSideAndElemErrEstData< TDomain > err_est_type
error estimator type
Definition: lagrange_dirichlet_boundary.h:83
TAlgebra algebra_type
Type of algebra.
Definition: lagrange_dirichlet_boundary.h:71
domain_type::position_accessor_type m_aaPos
current position accessor
Definition: lagrange_dirichlet_boundary.h:499
void adjust_rhs(vector_type &b, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
sets the dirichlet value in the right-hand side
Definition: lagrange_dirichlet_boundary_impl.h:1458
void adjust_solution(vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
sets the dirichlet value in the solution for all dirichlet indices
Definition: lagrange_dirichlet_boundary_impl.h:1042
void adjust_jacobian(matrix_type &J, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol=NULL, const number s_a0=1.0)
sets a unity row for all dirichlet indices
Definition: lagrange_dirichlet_boundary_impl.h:754
virtual void adjust_prolongation(matrix_type &P, ConstSmartPtr< DoFDistribution > ddFine, ConstSmartPtr< DoFDistribution > ddCoarse, int type, number time=0.0)
sets constraints in prolongation
Definition: lagrange_dirichlet_boundary_impl.h:486
virtual int type() const
returns the type of the constraints
Definition: lagrange_dirichlet_boundary.h:235
std::map< int, std::vector< OldNumberData * > > m_mOldNumberBndSegment
non-conditional boundary values for all subsets
Definition: lagrange_dirichlet_boundary.h:477
static const int dim
world Dimension
Definition: lagrange_dirichlet_boundary.h:65
void clear()
removes all scheduled dirichlet data.
Definition: lagrange_dirichlet_boundary_impl.h:63
DirichletBoundary(bool DirichletColumns)
constructor with flag for Dirichlet-Columns.
Definition: lagrange_dirichlet_boundary.h:101
void extract_data()
Definition: lagrange_dirichlet_boundary_impl.h:410
IDomainConstraint< TDomain, TAlgebra > base_type
Base Type.
Definition: lagrange_dirichlet_boundary.h:59
matrix_type::value_type value_type
Type of value type.
Definition: lagrange_dirichlet_boundary.h:80
~DirichletBoundary()
destructor
Definition: lagrange_dirichlet_boundary.h:122
virtual void adjust_correction(vector_type &c, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
sets zero to correction
Definition: lagrange_dirichlet_boundary_impl.h:1159
Definition: function_group.h:52
Definition: constraint_interface.h:162
ConstSmartPtr< DoFDistribution > dd(const GridLevel &gl) const
returns the level dof distribution
Definition: constraint_interface.h:242
Handle for a lua reference.
Definition: lua_function_handle.h:40
Definition: err_est_data.h:506
Wrapper for sequential matrices to handle them in parallel.
Definition: parallel_matrix.h:65
Group of subsets.
Definition: subset_group.h:51
time series of solutions and corresponding time point
Definition: solution_time_series.h:59
const NullSmartPtr SPNULL
The equivalent to NULL for smart pointers.
Definition: smart_pointer.h:90
double number
Definition: types.h:124
CPUAlgebra::vector_type vector_type
@ CT_DIRICHLET
Definition: ass_tuner.h:59
function func(x, y, z, t, si)
T value_type
Definition: sparsematrix_interface.h:2
grouping for subset and conditional data
Definition: lagrange_dirichlet_boundary.h:363
size_t fct[numFct]
Definition: lagrange_dirichlet_boundary.h:381
SubsetGroup ssGrp
Definition: lagrange_dirichlet_boundary.h:382
static const bool setSolValue
Definition: lagrange_dirichlet_boundary.h:365
std::string fctName
Definition: lagrange_dirichlet_boundary.h:379
MathVector< 1 > value_type
Definition: lagrange_dirichlet_boundary.h:367
static const bool isConditional
Definition: lagrange_dirichlet_boundary.h:364
SmartPtr< UserData< number, dim, bool > > spFunctor
Definition: lagrange_dirichlet_boundary.h:378
bool operator()(MathVector< 1 > &val, const MathVector< dim > x, number time, int si) const
Definition: lagrange_dirichlet_boundary.h:372
CondNumberData(SmartPtr< UserData< number, dim, bool > > functor_, std::string fctName_, std::string ssName_)
Definition: lagrange_dirichlet_boundary.h:368
static const size_t numFct
Definition: lagrange_dirichlet_boundary.h:366
std::string ssName
Definition: lagrange_dirichlet_boundary.h:380
grouping for subset and constant data
Definition: lagrange_dirichlet_boundary.h:387
number functor
Definition: lagrange_dirichlet_boundary.h:402
bool operator()(MathVector< 1 > &val, const MathVector< dim > x, number time, int si) const
Definition: lagrange_dirichlet_boundary.h:396
std::string ssName
Definition: lagrange_dirichlet_boundary.h:404
SubsetGroup ssGrp
Definition: lagrange_dirichlet_boundary.h:406
static const bool setSolValue
Definition: lagrange_dirichlet_boundary.h:389
static const size_t numFct
Definition: lagrange_dirichlet_boundary.h:390
MathVector< 1 > value_type
Definition: lagrange_dirichlet_boundary.h:391
size_t fct[numFct]
Definition: lagrange_dirichlet_boundary.h:405
static const bool isConditional
Definition: lagrange_dirichlet_boundary.h:388
std::string fctName
Definition: lagrange_dirichlet_boundary.h:403
ConstNumberData(number value_, std::string fctName_, std::string ssName_)
Definition: lagrange_dirichlet_boundary.h:392
grouping for subset and non-conditional data
Definition: lagrange_dirichlet_boundary.h:338
std::string ssName
Definition: lagrange_dirichlet_boundary.h:356
static const size_t numFct
Definition: lagrange_dirichlet_boundary.h:341
MathVector< 1 > value_type
Definition: lagrange_dirichlet_boundary.h:342
static const bool isConditional
Definition: lagrange_dirichlet_boundary.h:339
SubsetGroup ssGrp
Definition: lagrange_dirichlet_boundary.h:358
size_t fct[numFct]
Definition: lagrange_dirichlet_boundary.h:357
std::string fctName
Definition: lagrange_dirichlet_boundary.h:355
static const bool setSolValue
Definition: lagrange_dirichlet_boundary.h:340
NumberData(SmartPtr< UserData< number, dim > > functor_, std::string fctName_, std::string ssName_)
Definition: lagrange_dirichlet_boundary.h:343
SmartPtr< UserData< number, dim > > spFunctor
Definition: lagrange_dirichlet_boundary.h:354
bool operator()(MathVector< 1 > &val, const MathVector< dim > x, number time, int si) const
Definition: lagrange_dirichlet_boundary.h:348
grouping for subset and the data already stored in the solution
Definition: lagrange_dirichlet_boundary.h:435
OldNumberData(std::string fctName_, std::string ssName_)
Definition: lagrange_dirichlet_boundary.h:440
std::string fctName
Definition: lagrange_dirichlet_boundary.h:450
size_t fct[numFct]
Definition: lagrange_dirichlet_boundary.h:452
static const size_t numFct
Definition: lagrange_dirichlet_boundary.h:438
static const bool setSolValue
Definition: lagrange_dirichlet_boundary.h:437
SubsetGroup ssGrp
Definition: lagrange_dirichlet_boundary.h:453
std::string ssName
Definition: lagrange_dirichlet_boundary.h:451
number functor
Definition: lagrange_dirichlet_boundary.h:449
MathVector< 1 > value_type
Definition: lagrange_dirichlet_boundary.h:439
bool operator()(MathVector< 1 > &val, const MathVector< dim > x, number time, int si) const
Definition: lagrange_dirichlet_boundary.h:443
static const bool isConditional
Definition: lagrange_dirichlet_boundary.h:436
grouping for subset and non-conditional vector data
Definition: lagrange_dirichlet_boundary.h:411
SmartPtr< UserData< MathVector< dim >, dim > > spFunctor
Definition: lagrange_dirichlet_boundary.h:426
static const bool isConditional
Definition: lagrange_dirichlet_boundary.h:412
std::string ssName
Definition: lagrange_dirichlet_boundary.h:428
static const size_t numFct
Definition: lagrange_dirichlet_boundary.h:414
std::string fctName
Definition: lagrange_dirichlet_boundary.h:427
VectorData(SmartPtr< UserData< MathVector< dim >, dim > > value_, std::string fctName_, std::string ssName_)
Definition: lagrange_dirichlet_boundary.h:416
size_t fct[numFct]
Definition: lagrange_dirichlet_boundary.h:429
bool operator()(MathVector< dim > &val, const MathVector< dim > x, number time, int si) const
Definition: lagrange_dirichlet_boundary.h:420
static const bool setSolValue
Definition: lagrange_dirichlet_boundary.h:413
MathVector< dim > value_type
Definition: lagrange_dirichlet_boundary.h:415
SubsetGroup ssGrp
Definition: lagrange_dirichlet_boundary.h:430