26 template<
typename Scalar>
27 Filter<Scalar>::Filter()
31 template<
typename Scalar>
32 Filter<Scalar>::Filter(std::vector<MeshFunctionSharedPtr<Scalar> > solutions) : MeshFunction<Scalar>(), solutions(solutions)
37 template<
typename Scalar>
41 std::vector<MeshSharedPtr> meshes;
42 for (
int i = 0; i < this->solutions.size(); i++)
43 meshes.push_back(this->solutions[i]->get_mesh());
44 this->mesh = meshes[0];
46 for (
int i = 0; i < this->solutions.size(); i++)
47 this->solutions_sub_idx.push_back(0);
51 this->space_type = HERMES_INVALID_SPACE;
53 this->space_type = sln->get_space_type();
57 for (
int i = 1; i < this->solutions.size(); i++)
59 if (meshes[i] ==
nullptr)
61 this->warn(
"You may be initializing a Filter with Solution that is missing a Mesh.");
62 throw Hermes::Exceptions::Exception(
"this->meshes[%d] is nullptr in Filter<Scalar>::init().", i);
64 if (meshes[i]->get_seq() != this->mesh->get_seq())
71 if (sln ==
nullptr || sln->get_space_type() != this->space_type)
72 this->space_type = HERMES_INVALID_SPACE;
77 this->mesh = MeshSharedPtr(
new Mesh);
78 this->unidata = Traverse::construct_union_mesh(this->solutions.size(), &meshes[0], this->mesh);
82 this->num_components = 1;
85 set_quad_2d(&g_quad_2d_std);
88 template<
typename Scalar>
94 template<
typename Scalar>
98 for (
int i = 0; i < this->solutions.size(); i++)
100 this->solutions[i]->set_quad_2d(quad_2d);
103 template<
typename Scalar>
109 for (
int i = 0; i < this->solutions.size(); i++)
111 this->solutions[i]->set_active_element(e);
113 for (
int i = 0; i < this->solutions.size(); i++)
114 solutions_sub_idx[i] = 0;
118 for (
int i = 0; i < this->solutions.size(); i++)
120 this->solutions[i]->set_active_element(unidata[i][e->
id].e);
121 this->solutions[i]->set_transform(unidata[i][e->
id].idx);
122 solutions_sub_idx[i] = this->solutions[i]->get_transform();
130 template<
typename Scalar>
135 for (
int i = 0; i < this->solutions.size(); i++)
136 free_with_check(unidata[i]);
137 free_with_check(unidata);
141 template<
typename Scalar>
148 template<
typename Scalar>
152 for (
int i = 0; i < this->solutions.size(); i++)
163 if (this->solutions[i]->get_transform() == solutions_sub_idx[i])
164 this->solutions[i]->push_transform(son);
165 solutions_sub_idx[i] = this->solutions[i]->get_transform();
169 template<
typename Scalar>
173 for (
int i = 0; i < this->solutions.size(); i++)
175 if (this->solutions[i]->get_transform() == solutions_sub_idx[i] && solutions_sub_idx[i] != 0)
176 this->solutions[i]->pop_transform();
177 solutions_sub_idx[i] = this->solutions[i]->get_transform();
181 template<
typename Scalar>
186 template<
typename Scalar>
187 SimpleFilter<Scalar>::SimpleFilter(std::vector<MeshFunctionSharedPtr<Scalar> > solutions,
const std::vector<int> items) : Filter<Scalar>(solutions), items(items)
189 if (this->items.size() > 0)
190 Hermes::Helpers::check_length(solutions, items);
192 for (
int i = 0; i < this->solutions.size(); i++)
196 this->init_components();
199 template<
typename Scalar>
200 SimpleFilter<Scalar>::~SimpleFilter()
204 template<
typename Scalar>
205 void SimpleFilter<Scalar>::init_components()
207 bool vec1 =
false, vec2 =
false;
208 for (
int i = 0; i < this->solutions.size(); i++)
210 if (this->solutions[i]->get_num_components() > 1)
213 if ((this->items[i] & H2D_FN_COMPONENT_0) && (this->items[i] & H2D_FN_COMPONENT_1))
216 if (this->solutions[i]->get_num_components() == 1)
217 this->items[i] &= H2D_FN_COMPONENT_0;
219 this->num_components = (vec1 && vec2) ? 2 : 1;
222 template<
typename Scalar>
225 #ifdef H2D_USE_SECOND_DERIVATIVES
226 if (mask & (H2D_FN_DX | H2D_FN_DY | H2D_FN_DXX | H2D_FN_DYY | H2D_FN_DXY))
228 if (mask & (H2D_FN_DX | H2D_FN_DY))
230 throw Hermes::Exceptions::Exception(
"SimpleFilter not defined for derivatives.");
232 Quad2D* quad = this->quads[this->cur_quad];
233 unsigned char np = quad->get_num_points(order, this->element->get_mode());
236 for (
int i = 0; i < this->solutions.size(); i++)
237 this->solutions[i]->set_quad_order(order, this->items[i]);
239 for (
int j = 0; j < this->num_components; j++)
242 std::vector<const Scalar*> tab;
243 for (
int i = 0; i < this->solutions.size(); i++)
245 int a = 0, b = 0, mask = this->items[i];
246 if (mask >= 0x40) { a = 1; mask >>= 6; }
247 while (!(mask & 1)) { mask >>= 1; b++; }
248 tab.push_back(const_cast<Scalar*>(this->solutions[i]->get_values(this->num_components == 1 ? a : j, b)));
249 if (tab[i] ==
nullptr)
250 throw Hermes::Exceptions::Exception(
"Value of 'item%d' is incorrect in filter definition.", i + 1);
254 filter_fn(np, tab, this->values[j][0]);
256 this->values_valid =
true;
259 template<
typename Scalar>
262 std::vector<Scalar> val;
263 for (
int i = 0; i < this->solutions.size(); i++)
264 val.push_back(this->solutions[i]->get_pt_value(x, y, use_MeshHashGrid, e)->val[0]);
269 std::vector<const Scalar*> values;
270 for (
int i = 0; i < this->solutions.size(); i++)
271 values.push_back(&val[i]);
274 filter_fn(1, values, &result);
276 toReturn->val[0] = result;
280 ComplexFilter::ComplexFilter() :
Filter<double>()
282 this->unimesh =
false;
285 ComplexFilter::ComplexFilter(MeshFunctionSharedPtr<std::complex<double> > solution,
int item) : Filter<double>()
287 this->unimesh =
false;
288 this->sln_complex = solution;
290 this->mesh = solution->get_mesh();
291 this->solutions_sub_idx.push_back(0);
295 ComplexFilter::~ComplexFilter()
307 this->sln_complex->set_quad_2d(quad_2d);
313 this->sln_complex->set_active_element(e);
314 this->solutions_sub_idx[0] = 0;
323 this->sln_complex->push_transform(son);
329 this->sln_complex->pop_transform();
334 #ifdef H2D_USE_SECOND_DERIVATIVES
335 if (mask & (H2D_FN_DX | H2D_FN_DY | H2D_FN_DXX | H2D_FN_DYY | H2D_FN_DXY))
337 if (mask & (H2D_FN_DX | H2D_FN_DY))
339 throw Hermes::Exceptions::Exception(
"Filter not defined for derivatives.");
342 unsigned char np = quad->get_num_points(order, this->
element->get_mode());
344 this->sln_complex->set_quad_order(order,
H2D_FN_VAL);
347 filter_fn(np,
const_cast<std::complex<double>*
>(this->sln_complex->get_values(0, 0)), this->
values[0][0]);
349 filter_fn(np,
const_cast<std::complex<double>*
>(this->sln_complex->get_values(1, 0)), this->
values[1][0]);
362 filter_fn(1, val->val, &result);
366 toReturn->val[0] = result;
367 toReturn->dx[0] = 0.0;
368 toReturn->dy[0] = 0.0;
372 this->warn(
"ComplexFilter only implemented for scalar functions.");
377 template<
typename Scalar>
382 template<
typename Scalar>
383 DXDYFilter<Scalar>::DXDYFilter(std::vector<MeshFunctionSharedPtr<Scalar> > solutions) : Filter<Scalar>(solutions)
388 template<
typename Scalar>
389 DXDYFilter<Scalar>::~DXDYFilter()
393 template<
typename Scalar>
394 void DXDYFilter<Scalar>::init_components()
396 this->num_components = this->solutions[0]->get_num_components();
397 for (
int i = 1; i < this->solutions.size(); i++)
398 if (this->solutions[i]->get_num_components() != this->num_components)
399 throw Hermes::Exceptions::Exception(
"Filter: Solutions do not have the same number of components!");
402 template<
typename Scalar>
409 template<
typename Scalar>
412 Quad2D* quad = this->quads[this->cur_quad];
413 unsigned char np = quad->get_num_points(order, this->element->get_mode());
416 for (
int i = 0; i < this->solutions.size(); i++)
419 for (
int j = 0; j < this->num_components; j++)
423 const Scalar *val[H2D_MAX_COMPONENTS], *dx[H2D_MAX_COMPONENTS], *dy[H2D_MAX_COMPONENTS];
424 x = this->solutions[0]->get_refmap()->get_phys_x(order);
425 y = this->solutions[0]->get_refmap()->get_phys_y(order);
427 for (
int i = 0; i < this->solutions.size(); i++)
429 val[i] = this->solutions[i]->get_fn_values(j);
430 dx[i] = this->solutions[i]->get_dx_values(j);
431 dy[i] = this->solutions[i]->get_dy_values(j);
434 std::vector<const Scalar *> values_vector;
435 std::vector<const Scalar *> dx_vector;
436 std::vector<const Scalar *> dy_vector;
438 for (
int i = 0; i < this->solutions.size(); i++)
440 values_vector.push_back(val[i]);
441 dx_vector.push_back(dx[i]);
442 dy_vector.push_back(dy[i]);
446 filter_fn(np, x, y, values_vector, dx_vector, dy_vector, this->values[j][0], this->values[j][1], this->values[j][2]);
449 this->values_valid =
true;
452 template<
typename Scalar>
455 this->warn(
"DXDYFilter<Scalar>::get_pt_value not implemented.");
459 template<
typename Scalar>
462 for (
int i = 0; i < n; i++)
466 for (
unsigned int j = 0; j < values.size(); j++)
467 result[i] += sqr(values[j][i]);
468 result[i] = sqrt(result[i]);
472 template<
typename Scalar>
473 MagFilter<Scalar>::MagFilter(std::vector<MeshFunctionSharedPtr<Scalar> > solutions, std::vector<int> items) : SimpleFilter<Scalar>(solutions, items)
478 template<
typename Scalar>
482 this->solutions = { sln1, sln1 };
483 this->items = { item1 & H2D_FN_COMPONENT_0, item1 & H2D_FN_COMPONENT_1 };
484 if (sln1->get_num_components() < 2)
485 throw Hermes::Exceptions::Exception(
"The single-argument constructor is intended for vector-valued solutions.");
489 template<
typename Scalar>
494 template<
typename Scalar>
497 std::vector<MeshFunctionSharedPtr<Scalar> > slns;
498 std::vector<int> items;
499 for (
int i = 0; i < this->solutions.size(); i++)
501 slns.push_back(this->solutions[i]->clone());
502 items.push_back(this->items[i]);
508 void TopValFilter::filter_fn(
int n,
const std::vector<const double*>& values,
double* result)
510 for (
int i = 0; i < n; i++)
513 for (
unsigned int j = 0; j < values.size(); j++)
514 if (values[j][i] > limits[j])
515 result[i] = limits[j];
517 result[i] = values[j][i];
521 TopValFilter::TopValFilter(std::vector<MeshFunctionSharedPtr<double> > solutions, std::vector<double> limits, std::vector<int> items) : SimpleFilter<double>(solutions, items), limits(limits)
528 this->limits.push_back(limit);
529 this->solutions.push_back(sln);
530 this->items.push_back(item);
534 TopValFilter::~TopValFilter()
540 std::vector<MeshFunctionSharedPtr<double> > slns;
541 std::vector<int> items;
542 for (
int i = 0; i < this->solutions.size(); i++)
544 slns.push_back(this->solutions[i]->
clone());
545 items.push_back(this->items[i]);
551 void BottomValFilter::filter_fn(
int n,
const std::vector<const double*>& values,
double* result)
553 for (
int i = 0; i < n; i++)
556 for (
unsigned int j = 0; j < values.size(); j++)
557 if (values[j][i] < limits[j])
558 result[i] = limits[j];
560 result[i] = values[j][i];
564 BottomValFilter::BottomValFilter(std::vector<MeshFunctionSharedPtr<double> > solutions, std::vector<double> limits, std::vector<int> items) : SimpleFilter<double>(solutions, items), limits(limits)
571 this->limits.push_back(limit);
572 this->solutions.push_back(sln);
573 this->items.push_back(item);
577 BottomValFilter::~BottomValFilter()
583 std::vector<MeshFunctionSharedPtr<double> > slns;
584 std::vector<int> items;
585 for (
int i = 0; i < this->solutions.size(); i++)
587 slns.push_back(this->solutions[i]->
clone());
588 items.push_back(this->items[i]);
594 void ValFilter::filter_fn(
int n,
const std::vector<const double*>& values,
double* result)
596 for (
int i = 0; i < n; i++)
599 for (
unsigned int j = 0; j < values.size(); j++)
600 if (values[j][i] < low_limits[j])
601 result[i] = low_limits[j];
603 if (values[j][i] > high_limits[j])
604 result[i] = high_limits[j];
606 result[i] = values[j][i];
610 ValFilter::ValFilter(std::vector<MeshFunctionSharedPtr<double> > solutions, std::vector<double> low_limits, std::vector<double> high_limits, std::vector<int> items) : SimpleFilter<double>(solutions, items), low_limits(low_limits), high_limits(high_limits)
617 this->low_limits.push_back(low_limit);
618 this->high_limits.push_back(high_limit);
619 this->solutions.push_back(sln);
620 this->items.push_back(item);
624 ValFilter::~ValFilter()
630 std::vector<MeshFunctionSharedPtr<double> > slns;
631 std::vector<int> items;
632 for (
int i = 0; i < this->solutions.size(); i++)
634 slns.push_back(this->solutions[i]->
clone());
635 items.push_back(this->items[i]);
641 template<
typename Scalar>
644 for (
int i = 0; i < n; i++) result[i] = values[0][i] - values.at(1)[i];
647 template<
typename Scalar>
648 DiffFilter<Scalar>::DiffFilter(std::vector<MeshFunctionSharedPtr<Scalar> > solutions, std::vector<int> items) : SimpleFilter<Scalar>(solutions, items) {}
650 template<
typename Scalar>
651 DiffFilter<Scalar>::~DiffFilter()
655 template<
typename Scalar>
658 std::vector<MeshFunctionSharedPtr<Scalar> > slns;
659 std::vector<int> items;
660 for (
int i = 0; i < this->solutions.size(); i++)
662 slns.push_back(this->solutions[i]->clone());
663 items.push_back(this->items[i]);
669 template<
typename Scalar>
672 for (
int i = 0; i < n; i++)
675 for (
unsigned int j = 0; j < values.size(); j++)
676 result[i] += values[j][i];
680 template<
typename Scalar>
681 SumFilter<Scalar>::SumFilter(std::vector<MeshFunctionSharedPtr<Scalar> > solutions, std::vector<int> items) : SimpleFilter<Scalar>(solutions, items) {}
683 template<
typename Scalar>
684 SumFilter<Scalar>::~SumFilter()
688 template<
typename Scalar>
691 std::vector<MeshFunctionSharedPtr<Scalar> > slns;
692 std::vector<int> items;
693 for (
int i = 0; i < this->solutions.size(); i++)
695 slns.push_back(this->solutions[i]->clone());
696 items.push_back(this->items[i]);
705 for (
int i = 0; i < n; i++)
706 result[i] = sqr(v1[0][i]);
710 void SquareFilter<std::complex<double> >::filter_fn(
int n,
const std::vector<
const std::complex<double> *>& v1, std::complex<double> * result)
712 for (
int i = 0; i < n; i++)
713 result[i] = std::norm(v1[0][i]);
716 template<
typename Scalar>
717 SquareFilter<Scalar>::SquareFilter(std::vector<MeshFunctionSharedPtr<Scalar> > solutions, std::vector<int> items)
718 : SimpleFilter<Scalar>(solutions, items)
720 if (solutions.size() > 1)
721 throw Hermes::Exceptions::Exception(
"SquareFilter only supports one MeshFunction.");
724 template<
typename Scalar>
725 SquareFilter<Scalar>::~SquareFilter()
729 template<
typename Scalar>
732 std::vector<MeshFunctionSharedPtr<Scalar> > slns;
733 std::vector<int> items;
734 for (
int i = 0; i < this->solutions.size(); i++)
736 slns.push_back(this->solutions[i]->clone());
737 items.push_back(this->items[i]);
743 void AbsFilter::filter_fn(
int n,
const std::vector<const double*>& v1,
double * result)
745 for (
int i = 0; i < n; i++)
746 result[i] = std::abs(v1[0][i]);
749 AbsFilter::AbsFilter(std::vector<MeshFunctionSharedPtr<double> > solutions, std::vector<int> items)
750 : SimpleFilter<double>(solutions, items)
752 if (solutions.size() > 1)
753 throw Hermes::Exceptions::Exception(
"AbsFilter only supports one MeshFunction.");
756 AbsFilter::AbsFilter(MeshFunctionSharedPtr<double> solution)
757 : SimpleFilter<double>()
759 this->solutions.push_back(solution);
767 AbsFilter::~AbsFilter()
773 std::vector<MeshFunctionSharedPtr<double> > slns;
774 std::vector<int> items;
775 for (
int i = 0; i < this->solutions.size(); i++)
777 slns.push_back(this->solutions[i]->
clone());
778 items.push_back(this->items[i]);
784 void RealFilter::filter_fn(
int n,
const std::complex<double>* values,
double* result)
786 for (
int i = 0; i < n; i++)
787 result[i] = values[i].real();
796 RealFilter::RealFilter()
801 RealFilter::RealFilter(MeshFunctionSharedPtr<std::complex<double> > solution,
int item)
802 : ComplexFilter(solution, item)
806 RealFilter::~RealFilter()
810 void ImagFilter::filter_fn(
int n,
const std::complex<double>* values,
double* result)
812 for (
int i = 0; i < n; i++)
813 result[i] = values[i].imag();
816 ImagFilter::ImagFilter(MeshFunctionSharedPtr<std::complex<double> > solution,
int item)
817 : ComplexFilter(solution, item)
821 ImagFilter::~ImagFilter()
831 void ComplexAbsFilter::filter_fn(
int n,
const std::complex<double>* values,
double* result)
833 for (
int i = 0; i < n; i++)
834 result[i] = sqrt(sqr(values[i].real()) + sqr(values[i].imag()));
848 ComplexAbsFilter::~ComplexAbsFilter()
852 void AngleFilter::filter_fn(
int n,
const std::vector<
const std::complex<double>*>& v1,
double* result)
854 for (
int i = 0; i < n; i++)
855 result[i] = atan2(v1[0][i].imag(), v1[0][i].real());
858 AngleFilter::AngleFilter(std::vector<MeshFunctionSharedPtr<std::complex<double> > > solutions, std::vector<int> items)
859 : SimpleFilter<
std::complex<double> >(solutions, items)
861 if (solutions.size() > 1)
862 throw Hermes::Exceptions::Exception(
"RealFilter only supports one MeshFunction.");
865 AngleFilter::~AngleFilter()
871 #ifdef H2D_USE_SECOND_DERIVATIVES
872 if (mask & (H2D_FN_DX | H2D_FN_DY | H2D_FN_DXX | H2D_FN_DYY | H2D_FN_DXY))
874 if (mask & (H2D_FN_DX | H2D_FN_DY))
876 throw Hermes::Exceptions::Exception(
"VonMisesFilter not defined for derivatives.");
879 unsigned char np = quad->get_num_points(order, this->
element->get_mode());
881 this->solutions[0]->set_quad_order(order,
H2D_FN_VAL | H2D_FN_DX | H2D_FN_DY);
882 this->solutions[1]->set_quad_order(order, H2D_FN_DX | H2D_FN_DY);
884 const double *dudx = this->solutions[0]->get_dx_values();
885 const double *dudy = this->solutions[0]->get_dy_values();
886 const double *dvdx = this->solutions[1]->get_dx_values();
887 const double *dvdy = this->solutions[1]->get_dy_values();
888 const double *uval = this->solutions[0]->get_fn_values();
892 for (
int i = 0; i < np; i++)
895 double tz = lambda*(dudx[i] + dvdy[i]);
896 double tx = tz + 2 * mu*dudx[i];
897 double ty = tz + 2 * mu*dvdy[i];
898 if (cyl) tz += 2 * mu*uval[i] / x[i];
899 double txy = mu*(dudy[i] + dvdx[i]);
902 this->values[0][0][i] = 1.0 / sqrt(2.0) * sqrt(sqr(tx - ty) + sqr(ty - tz) + sqr(tz - tx) + 6 * sqr(txy));
909 this->warn(
"VonMisesFilter<Scalar>::get_pt_value not implemented.");
914 int cyl,
int item1,
int item2)
915 :
Filter<double>(solutions)
918 this->lambda = lambda;
924 VonMisesFilter::~VonMisesFilter()
930 std::vector<MeshFunctionSharedPtr<double> > slns;
931 for (
int i = 0; i < this->solutions.size(); i++)
932 slns.push_back(this->solutions[i]->clone());
937 template<
typename Scalar>
940 Quad2D* quad = this->quads[this->cur_quad];
941 unsigned char np = quad->get_num_points(order, this->element->get_mode());
942 struct Filter<Scalar>::
Node* node = this->new_node(H2D_FN_DEFAULT, np);
945 for (int i = 0; i < this->solutions.size(); i++)
946 this->solutions[i]->set_quad_order(order);
948 for (int j = 0; j < this->num_components; j++)
951 std::vector<Scalar*> val, dx, dy;
952 for (
int i = 0; i < this->solutions.size(); i++)
958 if (this->solutions.size() == 2)
960 for (
int i = 0; i < np; i++)
962 node->values[j][0][i] = tau_frac * (val[1][i] - val[0][i]) + val[1][i];
963 node->values[j][1][i] = tau_frac * (dx[1][i] - dx[0][i]) + dx[1][i];
964 node->values[j][2][i] = tau_frac * (dy[1][i] - dy[0][i]) + dy[1][i];
969 for (
int i = 0; i < np; i++)
971 node->values[j][0][i] = val[0][i];
972 node->values[j][1][i] = dx[0][i];
973 node->values[j][2][i] = dy[0][i];
977 this->values_valid =
true;
980 template<
typename Scalar>
983 this->warn(
"LinearFilter<Scalar>::get_pt_value not implemented.");
987 template<
typename Scalar>
993 template<
typename Scalar>
994 LinearFilter<Scalar>::LinearFilter(MeshFunctionSharedPtr<Scalar> older, MeshFunctionSharedPtr<Scalar> old,
double tau_frac)
995 : Filter<Scalar>({ older, old })
997 this->tau_frac = tau_frac;
1001 template<
typename Scalar>
1002 LinearFilter<Scalar>::~LinearFilter()
1006 template<
typename Scalar>
1007 void LinearFilter<Scalar>::init_components()
1009 this->num_components = this->solutions[0]->get_num_components();
1010 for (
int i = 1; i < this->solutions.size(); i++)
1011 if (this->solutions[i]->get_num_components() != this->num_components)
1012 throw Hermes::Exceptions::Exception(
"Filter: Solutions do not have the same number of components!");
1015 template<
typename Scalar>
1021 for (
int i = 0; i < this->solutions.size(); i++)
1023 int o = this->solutions[i]->get_fn_order();
1024 if (o > this->order) this->order = o;
virtual void init()
Internal.
virtual MeshFunction< double > * clone() const
virtual void push_transform(int son)
Calculates the Von Mises stress.
Stores one element of a mesh.
Represents a finite element mesh. Typical usage: MeshSharedPtr mesh; Hermes::Hermes2D::MeshReaderH2DX...
virtual void set_active_element(Element *e)
virtual void set_active_element(Element *e)
TopValFilter takes functions and puts a threshold on their highest values.
virtual void set_active_element(Element *e)
virtual MeshFunction< double > * clone() const
virtual void set_quad_2d(Quad2D *quad_2d)
Represents a function defined on a mesh.
virtual void set_quad_2d(Quad2D *quad_2d)
virtual void push_transform(int son)
virtual MeshFunction< double > * clone() const
virtual MeshFunction< Scalar > * clone() const
virtual void precalculate(unsigned short order, unsigned short mask)
precalculates the current function at the current integration points.
virtual void reinit()
Internal.
virtual MeshFunction< double > * clone() const
double * get_phys_x(int order)
virtual MeshFunction< Scalar > * clone() const
virtual void set_quad_2d(Quad2D *quad_2d)
Stores one node of a mesh.
virtual void pop_transform()
virtual const Scalar * get_dx_values(int component=0) const
Returns the x partial derivative.
virtual const Scalar * get_dy_values(int component=0) const
Returns the y partial derivative.
virtual void precalculate(unsigned short order, unsigned short mask)
precalculates the current function at the current integration points.
BottomValFilter takes functions and puts a threshold on their lowest values.
Calculates the magnitude of a vector function.
virtual MeshFunction< Scalar > * clone() const
virtual void push_transform(int son)
Calculates absolute value of a real solution.
virtual void set_active_element(Element *e)
ValFilter takes functions and puts a threshold on their lowest AND highest values.
const int H2D_FN_DEFAULT
default precalculation mask
virtual void pop_transform()
Calculates the square of a function.
virtual MeshFunction< double > * clone() const
double values[H2D_MAX_SOLUTION_COMPONENTS][H2D_NUM_FUNCTION_VALUES][H2D_MAX_INTEGRATION_POINTS_COUNT]
The data.
virtual MeshFunction< double > * clone() const
virtual void free()
Frees all precalculated tables.
Calculates the difference of two functions.
virtual void precalculate(unsigned short order, unsigned short mask)
precalculates the current function at the current integration points.
Computes the absolute value of a complex solution.
virtual Func< Scalar > * get_pt_value(double x, double y, bool use_MeshHashGrid=false, Element *e=nullptr)
Return the value at the coordinates x,y.
Calculates the sum of two functions.
virtual Func< double > * get_pt_value(double x, double y, bool use_MeshHashGrid=false, Element *e=nullptr)
Return the value at the coordinates x,y.
bool values_valid
Flag that the data are not 'dirty'.
Calculated function values (from the class Function) on an element for assembling.
VonMisesFilter(std::vector< MeshFunctionSharedPtr< double > > solutions, double lambda, double mu, int cyl=0, int item1=H2D_FN_VAL, int item2=H2D_FN_VAL)
const int H2D_FN_VAL
Both components are usually requested together...
unsigned char num_components
Number of vector components.
Removes the imaginary part from a function.
virtual Func< Scalar > * get_pt_value(double x, double y, bool use_MeshHashGrid=false, Element *e=nullptr)
Return the value at the coordinates x,y.
virtual const Scalar * get_fn_values(int component=0) const
Returns function values.
virtual MeshFunction< Scalar > * clone() const
virtual void free()
Frees all precalculated tables.
virtual MeshFunction< double > * clone() const
Quad2D * quads[H2D_MAX_QUADRATURES]
List of available quadratures.
int cur_quad
Active quadrature (index into 'quads')
virtual void precalculate(unsigned short order, unsigned short mask)
precalculates the current function at the current integration points.
Represents the solution of a PDE.
virtual void precalculate(unsigned short order, unsigned short mask)
precalculates the current function at the current integration points.
virtual MeshFunction< double > * clone() const
virtual void pop_transform()
int order
Current function polynomial order.
virtual Func< double > * get_pt_value(double x, double y, bool use_MeshHashGrid=false, Element *e=nullptr)
Return the value at the coordinates x,y.
virtual Func< Scalar > * get_pt_value(double x, double y, bool use_MeshHashGrid=false, Element *e=nullptr)
Return the value at the coordinates x,y.