test(2rheolef)
π test β bestie edition π
okay so this is test(2rheolef), from the rheolef manual, version 7.2 β and yeah it's giving "cryptic C++ math thing" but honestly? it's so good once you get it. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
test β the test-function in a variational formulation (rheolef-7.2). that's the whole vibe. π
πΈ DESCRIPTION πΈ
So this class β plus its little partner, the trial one β exists for the test and trial functions that show up inside variational formulations. And how do you even write a variational formulation? You write it as an expression, in C++. periodt. π
A test function is the formal argument that lives inside the expression you hand to the integrate(3) function. like, watch:
geo omega ('circle');
space Xh (omega, 'P1');
test v (Xh);
field lh = integrate (omega, 2*v);
see how v is just there, being a formal lil guy? iconic. no cap. β¨
Now for a bilinear form(2), the test function is the second formal argument, and the first one is the one we call the trial one. so:
trial u (Xh);
test v (Xh);
form a = integrate (omega, dot(grad(u),grad(v)));
u is the trial, v is the test. they're a duo. main character energy, both of them. π
π¦ IMPLEMENTATION π¦
ngl this whole doc was generated straight from the file main/lib/test.h β that's where it comes from, fr fr.
So the test and trial classes are literally just aliases to the test_basic class. no extra layers, just vibes:
typedef test_basic<Float,rheo_default_memory_model,details::vf_tag_01> test;
typedef test_basic<Float,rheo_default_memory_model,details::vf_tag_10> trial;
And test_basic gives you an interface β through the smart_pointer(7) class family β to a data container. that's the whole structure, bestie:
template <class T, class M, class VfTag>
class test_basic : public smart_pointer<test_rep<T,M> > {
public :
// typedefs:
using rep = test_rep<T,M>;
using base = smart_pointer<rep>;
using size_type = typename rep::size_type;
using memory_type = typename rep::memory_type;
using value_type = typename rep::value_type;
using scalar_type = typename rep::scalar_type;
using float_type = typename rep::float_type;
using geo_type = typename rep::geo_type;
using space_type = typename rep::space_type;
using diff_type = typename rep::diff_type;
using is_elementwise = typename rep::is_elementwise;
using vf_tag_type = VfTag;
using vf_dual_tag_type = typename details::dual_vf_tag<VfTag>::type;
using self_type = test_basic<T,M,VfTag>;
using dual_self_type = test_basic<T,M,vf_dual_tag_type>;
// allocator/deallocator:
explicit test_basic (const space_type& V) : base(new_macro(rep(V))) {}
// accessors:
const space_type& get_vf_space() const { return base::data().get_vf_space(); }
static const space_constant::valued_type valued_hint = rep::valued_hint;
space_constant::valued_type valued_tag() const { return base::data().valued_tag(); }
size_type n_derivative() const { return base::data().n_derivative(); }
size_type size() const { return get_vf_space().size(); }
details::test_component<T,M,VfTag> operator[] (size_type i_comp) const;
};
like, that's it. that's the class. it ate. π₯
π AUTHOR π
Pierre Saramito <Pierre.Saramito@imag.fr> β the legend himself, we love him, we thank him π«Ά
π COPYRIGHT π
Copyright (C) 2000-2018 Pierre Saramito <Pierre.Saramito@imag.fr>
GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
bestie. listen. NO WARRANTY. I said what I said. π don't come for me.
okay so that's the whole page, and as a lil sign-off: this was rheolef, Version 7.2, the test(2rheolef) page π go integrate something gorgeous, you absolute icon πβ¨π¦
π¦ where this page comes from
- debian trixie: librheolef-dev 7.2-4 Β· GPL-3.0-or-later
- ubuntu noble: librheolef-dev 7.2-3build5 Β· GPL-3.0-or-later
- ubuntu questing: librheolef-dev 7.2-4build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms