Skip to content

Commit

Permalink
Setup project
Browse files Browse the repository at this point in the history
  • Loading branch information
fcooper8472 committed Jun 6, 2024
1 parent 7241363 commit cfec4cb
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
# Note that the order in which components are specified does not matter.

# Here we just depend on core components (nothing application-specific).
find_package(Chaste COMPONENTS continuum_mechanics global io linalg mesh ode pde)
find_package(Chaste COMPONENTS cell_based)

# Alternatively, to specify a Chaste installation directory use a line like that below.
# This is needed if your project is not contained in the projects folder within a Chaste source tree.
#find_package(Chaste COMPONENTS heart crypt PATHS /path/to/chaste-install NO_DEFAULT_PATH)

# Change the project name in the line below to match the folder this file is in,
# i.e. the name of your project.
chaste_do_project(template_project)
chaste_do_project(OpenVT)
2 changes: 1 addition & 1 deletion apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@

# This allows us to build executables (apps) using the project.
# Simply set the project name in the line below.
chaste_do_apps_project(template_project)
chaste_do_apps_project(OpenVT)
4 changes: 2 additions & 2 deletions apps/src/ExampleApp.cpp → apps/src/ExampleApp_OpenVT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "PetscTools.hpp"
#include "PetscException.hpp"

#include "Hello.hpp"
#include "Hello_OpenVT.hpp"

int main(int argc, char *argv[])
{
Expand All @@ -73,7 +73,7 @@ int main(int argc, char *argv[])
if (PetscTools::AmMaster())
{
std::string arg_i(argv[i]);
Hello world(arg_i);
Hello_OpenVT world(arg_i);
std::cout << "Argument " << i << " is " << world.GetMessage() << std::endl << std::flush;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/Hello.cpp → src/Hello_OpenVT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "Hello.hpp"
#include "Hello_OpenVT.hpp"
#include "Exception.hpp"

Hello::Hello(const std::string& rMessage)
Hello_OpenVT::Hello_OpenVT(const std::string& rMessage)
: mMessage(rMessage)
{
}

std::string Hello::GetMessage()
std::string Hello_OpenVT::GetMessage()
{
return mMessage;
}

void Hello::Complain(const std::string& rComplaint)
void Hello_OpenVT::Complain(const std::string& rComplaint)
{
EXCEPTION(rComplaint);
}
10 changes: 5 additions & 5 deletions src/Hello.hpp → src/Hello_OpenVT.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef HELLO_HPP_
#define HELLO_HPP_
#ifndef HELLO_OPENVT_HPP_
#define HELLO_OPENVT_HPP_

#include <string>

class Hello
class Hello_OpenVT
{
private:
std::string mMessage;

public:
Hello(const std::string& rMessage);
Hello_OpenVT(const std::string& rMessage);

std::string GetMessage();

void Complain(const std::string& rComplaint);
};

#endif /*HELLO_HPP_*/
#endif /*HELLO_OPENVT_HPP_*/
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@

# This allows us to build tests of the project.
# Simply set the project name in the line below.
chaste_do_test_project(template_project)
chaste_do_test_project(OpenVT)
2 changes: 1 addition & 1 deletion test/ContinuousTestPack.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TestHello.hpp
TestHello_OpenVT.hpp
18 changes: 9 additions & 9 deletions test/TestHello.hpp → test/TestHello_OpenVT.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef TESTHELLO_HPP_
#define TESTHELLO_HPP_
#ifndef TESTHELLO_OPENVT_HPP_
#define TESTHELLO_OPENVT_HPP_

#include <cxxtest/TestSuite.h>
/* Most Chaste code uses PETSc to solve linear algebra problems. This involves starting PETSc at the beginning of a test-suite
* and closing it at the end. (If you never run code in parallel then it is safe to replace PetscSetupAndFinalize.hpp with FakePetscSetup.hpp)
*/
#include "PetscSetupAndFinalize.hpp"
#include "Hello.hpp"
#include "Hello_OpenVT.hpp"

/**
* @file
Expand All @@ -51,7 +51,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* shortcut to compile and link against the correct libraries using scons).
*
* You can #include any of the files in the project 'src' folder.
* For example here we #include "Hello.hpp"
* For example here we #include "Hello_OpenVT.hpp"
*
* You can utilise any of the code in the main the Chaste trunk
* in exactly the same way.
Expand All @@ -60,14 +60,14 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* components of Chaste.
*/

class TestHello : public CxxTest::TestSuite
class TestHello_OpenVT : public CxxTest::TestSuite
{
public:
void TestHelloClass()
void TestHello_OpenVTClass()
{
// Create an object called 'world' of class 'Hello',
// (Hello.hpp is #included from the 'src' folder.)
Hello world("Hello world!");
// (Hello_OpenVT.hpp is #included from the 'src' folder.)
Hello_OpenVT world("Hello world!");

// The TS_ASSERT macros are used to test that the object performs as expected
TS_ASSERT_EQUALS(world.GetMessage(), "Hello world!");
Expand All @@ -76,4 +76,4 @@ class TestHello : public CxxTest::TestSuite
}
};

#endif /*TESTHELLO_HPP_*/
#endif /*TESTHELLO_OPENVT_HPP_*/

0 comments on commit cfec4cb

Please sign in to comment.