A gateway can actually be a member of multiple communities.
I'm not aware of a way of determining this using just the gateway name.
But, you can dump the list of VPN Communities in dbedit:
[Expert@mumford:0]# dbedit -local
Please enter a command, -h for help or -q to quit:
dbedit> printxml communities
<communities_object>MyIntranet
<ID>1</ID><allow_all_encrypted_traffic>false</allow_all_encrypted_traffic>
<allow_all_encrypted_traffic_on><![CDATA[both]]></allow_all_encrypted_traffic_on><automatic_RIM>true</automatic_RIM><automatic_RIM_satellites>false</automatic_RIM_satellites><backup_stickiness>false</backup_stickiness>
<color><![CDATA[black]]></color>
<comments><![CDATA[]]></comments>
<cryptography>
<cryptography_profile><![CDATA[custom_profile]]></cryptography_profile>
<cryptography_type_support><![CDATA[ike_v1_only]]></cryptography_type_support>
</cryptography><customer_script_center>false</customer_script_center><customer_script_satellites>false</customer_script_satellites>
<default_mep_rule>
<Priority1>
</Priority1>
<Priority2>
</Priority2>
<Priority3>
</Priority3>
<source>
</source>
</default_mep_rule><disable_NAT>false</disable_NAT>
<disable_NAT_on><![CDATA[both]]></disable_NAT_on><enable_MEP>false</enable_MEP>
<exclude_srv>
</exclude_srv>
<ext_gateways_shared_secret>
</ext_gateways_shared_secret>
<ike_p1>
<ike_p1_dh_grp>ReferenceObject
<Name>Group 2 (1024 bit)</Name>
<Table>encryption</Table>
<Uid>{97AEB629-9AEA-11D5-BD16-0090272CCB30}</Uid>
</ike_p1_dh_grp>
<ike_p1_enc_alg><![CDATA[AES-256]]></ike_p1_enc_alg>
<ike_p1_hash_alg><![CDATA[SHA1]]></ike_p1_hash_alg>
<ike_p1_rekey_time>1440</ike_p1_rekey_time><ike_p1_use_aggressive>false</ike_p1_use_aggressive><ike_p1_use_aggressive_for_DAIP>false</ike_p1_use_aggressive_for_DAIP><ike_p1_use_shared_secret>false</ike_p1_use_shared_secret><ike_p1_use_shared_secret_for_DAIP>false</ike_p1_use_shared_secret_for_DAIP>
</ike_p1>
<ike_p2>
<ike_p2_enc_alg><![CDATA[AES-128]]></ike_p2_enc_alg>
<ike_p2_hash_alg><![CDATA[SHA1]]></ike_p2_hash_alg>
<ike_p2_ipcomp><![CDATA[None]]></ike_p2_ipcomp>
<ike_p2_pfs_dh_grp>ReferenceObject
<Name>Group 2 (1024 bit)</Name>
<Table>encryption</Table>
<Uid>{97AEB629-9AEA-11D5-BD16-0090272CCB30}</Uid>
</ike_p2_pfs_dh_grp>
<ike_p2_rekey_kbytes>50000</ike_p2_rekey_kbytes>
<ike_p2_rekey_time>3600</ike_p2_rekey_time><ike_p2_use_pfs>false</ike_p2_use_pfs><ike_p2_use_rekey_kbytes>false</ike_p2_use_rekey_kbytes><ike_p2_use_subnets>true</ike_p2_use_subnets>
</ike_p2>
<manual_mep_rules>
</manual_mep_rules>
<mep_mechanism><![CDATA[src]]></mep_mechanism><meshed_in_center>false</meshed_in_center>
<participant_gateways>
<unnamed_element setname="">ReferenceObject
<Name>dummygw</Name>
<Table>network_objects</Table>
<Uid>{DD30A946-0BEF-46BF-8944-33A8CA3183A2}</Uid>
</unnamed_element>
</participant_gateways>
<participants_domains>
</participants_domains>
<permanent_tunnel_down_track><![CDATA[log]]></permanent_tunnel_down_track>
<permanent_tunnel_list>
</permanent_tunnel_list>
<permanent_tunnel_participant_list>
</permanent_tunnel_participant_list>
<permanent_tunnel_participants><![CDATA[all_members]]></permanent_tunnel_participants>
<permanent_tunnel_up_track><![CDATA[log]]></permanent_tunnel_up_track>
<permanent_tunnels_def><![CDATA[none]]></permanent_tunnels_def>
<route_injection_track><![CDATA[log]]></route_injection_track><route_ret_packets>false</route_ret_packets>
<route_through_center><![CDATA[none]]></route_through_center>
<satellite_gateways>
</satellite_gateways>
<sel_mechanism><![CDATA[first]]></sel_mechanism><support_wire_mode>false</support_wire_mode><support_wire_mode_routing>false</support_wire_mode_routing>
<topology><![CDATA[meshed]]></topology>
<tunnel_granularity><![CDATA[per_subnet]]></tunnel_granularity>
<type><![CDATA[intranet_community]]></type>
<vpn_mep_resolver_notification><![CDATA[log]]></vpn_mep_resolver_notification>
</communities_object>
<communities_object>RemoteAccess
<ID>2</ID><automatic_RIM>true</automatic_RIM><automatic_RIM_satellites>false</automatic_RIM_satellites><backup_stickiness>false</backup_stickiness>
<color><![CDATA[black]]></color>
<comments><![CDATA[]]></comments>
<cryptography>
<cryptography_profile><![CDATA[custom_profile]]></cryptography_profile>
<cryptography_type_support><![CDATA[ike_v1_only]]></cryptography_type_support>
</cryptography><customer_script_center>false</customer_script_center><customer_script_satellites>false</customer_script_satellites>
<default_mep_rule>
<Priority1>
</Priority1>
<Priority2>
</Priority2>
<Priority3>
</Priority3>
<source>
</source>
</default_mep_rule><enable_MEP>false</enable_MEP>
<ike_p1>
<ike_p1_dh_grp>ReferenceObject
<Name>Group 2 (1024 bit)</Name>
<Table>encryption</Table>
<Uid>{97AEB629-9AEA-11D5-BD16-0090272CCB30}</Uid>
</ike_p1_dh_grp>
<ike_p1_enc_alg><![CDATA[AES-256]]></ike_p1_enc_alg>
<ike_p1_hash_alg><![CDATA[SHA1]]></ike_p1_hash_alg>
<ike_p1_rekey_time>1440</ike_p1_rekey_time><ike_p1_use_aggressive>false</ike_p1_use_aggressive><ike_p1_use_aggressive_for_DAIP>false</ike_p1_use_aggressive_for_DAIP><ike_p1_use_shared_secret>false</ike_p1_use_shared_secret><ike_p1_use_shared_secret_for_DAIP>false</ike_p1_use_shared_secret_for_DAIP>
</ike_p1>
<ike_p2>
<ike_p2_enc_alg><![CDATA[AES-128]]></ike_p2_enc_alg>
<ike_p2_hash_alg><![CDATA[SHA1]]></ike_p2_hash_alg>
<ike_p2_ipcomp><![CDATA[None]]></ike_p2_ipcomp>
<ike_p2_pfs_dh_grp>ReferenceObject
<Name>Group 2 (1024 bit)</Name>
<Table>encryption</Table>
<Uid>{97AEB629-9AEA-11D5-BD16-0090272CCB30}</Uid>
</ike_p2_pfs_dh_grp>
<ike_p2_rekey_kbytes>50000</ike_p2_rekey_kbytes>
<ike_p2_rekey_time>3600</ike_p2_rekey_time><ike_p2_use_pfs>false</ike_p2_use_pfs><ike_p2_use_rekey_kbytes>false</ike_p2_use_rekey_kbytes><ike_p2_use_subnets>true</ike_p2_use_subnets>
</ike_p2>
<manual_mep_rules>
</manual_mep_rules>
<mep_mechanism><![CDATA[src]]></mep_mechanism>
<participant_gateways>
<unnamed_element setname="">ReferenceObject
<Name>oscar</Name>
<Table>network_objects</Table>
<Uid>{5C34E630-E06C-41FD-BA2F-172B0BC62576}</Uid>
</unnamed_element>
<unnamed_element setname="">ReferenceObject
<Name>dummygw</Name>
<Table>network_objects</Table>
<Uid>{DD30A946-0BEF-46BF-8944-33A8CA3183A2}</Uid>
</unnamed_element>
</participant_gateways>
<participant_users_groups>
<unnamed_element setname="">ReferenceObject
<Name>All Users</Name>
<Table>globals</Table>
<Uid>{97AEB36A-9AEB-11D5-BD16-0090272CCB30}</Uid>
</unnamed_element>
</participant_users_groups>
<participants_domains>
</participants_domains>
<route_injection_track><![CDATA[log]]></route_injection_track><route_ret_packets>false</route_ret_packets>
<sel_mechanism><![CDATA[first]]></sel_mechanism>
<type><![CDATA[sr_community]]></type>
<vpn_mep_resolver_notification><![CDATA[log]]></vpn_mep_resolver_notification>
</communities_object>