MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
geometrycontext.h
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
7#ifndef GEOMETRYCONTEXT_H
8#define GEOMETRYCONTEXT_H
9
10#include <iostream>
11#include "COMM/mpioverride.h"
13
14class GeometryIOBase;
15
17 public:
18 void readPropertyFile(FileType, const MChar* fileName);
19
20 GeometryProperty* getProperty(const MString& name, MInt segment);
22 if(m_geometryPropertyMap->find(name) == m_geometryPropertyMap->end()) {
23 std::cerr << "GeometryContext::noPropertySegments " << name << " not found " << std::endl;
24 return 0;
25 }
26 auto range = m_geometryPropertyMap->equal_range(name);
27
28 MInt no = 0;
29 for(auto& i = range.first; i != range.second; i++) {
30 no++;
31 }
32 return no;
33 }
34 MBool propertyExists(MString name, MInt solver);
35
37
38 void clear();
39
40 void init();
41
43
44 void writeProperties(MChar* fileName);
45
46 MInt getNoSegments() const { return m_noSegments; };
47
49 GeometryContext(const MPI_Comm comm) : m_mpiComm(comm){};
50 MPI_Comm mpiComm() const { return m_mpiComm; }
51
52 private:
60 std::pair<geometryPropertyMap::iterator, geometryPropertyMap::iterator> m_pair;
61 const MPI_Comm m_mpiComm = MPI_COMM_NULL;
62};
63
64#endif
std::pair< geometryPropertyMap::iterator, geometryPropertyMap::iterator > m_pair
MInt getNoSegments() const
geometryPropertyMap * m_geometryPropertyMap
geometryAssembly * m_geometryAssembly
void init()
This intializes the property Map.
MInt noPropertySegments(const MString &name)
MPI_Comm mpiComm() const
GeometryContext(const MPI_Comm comm)
const MPI_Comm m_mpiComm
MBool propertyExists(MString name, MInt solver)
bodyMap * m_bodyMap
GeometryProperty * getProperty(const MString &name, MInt segment)
void readPropertyFile(FileType, const MChar *fileName)
GeometryIOBase * m_geometryIOBase
void writeProperties(MChar *fileName)
This function writes all properties in a property File.
void addProperty(GeometryProperty *)
This method adds properties.
FileType
Definition: enums.h:18
@ no
Definition: enums.h:208
std::multimap< MString, GeometryProperty * > geometryPropertyMap
std::map< MString, Body * > bodyMap
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
bool MBool
Definition: maiatypes.h:58
char MChar
Definition: maiatypes.h:56