Contributing
Thank you for your interest in contributing to Cocoa!
Getting Started
Fork the repository on GitHub
Clone your fork locally
Create a feature branch
Make your changes
Write tests for your features
Submit a pull request
Development Environment
Prerequisites
C++20 compiler (GCC 11+, Clang 14+)
CMake 3.16+
Kokkos 5.0+ (included with Trilinos 17+)
Trilinos 17+ (with Tpetra, Belos, Ifpack2, KokkosKernels, Zoltan2)
Setup
git clone https://github.com/your-username/cocoa.git
cd cocoa
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON
make -j$(nproc)
Code Style
C++ Style
Use clang-format with the provided .clang-format file
Follow the C++ Core Guidelines
Use descriptive names (avoid abbreviations)
Document public APIs with Doxygen comments
/**
* @brief Computes the element mass matrix
*
* @param element_id Global element ID
* @param coords Node coordinates
* @return 3x3 mass matrix
*/
Matrix3d computeElementMass(int element_id,
const View<double*[2]>& coords);
Naming Conventions
Classes:
PascalCaseFunctions:
snake_caseVariables:
snake_caseConstants:
UPPER_SNAKE_CASEMember variables:
m_name(leading m_ prefix)
Commit Messages
Follow conventional commit format:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentationrefactor: Code refactoringtest: Adding testsperf: Performance improvement
Example:
feat(gwce): add spatially varying tau0 parameter
Allow tau0 to be specified per-element for improved accuracy
in complex geometries.
Closes #123
Pull Request Process
Ensure all tests pass
Update documentation if needed
Add tests for new functionality
Request review from maintainers
Address review feedback
Squash commits if requested
Testing Requirements
All new code must have tests
Tests must pass on all supported platforms
Code coverage should not decrease
Documentation
Document all public APIs
Update user guide for user-facing changes
Add examples for new features
Code Review
All submissions require review. Reviewers will check:
Correctness
Performance impact
Code style compliance
Test coverage
Documentation
License
By contributing, you agree that your contributions will be licensed under the project’s license.
Questions?
Open a GitHub issue
Contact the maintainers