Skip to content

Commit

Permalink
v0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
msparapa committed Apr 29, 2024
1 parent ffb84da commit 83cf43b
Show file tree
Hide file tree
Showing 19 changed files with 1,128 additions and 39 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.23)

project("Lielab"
VERSION 0.3.1
VERSION 0.3.2
LANGUAGES CXX)

if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
Expand Down
2 changes: 1 addition & 1 deletion Lielab/__release__.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Lielab
{
const std::string VERSION = "0.3.1";
const std::string VERSION = "0.3.2";
const std::string AUTHOR = "Michael J. Sparapany";
const std::string CONTACT = "mjspara@sandia.gov";
const std::string LOCATION = "https://github.com/sandialabs/Lielab";
Expand Down
82 changes: 75 additions & 7 deletions Lielab/domain/CompositeAlgebra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,18 @@ namespace domain
class CompositeAlgebra
{
public:
static constexpr size_t INDEX_cn = 0;
static constexpr size_t INDEX_gl = 1;
static constexpr size_t INDEX_rn = 2;
static constexpr size_t INDEX_se = 3;
static constexpr size_t INDEX_so = 4;
static constexpr size_t INDEX_sp = 5;
static constexpr size_t INDEX_su = 6;
static constexpr size_t INDEX_cn = 0;
static constexpr size_t INDEX_gl = 1;
static constexpr size_t INDEX_glc = 2;
static constexpr size_t INDEX_rn = 3;
static constexpr size_t INDEX_se = 4;
static constexpr size_t INDEX_so = 5;
static constexpr size_t INDEX_sp = 6;
static constexpr size_t INDEX_su = 7;

typedef std::variant<Lielab::domain::cn,
Lielab::domain::gl,
Lielab::domain::glc,
Lielab::domain::rn,
Lielab::domain::se,
Lielab::domain::so,
Expand Down Expand Up @@ -96,6 +98,10 @@ class CompositeAlgebra
{
dim += std::get<Lielab::domain::gl>(space[ii]).get_dimension();
}
else if (ind == INDEX_glc)
{
dim += std::get<Lielab::domain::glc>(space[ii]).get_dimension();
}
else if (ind == INDEX_rn)
{
dim += std::get<Lielab::domain::rn>(space[ii]).get_dimension();
Expand Down Expand Up @@ -136,6 +142,10 @@ class CompositeAlgebra
{
out(ii) = static_cast<int>(std::get<Lielab::domain::gl>(space[ii]).shape);
}
else if (ind == INDEX_glc)
{
out(ii) = static_cast<int>(std::get<Lielab::domain::glc>(space[ii]).shape);
}
else if (ind == INDEX_rn)
{
out(ii) = static_cast<int>(std::get<Lielab::domain::rn>(space[ii]).shape);
Expand Down Expand Up @@ -176,6 +186,10 @@ class CompositeAlgebra
{
vectors[ii] = std::get<Lielab::domain::gl>(this->space[ii]).get_vector();
}
else if (ind == INDEX_glc)
{
vectors[ii] = std::get<Lielab::domain::glc>(this->space[ii]).get_vector();
}
else if (ind == INDEX_rn)
{
vectors[ii] = std::get<Lielab::domain::rn>(this->space[ii]).get_vector();
Expand Down Expand Up @@ -219,6 +233,12 @@ class CompositeAlgebra
std::get<Lielab::domain::gl>(this->space[ii]).set_vector(vec(Eigen::seqN(jj, dim)));
jj += dim;
}
else if (ind == INDEX_glc)
{
const size_t dim = std::get<Lielab::domain::glc>(this->space[ii]).get_dimension();
std::get<Lielab::domain::glc>(this->space[ii]).set_vector(vec(Eigen::seqN(jj, dim)));
jj += dim;
}
else if (ind == INDEX_rn)
{
const size_t dim = std::get<Lielab::domain::rn>(this->space[ii]).get_dimension();
Expand Down Expand Up @@ -269,6 +289,10 @@ class CompositeAlgebra
{
out.space.push_back(std::get<Lielab::domain::gl>(this->space[ii]) + std::get<Lielab::domain::gl>(other.space[ii]));
}
else if (ind == INDEX_glc)
{
out.space.push_back(std::get<Lielab::domain::glc>(this->space[ii]) + std::get<Lielab::domain::glc>(other.space[ii]));
}
else if (ind == INDEX_rn)
{
out.space.push_back(std::get<Lielab::domain::rn>(this->space[ii]) + std::get<Lielab::domain::rn>(other.space[ii]));
Expand Down Expand Up @@ -309,6 +333,10 @@ class CompositeAlgebra
{
std::get<Lielab::domain::gl>(this->space[ii]) += std::get<Lielab::domain::gl>(other.space[ii]);
}
else if (ind == INDEX_glc)
{
std::get<Lielab::domain::glc>(this->space[ii]) += std::get<Lielab::domain::glc>(other.space[ii]);
}
else if (ind == INDEX_rn)
{
std::get<Lielab::domain::rn>(this->space[ii]) += std::get<Lielab::domain::rn>(other.space[ii]);
Expand Down Expand Up @@ -349,6 +377,10 @@ class CompositeAlgebra
{
out.space.push_back(std::get<Lielab::domain::gl>(this->space[ii]) - std::get<Lielab::domain::gl>(other.space[ii]));
}
else if (ind == INDEX_glc)
{
out.space.push_back(std::get<Lielab::domain::glc>(this->space[ii]) - std::get<Lielab::domain::glc>(other.space[ii]));
}
else if (ind == INDEX_rn)
{
out.space.push_back(std::get<Lielab::domain::rn>(this->space[ii]) - std::get<Lielab::domain::rn>(other.space[ii]));
Expand Down Expand Up @@ -389,6 +421,10 @@ class CompositeAlgebra
{
std::get<Lielab::domain::gl>(this->space[ii]) -= std::get<Lielab::domain::gl>(other.space[ii]);
}
else if (ind == INDEX_glc)
{
std::get<Lielab::domain::glc>(this->space[ii]) -= std::get<Lielab::domain::glc>(other.space[ii]);
}
else if (ind == INDEX_rn)
{
std::get<Lielab::domain::rn>(this->space[ii]) -= std::get<Lielab::domain::rn>(other.space[ii]);
Expand Down Expand Up @@ -429,6 +465,10 @@ class CompositeAlgebra
{
out.space.push_back(-std::get<Lielab::domain::gl>(this->space[ii]));
}
else if (ind == INDEX_glc)
{
out.space.push_back(-std::get<Lielab::domain::glc>(this->space[ii]));
}
else if (ind == INDEX_rn)
{
out.space.push_back(-std::get<Lielab::domain::rn>(this->space[ii]));
Expand Down Expand Up @@ -469,6 +509,10 @@ class CompositeAlgebra
{
out.space.push_back(std::get<Lielab::domain::gl>(this->space[ii]) * other);
}
else if (ind == INDEX_glc)
{
out.space.push_back(std::get<Lielab::domain::glc>(this->space[ii]) * other);
}
else if (ind == INDEX_rn)
{
out.space.push_back(std::get<Lielab::domain::rn>(this->space[ii]) * other);
Expand Down Expand Up @@ -507,6 +551,10 @@ class CompositeAlgebra
{
std::get<Lielab::domain::gl>(this->space[ii]) *= other;
}
else if (ind == INDEX_glc)
{
std::get<Lielab::domain::glc>(this->space[ii]) *= other;
}
else if (ind == INDEX_rn)
{
std::get<Lielab::domain::rn>(this->space[ii]) *= other;
Expand Down Expand Up @@ -547,6 +595,10 @@ class CompositeAlgebra
{
out.space.push_back(std::get<Lielab::domain::gl>(this->space[ii]) * std::get<Lielab::domain::gl>(other.space[ii]));
}
else if (ind == INDEX_glc)
{
out.space.push_back(std::get<Lielab::domain::glc>(this->space[ii]) * std::get<Lielab::domain::glc>(other.space[ii]));
}
else if (ind == INDEX_rn)
{
out.space.push_back(std::get<Lielab::domain::rn>(this->space[ii]) * std::get<Lielab::domain::rn>(other.space[ii]));
Expand Down Expand Up @@ -587,6 +639,10 @@ class CompositeAlgebra
{
std::get<Lielab::domain::gl>(this->space[ii]) *= std::get<Lielab::domain::gl>(other.space[ii]);
}
if (ind == INDEX_glc)
{
std::get<Lielab::domain::glc>(this->space[ii]) *= std::get<Lielab::domain::glc>(other.space[ii]);
}
else if (ind == INDEX_rn)
{
std::get<Lielab::domain::rn>(this->space[ii]) *= std::get<Lielab::domain::rn>(other.space[ii]);
Expand Down Expand Up @@ -627,6 +683,10 @@ class CompositeAlgebra
{
out.space.push_back(std::get<Lielab::domain::gl>(this->space[ii]) / other);
}
else if (ind == INDEX_glc)
{
out.space.push_back(std::get<Lielab::domain::glc>(this->space[ii]) / other);
}
else if (ind == INDEX_rn)
{
out.space.push_back(std::get<Lielab::domain::rn>(this->space[ii]) / other);
Expand Down Expand Up @@ -665,6 +725,10 @@ class CompositeAlgebra
{
std::get<Lielab::domain::gl>(this->space[ii]) /= other;
}
else if (ind == INDEX_glc)
{
std::get<Lielab::domain::glc>(this->space[ii]) /= other;
}
else if (ind == INDEX_rn)
{
std::get<Lielab::domain::rn>(this->space[ii]) /= other;
Expand Down Expand Up @@ -707,6 +771,10 @@ class CompositeAlgebra
{
out += "gl(" + std::to_string(shapes(ii)) + ")";
}
else if (ind == INDEX_glc)
{
out += "glc(" + std::to_string(shapes(ii)) + ")";
}
else if (ind == INDEX_rn)
{
out += "rn(" + std::to_string(shapes(ii)) + ")";
Expand Down
Loading

0 comments on commit 83cf43b

Please sign in to comment.