22 template<
typename Scalar>
27 template<
typename Scalar>
28 MeshFunctionSharedPtr<Scalar>::MeshFunctionSharedPtr(
const MeshFunctionSharedPtr& other) :
std::tr1::shared_ptr<
Hermes::Hermes2D::MeshFunction<Scalar> >(other)
32 template<
typename Scalar>
33 void MeshFunctionSharedPtr<Scalar>::operator=(
const MeshFunctionSharedPtr& other)
35 std::tr1::shared_ptr<Hermes::Hermes2D::MeshFunction<Scalar> >::operator=(other);
38 template<
typename Scalar>
44 template class HERMES_API MeshFunctionSharedPtr < double > ;
45 template class HERMES_API MeshFunctionSharedPtr < std::complex<double> > ;
47 template<
typename Scalar>
54 template<
typename Scalar>
61 template<
typename Scalar>
67 template<
typename Scalar>
70 return "MeshFunction";
73 template<
typename Scalar>
76 throw Exceptions::Exception(
"This instance is in fact not a Solution instance in copy().");
79 template<
typename Scalar>
85 template<
typename Scalar>
89 if (this->mesh ==
nullptr)
93 if (this->mesh->get_max_element_id() < 0)
94 throw Hermes::Exceptions::Exception(
"Internal exception.");
95 this->mesh->get_element(this->mesh->get_max_element_id() - 1);
99 std::cout << e.what();
105 template<
typename Scalar>
110 template<
typename Scalar>
115 template<
typename Scalar>
122 template<
typename Scalar>
125 throw Exceptions::MethodNotOverridenException(
"MeshFunction<Scalar>::add");
128 template<
typename Scalar>
131 throw Exceptions::MethodNotOverridenException(
"MeshFunction<Scalar>::multiply");
139 Quad2D *old_quad = this->get_quad_2d();
140 this->set_quad_2d(&g_quad_lin);
142 double max = std::numeric_limits<double>::min();
162 for_all_active_elements(e, this->mesh)
164 this->set_active_element(e);
165 this->set_quad_order(1, item);
166 const double* val = this->get_values(component, value_type);
167 for (
int i = 0; i < (e->is_triangle() ? 3 : 4); i++)
175 this->set_quad_2d(old_quad);
180 std::complex<double> MeshFunction<std::complex<double> >::get_approx_max_value(
int item_)
183 this->warn(
"Asked for a max value of a complex function.");
184 return std::numeric_limits<std::complex<double> >::min();
192 Quad2D *old_quad = this->get_quad_2d();
193 this->set_quad_2d(&g_quad_lin);
195 double min = std::numeric_limits<double>::max();
215 for_all_active_elements(e, this->mesh)
217 this->set_active_element(e);
218 this->set_quad_order(1, item);
219 const double* val = this->get_values(component, value_type);
220 for (
int i = 0; i < (e->is_triangle() ? 3 : 4); i++)
228 this->set_quad_2d(old_quad);
233 std::complex<double> MeshFunction<std::complex<double> >::get_approx_min_value(
int item_)
236 this->warn(
"Asked for a min value of a complex function.");
237 return std::numeric_limits<std::complex<double> >::max();
240 template<
typename Scalar>
246 template<
typename Scalar>
252 template<
typename Scalar>
256 this->update_refmap();
260 template<
typename Scalar>
263 if (quad_2d ==
nullptr)
264 throw Exceptions::NullException(1);
266 refmap.set_quad_2d(quad_2d);
269 template<
typename Scalar>
273 throw Hermes::Exceptions::Exception(
"Cannot select inactive element. Wrong mesh?");
276 mode = e->get_mode();
277 refmap.set_active_element(e);
280 template<
typename Scalar>
286 template class HERMES_API MeshFunction < double > ;
287 template class HERMES_API MeshFunction < std::complex<double> > ;
MeshFunction()
Empty constructor.
virtual double get_approx_min_value(int item=H2D_FN_VAL_0)
Return the approximate minimum value of this instance.
Stores one element of a mesh.
virtual void init()
Internal.
virtual void copy(const MeshFunction< Scalar > *sln)
Copy from sln to this instance.
virtual bool isOkay() const
State querying helpers.
Represents a function defined on a mesh.
::xsd::cxx::tree::exception< char > exception
Root of the C++/Tree exception hierarchy.
Used to pass the instances of Space around.
std::string getClassName() const
Internal.
virtual void multiply(Scalar coef)
Multiplies the function represented by this class by the given coefficient.
virtual void force_transform(uint64_t sub_idx, Trf *ctm)
For internal use only.
Represents an arbitrary function defined on an element.
virtual void add(MeshFunctionSharedPtr< Scalar > &other_mesh_function, SpaceSharedPtr< Scalar > target_space)
virtual void reinit()
Internal.
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.
Represents the reference mapping.
bool active
0 = active, no sons; 1 = inactive (refined), has sons
Represents the solution of a PDE.
virtual Scalar get_approx_max_value(int item=H2D_FN_VAL_0)
Return the approximate maximum value of this instance.
virtual void free()
Frees all precalculated tables.
virtual ~MeshFunction()
Destructor.