Commit e49206a1 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#108 A small test has been devised to understand the compilation problem with g++.

parent 9e4153b2
......@@ -174,6 +174,8 @@
BE643E0419AB8A3A00E9A4D7 /* Helper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE643E0119AB8A3A00E9A4D7 /* Helper.cpp */; };
BE643E0519AB8A3A00E9A4D7 /* Helper.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE643E0219AB8A3A00E9A4D7 /* Helper.hpp */; };
BE643E0619AB8A3A00E9A4D7 /* Helper.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE643E0319AB8A3A00E9A4D7 /* Helper.hxx */; };
BE6C215F19AF2FDB00CC674B /* libUtilities.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEA8A379177AD4FE009436C9 /* libUtilities.a */; };
BE6C216019AF2FDF00CC674B /* libCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE05B52916D238FE000E248D /* libCore.a */; };
BE72F5601958473900777F91 /* libOps.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEBA2B65194099C7002AB55B /* libOps.a */; };
BE72F5611958473900777F91 /* libSeldon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEBA299E19406ED3002AB55B /* libSeldon.a */; };
BE74051E188FBC870074D442 /* bdf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE74051C188FBC870074D442 /* bdf.cpp */; };
......@@ -868,6 +870,8 @@
BE643E0119AB8A3A00E9A4D7 /* Helper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Helper.cpp; sourceTree = "<group>"; };
BE643E0219AB8A3A00E9A4D7 /* Helper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Helper.hpp; sourceTree = "<group>"; };
BE643E0319AB8A3A00E9A4D7 /* Helper.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Helper.hxx; sourceTree = "<group>"; };
BE6C215D19AF26AE00CC674B /* SConscript */ = {isa = PBXFileReference; explicitFileType = text.script.python; name = SConscript; path = ../src/Test/SConscript; sourceTree = "<group>"; };
BE6C215E19AF2B9100CC674B /* input_test.lua */ = {isa = PBXFileReference; lastKnownFileType = text; name = input_test.lua; path = ../src/Test/input_test.lua; sourceTree = "<group>"; };
BE740513188FBC6C0074D442 /* Stokes */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Stokes; sourceTree = BUILT_PRODUCTS_DIR; };
BE74051C188FBC870074D442 /* bdf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = bdf.cpp; path = ../src/Problems/Stokes/bdf.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
BE74051D188FBC870074D442 /* bdf.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; name = bdf.hpp; path = ../src/Problems/Stokes/bdf.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
......@@ -1308,6 +1312,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
BE6C216019AF2FDF00CC674B /* libCore.a in Frameworks */,
BE6C215F19AF2FDB00CC674B /* libUtilities.a in Frameworks */,
BE3FD21D1962D60900EA8B54 /* libOps.a in Frameworks */,
BE3FD21E1962D60900EA8B54 /* libSeldon.a in Frameworks */,
BE5B73D517F9AE2100658918 /* Accelerate.framework in Frameworks */,
......@@ -1609,6 +1615,8 @@
BE372DCD18C47F0500127212 /* Test */ = {
isa = PBXGroup;
children = (
BE6C215D19AF26AE00CC674B /* SConscript */,
BE6C215E19AF2B9100CC674B /* input_test.lua */,
BE372DDB18C4802900127212 /* main_test.cpp */,
BE372DD818C47F9300127212 /* FiniteElement */,
BED748D0190672F900BAB761 /* OndomaticNumbering */,
......
......@@ -249,7 +249,14 @@ list_exec = SConscript('Problems/SConscript',
exports=(['env', 'all_libs']),
variant_dir=os.path.join(intermediate_variant_directory, 'Problems'),
duplicate=0)
list_test_exec = SConscript('Test/SConscript',
exports=(['env', 'all_libs']),
variant_dir=os.path.join(intermediate_variant_directory, 'Tests'),
duplicate=0)
list_exec.extend(list_test_exec)
# Install each executable in the final build folder.
for executable in list_exec:
......
import os
import copy
Import(['env', 'all_libs'])
list_exec = []
problems = ("Hyperelasticity", "Elasticity")
# For the time being only main_test in Tests folder is considered... Later on should be as Problems.
#for problem in problems:
# list_exec.append(SConscript(os.path.join(problem, 'SConscript'), ['env', 'all_libs'], duplicate=0))
main_src = Split('''
main_test.cpp
''')
test = env.Program('test', main_src,
LIBS=all_libs,
LIBPATH=env['LIBPATH'])
list_exec.append(test)
Return('list_exec')
-- Result
Foo = {
test = function (iComp, x, y, z)
end
-- Solid
Solid = {
-- Poisson coefficient
-- Expected format: VALUE
-- Constraint: v > 0.
poisson = 0.3,
-- Young modulus
-- Expected format: VALUE
-- Constraint: v > 0.
young = 21e5,
-- Adimensioned quantity?
-- Expected format: VALUE
-- Constraint: v > 0.
volumicMass = 1.
}
Petsc = {
solver = { "gmres", "preonly"}
}
\ No newline at end of file
......@@ -10,7 +10,9 @@
#include <iostream>
#include <string>
#include "Utilities/Containers/Tuple.hpp"
#include "ThirdParty/Wrappers/Mpi/Mpi.hpp"
#include "Core/InputParameterList.hpp"
//# include "yuni/core/String.h"
......@@ -20,54 +22,88 @@
//#include "ThirdParty/IncludeWithoutWarning/Seldon/Seldon.hpp"
//#include "ThirdParty/Wrappers/Seldon/SubVector.hpp"
namespace HappyHeart
{
typedef std::tuple
<
InputParameter::Solid::Poisson,
InputParameter::Solid::Young,
InputParameter::Solid::VolumicMass,
InputParameter::Petsc::Solver
> TestInputParameterTuple;
typedef InputParameterList<TestInputParameterTuple> TestInputParameterList;
} // namespace HappyHeart
using namespace HappyHeart;
int main(int argc, char** argv)
{
Wrappers::Mpi::InitEnvironment(argc, argv);
Wrappers::Mpi::shared_ptr mpi_world_ptr =
std::make_shared<Wrappers::Mpi>(0, MPI_COMM_WORLD); // must be called before Petsc RAII
TestInputParameterList
input_parameter_data("/Users/sebastien/Codes/HappyHeart/src/Test/input_test.lua",
mpi_world_ptr);
namespace IPL = Utilities::InputParameterListNS;
namespace Solid = InputParameter::Solid;
namespace Petsc = InputParameter::Petsc;
double poisson_ratio = IPL::ExtractValue<Solid::Poisson>::Value(input_parameter_data);
double young_modulus = IPL::ExtractValue<Solid::Young>::Value(input_parameter_data);
typedef std::tuple<int, double> Foo;
std::cout << "POISSON = " << poisson_ratio << std::endl;
std::cout << "YOUNG = " << young_modulus << std::endl;
std::tuple_element<0, Foo>::type a = 5;
const auto& solver_list = IPL::ExtractValue<Petsc::Solver>::Value(input_parameter_data);
std::cout << a << std::endl;
Utilities::PrintContainer(solver_list);
// Seldon::Vector<double> a(6);
// a(0) = 0.;
// a(1) = 0.1;
// a(2) = 0.4;
// a(3) = 0.9;
// a(4) = 10.;
// a(5) = 42.;
//
// Seldon::Vector<int> range(3);
// range(0) = 1;
// range(1) = 3;
// range(2) = 5;
//
// std::cout << a << std::endl;
//
// Seldon::SubVector<Seldon::Vector<double>> subvector(a, range);
//
// subvector(0) = -1.;
// subvector(1) = -2.;
// subvector(2) = -3.;
//
// std::cout << a << std::endl;
// Seldon::Vector<double> a(6);
// a(0) = 0.;
// a(1) = 0.1;
// a(2) = 0.4;
// a(3) = 0.9;
// a(4) = 10.;
// a(5) = 42.;
//
// Seldon::Vector<int> range(3);
// range(0) = 1;
// range(1) = 3;
// range(2) = 5;
//
// std::cout << a << std::endl;
//
// Seldon::SubVector<Seldon::Vector<double>> subvector(a, range);
//
// subvector(0) = -1.;
// subvector(1) = -2.;
// subvector(2) = -3.;
//
// std::cout << a << std::endl;
// typedef Yuni::CString<4, false> MyString;
//
//
//
// std::map<MyString, int> foo;
//
//
// foo["Foo"] = 4;
// foo["Bar"] = 42;
// foo["FooBaz"] = 10; subvector(0) = -1.;
//
// for (auto item:foo)
// std::cout << item.first << '\t' << item.second << std::endl;
// typedef Yuni::CString<4, false> MyString;
//
//
//
// std::map<MyString, int> foo;
//
//
// foo["Foo"] = 4;
// foo["Bar"] = 42;
// foo["FooBaz"] = 10; subvector(0) = -1.;
//
// for (auto item:foo)
// std::cout << item.first << '\t' << item.second << std::endl;
return 0;
}
......
......@@ -155,7 +155,8 @@ namespace HappyHeart
* \return The requested element in the tuple. It is either copied by value or a const reference.
*/
template<class InputParameterT, Private::CountAsUsed CountAsUsedT = Private::CountAsUsed::yes>
typename Utilities::ConstRefOrValue<typename InputParameterT::ReturnType::value_type>::type ReadHelper(unsigned int index) const;
typename Utilities::ConstRefOrValue<typename InputParameterT::ReturnType::value_type>::type
ReadHelper(unsigned int index) const;
/*!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment