test(2rheolef)

πŸ“¦
version 7.2 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu questing

πŸ’– 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 (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